From a7ce3f1723137c3eca275c5e5860164e2baa76d6 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 25 Apr 2002 18:13:42 +0000 Subject: [PATCH] moved template instances to a separate file --- src/ca/CASG.cpp | 28 +++++++--------------------- src/ca/cacServiceList.cpp | 11 ----------- src/ca/comBuf.cpp | 12 ------------ src/ca/getCallback.cpp | 12 ------------ src/ca/getCopy.cpp | 15 ++------------- 5 files changed, 9 insertions(+), 69 deletions(-) diff --git a/src/ca/CASG.cpp b/src/ca/CASG.cpp index 745837e12..b6b904ecb 100644 --- a/src/ca/CASG.cpp +++ b/src/ca/CASG.cpp @@ -36,20 +36,6 @@ #include "autoPtrDestroy.h" #include "cac.h" -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class tsFreeList < CASG, 128 >; -template class epicsSingleton < tsFreeList < struct CASG, 128 > >; -template class tsFreeList < syncGroupReadNotify, 128, epicsMutexNOOP >; -template class tsFreeList < syncGroupWriteNotify, 128, epicsMutexNOOP >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - epicsSingleton < tsFreeList < struct CASG, 128 > > CASG::pFreeList; CASG::CASG ( oldCAC &cacIn ) : @@ -144,7 +130,7 @@ int CASG::block ( double timeout ) void CASG::reset () { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); this->destroyCompletedIO (); this->destroyPendingIO (); } @@ -186,7 +172,7 @@ void CASG::show ( unsigned level ) const ::printf ( "Sync Group: id=%u, magic=%u, opPend=%u\n", this->getId (), this->magic, this->ioPendingList.count () ); if ( level ) { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); ::printf ( "\tPending" ); tsDLIterConstBD < syncGroupNotify > notifyPending = this->ioPendingList.firstIter (); while ( notifyPending.valid () ) { @@ -206,7 +192,7 @@ bool CASG::ioComplete () { bool isCompleted; { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); this->destroyCompletedIO (); isCompleted = ( this->ioPendingList.count () == 0u ); } @@ -218,7 +204,7 @@ int CASG::put ( chid pChan, unsigned type, arrayElementCount count, const void * syncGroupWriteNotify * pNotify = 0; try { { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); pNotify = syncGroupWriteNotify::factory ( this->freeListWriteOP, *this, pChan ); if ( pNotify ) { @@ -283,7 +269,7 @@ int CASG::get ( chid pChan, unsigned type, arrayElementCount count, void *pValue syncGroupReadNotify * pNotify = 0; try { { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); pNotify = syncGroupReadNotify::factory ( this->freeListReadOP, *this, pChan, pValue ); if ( pNotify ) { @@ -340,7 +326,7 @@ int CASG::get ( chid pChan, unsigned type, arrayElementCount count, void *pValue void CASG::destroyPendingIO ( syncGroupNotify * pNotify ) { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); if ( pNotify ) { this->ioPendingList.remove ( *pNotify ); pNotify->destroy ( *this ); @@ -351,7 +337,7 @@ void CASG::completionNotify ( syncGroupNotify & notify ) { unsigned requestsIncomplete; { - epicsGuard < epicsMutex > locker ( this->mutex ); + epicsGuard < casgMutex > locker ( this->mutex ); this->ioPendingList.remove ( notify ); this->ioCompletedList.add ( notify ); requestsIncomplete = this->ioPendingList.count (); diff --git a/src/ca/cacServiceList.cpp b/src/ca/cacServiceList.cpp index 24234b003..1c44e238a 100644 --- a/src/ca/cacServiceList.cpp +++ b/src/ca/cacServiceList.cpp @@ -21,17 +21,6 @@ #include "epicsGuard.h" #include "cacIO.h" -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class epicsSingleton < cacServiceList >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - epicsShareDef epicsSingleton < cacServiceList > pGlobalServiceListCAC; cacServiceList::cacServiceList () diff --git a/src/ca/comBuf.cpp b/src/ca/comBuf.cpp index fe162e67f..6c54ee375 100644 --- a/src/ca/comBuf.cpp +++ b/src/ca/comBuf.cpp @@ -19,18 +19,6 @@ #include "iocinf.h" #include "comBuf.h" -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class tsFreeList < comBuf, 0x20 >; -template class epicsSingleton < tsFreeList < comBuf, 0x20 > >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - epicsSingleton < tsFreeList < class comBuf, 0x20 > > comBuf::pFreeList; bool comBuf::flushToWire ( wireSendAdapter &wire ) diff --git a/src/ca/getCallback.cpp b/src/ca/getCallback.cpp index f4a3c70f5..fba722c00 100644 --- a/src/ca/getCallback.cpp +++ b/src/ca/getCallback.cpp @@ -19,18 +19,6 @@ #include "iocinf.h" #include "oldAccess.h" -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class tsFreeList < getCallback, 1024 >; -template class epicsSingleton < tsFreeList < getCallback, 1024 > >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - epicsSingleton < tsFreeList < class getCallback, 1024 > > getCallback::pFreeList; getCallback::getCallback ( oldChannelNotify &chanIn, diff --git a/src/ca/getCopy.cpp b/src/ca/getCopy.cpp index 86d527c3a..eca91c8e9 100644 --- a/src/ca/getCopy.cpp +++ b/src/ca/getCopy.cpp @@ -22,18 +22,6 @@ #include "oldAccess.h" #include "cac.h" -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class tsFreeList < getCopy, 1024 >; -template class epicsSingleton < tsFreeList < getCopy, 1024 > >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - epicsSingleton < tsFreeList < class getCopy, 1024 > > getCopy::pFreeList; getCopy::getCopy ( oldCAC &cacCtxIn, oldChannelNotify &chanIn, @@ -62,7 +50,8 @@ void getCopy::completion ( unsigned typeIn, arrayElementCount countIn, const void *pDataIn ) { if ( this->type == typeIn ) { - memcpy ( this->pValue, pDataIn, dbr_size_n ( typeIn, countIn ) ); + unsigned size = dbr_size_n ( typeIn, countIn ); + memcpy ( this->pValue, pDataIn, size ); this->cacCtx.decrementOutstandingIO ( this->readSeq ); } else {