From 05c347434b98c569d8db0b62d4c4006d7421c08c Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 01/11] use auto_ptr instead of epics_auto_ptr where applicable --- src/ca/client/ca_client_context.cpp | 4 ++-- src/ca/client/oldAccess.h | 6 ++++-- src/ioc/db/dbCAC.h | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ca/client/ca_client_context.cpp b/src/ca/client/ca_client_context.cpp index 20a6e84c8..a2e5d8ac3 100644 --- a/src/ca/client/ca_client_context.cpp +++ b/src/ca/client/ca_client_context.cpp @@ -159,13 +159,13 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) : this->localPort = htons ( tmpAddr.ia.sin_port ); } - epics_auto_ptr < CallbackGuard > pCBGuard; + std::auto_ptr < CallbackGuard > pCBGuard; if ( ! enablePreemptiveCallback ) { pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) ); } // multiple steps ensure exception safety - this->pCallbackGuard = pCBGuard; + std::swap(this->pCallbackGuard, pCBGuard); } ca_client_context::~ca_client_context () diff --git a/src/ca/client/oldAccess.h b/src/ca/client/oldAccess.h index 04f551839..875b086fe 100644 --- a/src/ca/client/oldAccess.h +++ b/src/ca/client/oldAccess.h @@ -26,6 +26,8 @@ #ifndef oldAccessh #define oldAccessh +#include + #ifdef epicsExportSharedSymbols # define oldAccessh_restore_epicsExportSharedSymbols # undef epicsExportSharedSymbols @@ -402,8 +404,8 @@ private: epicsEvent ioDone; epicsEvent callbackThreadActivityComplete; epicsThreadId createdByThread; - epics_auto_ptr < CallbackGuard > pCallbackGuard; - epics_auto_ptr < cacContext > pServiceContext; + std::auto_ptr < CallbackGuard > pCallbackGuard; + std::auto_ptr < cacContext > pServiceContext; caExceptionHandler * ca_exception_func; void * ca_exception_arg; caPrintfFunc * pVPrintfFunc; diff --git a/src/ioc/db/dbCAC.h b/src/ioc/db/dbCAC.h index 70d9e205b..7847f0a2b 100644 --- a/src/ioc/db/dbCAC.h +++ b/src/ioc/db/dbCAC.h @@ -36,6 +36,8 @@ #include "stdlib.h" +#include // std::auto_ptr + #include "tsDLList.h" #include "tsFreeList.h" #include "resourceLib.h" @@ -203,7 +205,7 @@ private: epicsMutex & mutex; epicsMutex & cbMutex; cacContextNotify & notify; - epics_auto_ptr < cacContext > pNetContext; + std::auto_ptr < cacContext > pNetContext; char * pStateNotifyCache; bool isolated; From 673cb24fc23a3c0a34266cbed5e5c34899a3e706 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 02/11] replace use of epics_auto_ptr w/ eapt_array add helpers for udpiiu to calculate parameters maxPeriod and nTimers, allowing them to be const. Add SearchArray to hold fixed-size array of auto_ptr. --- src/ca/client/nciu.h | 1 + src/ca/client/udpiiu.cpp | 85 +++++++++++++++++++++++----------------- src/ca/client/udpiiu.h | 17 ++++++-- 3 files changed, 65 insertions(+), 38 deletions(-) diff --git a/src/ca/client/nciu.h b/src/ca/client/nciu.h index 4994465a8..7cba6e82b 100644 --- a/src/ca/client/nciu.h +++ b/src/ca/client/nciu.h @@ -58,6 +58,7 @@ protected: channelNode (); bool isInstalledInServer ( epicsGuard < epicsMutex > & ) const; bool isConnected ( epicsGuard < epicsMutex > & ) const; +public: static unsigned getMaxSearchTimerCount (); private: enum channelState { diff --git a/src/ca/client/udpiiu.cpp b/src/ca/client/udpiiu.cpp index adf2ba949..837a836d9 100644 --- a/src/ca/client/udpiiu.cpp +++ b/src/ca/client/udpiiu.cpp @@ -64,6 +64,52 @@ const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC [] = &udpiiu::repeaterAckAction, }; + +static +double getMaxPeriod() +{ + double maxPeriod = maxSearchPeriodDefault; + + if ( envGetConfigParamPtr ( & EPICS_CA_MAX_SEARCH_PERIOD ) ) { + long longStatus = envGetDoubleConfigParam ( + & EPICS_CA_MAX_SEARCH_PERIOD, & maxPeriod ); + if ( ! longStatus ) { + if ( maxPeriod < maxSearchPeriodLowerLimit ) { + epicsPrintf ( "\"%s\" out of range (low)\n", + EPICS_CA_MAX_SEARCH_PERIOD.name ); + maxPeriod = maxSearchPeriodLowerLimit; + epicsPrintf ( "Setting \"%s\" = %f seconds\n", + EPICS_CA_MAX_SEARCH_PERIOD.name, maxPeriod ); + } + } + else { + epicsPrintf ( "EPICS \"%s\" wasnt a real number\n", + EPICS_CA_MAX_SEARCH_PERIOD.name ); + epicsPrintf ( "Setting \"%s\" = %f seconds\n", + EPICS_CA_MAX_SEARCH_PERIOD.name, maxPeriod ); + } + } + + return maxPeriod; +} + +static +unsigned getNTimers(double maxPeriod) +{ + unsigned nTimers = static_cast < unsigned > ( 1.0 + log ( maxPeriod / minRoundTripEstimate ) / log ( 2.0 ) ); + + if ( nTimers > channelNode::getMaxSearchTimerCount () ) { + nTimers = channelNode::getMaxSearchTimerCount (); + epicsPrintf ( "\"%s\" out of range (high)\n", + EPICS_CA_MAX_SEARCH_PERIOD.name ); + epicsPrintf ( "Setting \"%s\" = %f seconds\n", + EPICS_CA_MAX_SEARCH_PERIOD.name, + (1<<(nTimers-1)) * minRoundTripEstimate ); + } + + return nTimers; +} + // // udpiiu::udpiiu () // @@ -85,14 +131,15 @@ udpiiu::udpiiu ( repeaterSubscribeTmr ( m_repeaterTimerNotify, timerQueue, cbMutexIn, ctxNotifyIn ), govTmr ( *this, timerQueue, cacMutexIn ), - maxPeriod ( maxSearchPeriodDefault ), + maxPeriod ( getMaxPeriod() ), rtteMean ( minRoundTripEstimate ), rtteMeanDev ( 0 ), cacRef ( cac ), cbMutex ( cbMutexIn ), cacMutex ( cacMutexIn ), + nTimers ( getNTimers(maxPeriod) ), + ppSearchTmr ( nTimers ), nBytesInXmitBuf ( 0 ), - nTimers ( 0 ), beaconAnomalyTimerIndex ( 0 ), sequenceNumber ( 0 ), lastReceivedSeqNo ( 0 ), @@ -104,45 +151,13 @@ udpiiu::udpiiu ( lastReceivedSeqNoIsValid ( false ) { cacGuard.assertIdenticalMutex ( cacMutex ); - - if ( envGetConfigParamPtr ( & EPICS_CA_MAX_SEARCH_PERIOD ) ) { - long longStatus = envGetDoubleConfigParam ( - & EPICS_CA_MAX_SEARCH_PERIOD, & this->maxPeriod ); - if ( ! longStatus ) { - if ( this->maxPeriod < maxSearchPeriodLowerLimit ) { - epicsPrintf ( "\"%s\" out of range (low)\n", - EPICS_CA_MAX_SEARCH_PERIOD.name ); - this->maxPeriod = maxSearchPeriodLowerLimit; - epicsPrintf ( "Setting \"%s\" = %f seconds\n", - EPICS_CA_MAX_SEARCH_PERIOD.name, this->maxPeriod ); - } - } - else { - epicsPrintf ( "EPICS \"%s\" wasnt a real number\n", - EPICS_CA_MAX_SEARCH_PERIOD.name ); - epicsPrintf ( "Setting \"%s\" = %f seconds\n", - EPICS_CA_MAX_SEARCH_PERIOD.name, this->maxPeriod ); - } - } - double powerOfTwo = log ( this->maxPeriod / minRoundTripEstimate ) / log ( 2.0 ); - this->nTimers = static_cast < unsigned > ( powerOfTwo + 1.0 ); - if ( this->nTimers > channelNode::getMaxSearchTimerCount () ) { - this->nTimers = channelNode::getMaxSearchTimerCount (); - epicsPrintf ( "\"%s\" out of range (high)\n", - EPICS_CA_MAX_SEARCH_PERIOD.name ); - epicsPrintf ( "Setting \"%s\" = %f seconds\n", - EPICS_CA_MAX_SEARCH_PERIOD.name, - (1<<(this->nTimers-1)) * minRoundTripEstimate ); - } - - powerOfTwo = log ( beaconAnomalySearchPeriod / minRoundTripEstimate ) / log ( 2.0 ); + double powerOfTwo = log ( beaconAnomalySearchPeriod / minRoundTripEstimate ) / log ( 2.0 ); this->beaconAnomalyTimerIndex = static_cast < unsigned > ( powerOfTwo + 1.0 ); if ( this->beaconAnomalyTimerIndex >= this->nTimers ) { this->beaconAnomalyTimerIndex = this->nTimers - 1; } - this->ppSearchTmr.reset ( new epics_auto_ptr < class searchTimer > [ this->nTimers ] ); for ( unsigned i = 0; i < this->nTimers; i++ ) { this->ppSearchTmr[i].reset ( new searchTimer ( *this, timerQueue, i, cacMutexIn, diff --git a/src/ca/client/udpiiu.h b/src/ca/client/udpiiu.h index 103547919..595b8daad 100644 --- a/src/ca/client/udpiiu.h +++ b/src/ca/client/udpiiu.h @@ -25,6 +25,8 @@ #ifndef udpiiuh #define udpiiuh +#include + #ifdef epicsExportSharedSymbols # define udpiiuh_accessh_epicsExportSharedSymbols # undef epicsExportSharedSymbols @@ -160,15 +162,24 @@ private: repeaterSubscribeTimer repeaterSubscribeTmr; disconnectGovernorTimer govTmr; tsDLList < SearchDest > _searchDestList; - double maxPeriod; + const double maxPeriod; double rtteMean; double rtteMeanDev; cac & cacRef; epicsMutex & cbMutex; epicsMutex & cacMutex; - epics_auto_ptr < epics_auto_ptr < class searchTimer >, eapt_array > ppSearchTmr; + const unsigned nTimers; + struct SearchArray { + typedef std::auto_ptr value_type; + value_type *arr; + SearchArray(size_t n) : arr(new value_type[n]) {} + ~SearchArray() { delete[] arr; } + value_type& operator[](size_t i) const { return arr[i]; } + private: + SearchArray(const SearchArray&); + SearchArray& operator=(const SearchArray&); + } ppSearchTmr; unsigned nBytesInXmitBuf; - unsigned nTimers; unsigned beaconAnomalyTimerIndex; ca_uint32_t sequenceNumber; ca_uint32_t lastReceivedSeqNo; From 954874dbd665047e2fa16f290724bbf55cfda0e7 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 03/11] drop epicsMemory.h --- src/ca/client/oldAccess.h | 1 - src/ca/client/templateInstances.cpp | 1 - src/ca/client/udpiiu.h | 1 - src/ca/client/virtualCircuit.h | 1 - src/ioc/db/dbCAC.h | 1 - src/ioc/db/dbChannelIO.h | 1 - src/libCom/cppStd/Makefile | 1 - src/libCom/cppStd/epicsMemory.h | 115 ---------------------------- 8 files changed, 122 deletions(-) delete mode 100644 src/libCom/cppStd/epicsMemory.h diff --git a/src/ca/client/oldAccess.h b/src/ca/client/oldAccess.h index 875b086fe..c893eeb68 100644 --- a/src/ca/client/oldAccess.h +++ b/src/ca/client/oldAccess.h @@ -34,7 +34,6 @@ #endif #include "tsFreeList.h" -#include "epicsMemory.h" #include "compilerDependencies.h" #include "osiSock.h" diff --git a/src/ca/client/templateInstances.cpp b/src/ca/client/templateInstances.cpp index dd8b5113e..f83366087 100644 --- a/src/ca/client/templateInstances.cpp +++ b/src/ca/client/templateInstances.cpp @@ -67,7 +67,6 @@ template class tsFreeList < oldSubscription, 1024, epicsMutexNOOP >; template class tsFreeList < putCallback, 1024, epicsMutexNOOP >; template class tsFreeList < repeaterClient, 0x20 >; template class epicsSingleton < localHostName >; -template class epics_auto_ptr < epics_auto_ptr < class searchTimer >, eapt_array >; template unsigned comBuf :: push ( const double * pValue, unsigned nElem ); template unsigned comBuf :: push ( const float * pValue, unsigned nElem ); template unsigned comBuf :: push ( const int * pValue, unsigned nElem ); diff --git a/src/ca/client/udpiiu.h b/src/ca/client/udpiiu.h index 595b8daad..b5ea2f20a 100644 --- a/src/ca/client/udpiiu.h +++ b/src/ca/client/udpiiu.h @@ -34,7 +34,6 @@ #include "osiSock.h" #include "epicsThread.h" -#include "epicsMemory.h" #include "epicsTime.h" #include "tsMinMax.h" #include "tsDLList.h" diff --git a/src/ca/client/virtualCircuit.h b/src/ca/client/virtualCircuit.h index 017b99d0e..4309aac1e 100644 --- a/src/ca/client/virtualCircuit.h +++ b/src/ca/client/virtualCircuit.h @@ -25,7 +25,6 @@ #ifndef virtualCircuith #define virtualCircuith -#include "epicsMemory.h" #include "tsDLList.h" #include "tsMinMax.h" diff --git a/src/ioc/db/dbCAC.h b/src/ioc/db/dbCAC.h index 7847f0a2b..92d6a2689 100644 --- a/src/ioc/db/dbCAC.h +++ b/src/ioc/db/dbCAC.h @@ -43,7 +43,6 @@ #include "resourceLib.h" #include "cacIO.h" #include "compilerDependencies.h" -#include "epicsMemory.h" #ifdef dbCACh_restore_epicsExportSharedSymbols # define epicsExportSharedSymbols diff --git a/src/ioc/db/dbChannelIO.h b/src/ioc/db/dbChannelIO.h index e1b63d760..42c9cb5c9 100644 --- a/src/ioc/db/dbChannelIO.h +++ b/src/ioc/db/dbChannelIO.h @@ -36,7 +36,6 @@ #endif #include "compilerDependencies.h" -#include "epicsMemory.h" #ifdef dbChannelIOh_restore_epicsExportSharedSymbols # define epicsExportSharedSymbols diff --git a/src/libCom/cppStd/Makefile b/src/libCom/cppStd/Makefile index 989b87eb0..782c4da25 100644 --- a/src/libCom/cppStd/Makefile +++ b/src/libCom/cppStd/Makefile @@ -10,5 +10,4 @@ SRC_DIRS += $(LIBCOM)/cppStd INC += epicsAlgorithm.h INC += epicsExcept.h -INC += epicsMemory.h diff --git a/src/libCom/cppStd/epicsMemory.h b/src/libCom/cppStd/epicsMemory.h deleted file mode 100644 index 49c9ebecc..000000000 --- a/src/libCom/cppStd/epicsMemory.h +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ -// epicsMemoryH.h -// Author: Jeff Hill -// Date: March 2001 - -#ifndef epicsMemoryH -#define epicsMemoryH - -enum epics_auto_ptr_type { - eapt_scalar, eapt_array }; - -template < class T, epics_auto_ptr_type PT = eapt_scalar > -class epics_auto_ptr { -public: - typedef T element_type; - explicit epics_auto_ptr ( T * p = 0 ) throw (); - epics_auto_ptr ( epics_auto_ptr & rhs ) throw (); - ~epics_auto_ptr() throw (); - epics_auto_ptr & operator = ( epics_auto_ptr & rhs ) throw (); - T & operator * () const throw (); - T * operator -> () const throw (); - T & operator [] ( unsigned index ) const throw (); - T * get () const throw (); - T * release () throw (); - void reset ( T * p = 0 ) throw (); -private: - T * p; - void destroyTarget () throw (); -}; - -template < class T, epics_auto_ptr_type PT > -inline epics_auto_ptr::epics_auto_ptr ( T *pIn ) throw () : -p ( pIn ) {} - -template < class T, epics_auto_ptr_type PT > -inline epics_auto_ptr:: - epics_auto_ptr ( epics_auto_ptr & ap ) throw () : - p ( ap.release() ) {} - -template < class T, epics_auto_ptr_type PT > -inline void epics_auto_ptr::destroyTarget () throw () -{ - if ( PT == eapt_scalar ) { - delete this->p; - } - else { - delete [] this->p; - } -} - -template < class T, epics_auto_ptr_type PT > -inline epics_auto_ptr::~epics_auto_ptr () throw () -{ - this->destroyTarget (); -} - -template < class T, epics_auto_ptr_type PT > -inline epics_auto_ptr & epics_auto_ptr::operator = - ( epics_auto_ptr & rhs ) throw () -{ - if ( &rhs != this) { - this->destroyTarget (); - this->p = rhs.release (); - } - return *this; -} - -template < class T, epics_auto_ptr_type PT > -inline T & epics_auto_ptr::operator * () const throw() -{ - return * this->p; -} - -template < class T, epics_auto_ptr_type PT > -inline T * epics_auto_ptr::operator -> () const throw () -{ - return this->p; -} - -template < class T, epics_auto_ptr_type PT > -T & epics_auto_ptr::operator [] ( unsigned index ) const throw () -{ - return this->p [ index ]; -} - -template < class T, epics_auto_ptr_type PT > -inline T * epics_auto_ptr::get () const throw () -{ - return this->p; -} - -template < class T, epics_auto_ptr_type PT > -inline T * epics_auto_ptr::release () throw () -{ - T *pTmp = this->p; - this->p = 0; - return pTmp; -} - -template < class T, epics_auto_ptr_type PT > -inline void epics_auto_ptr::reset ( T * pIn ) throw () -{ - this->destroyTarget (); - this->p = pIn; -} - -#endif // ifndef epicsMemoryH From 64c1a28f69a2f6d2f7d021c68b91f69fb6a2ccdc Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 04/11] remove unused locationException.h includes --- src/libCom/cxxTemplates/tsBTree.h | 1 - src/libCom/osi/epicsMessageQueue.h | 2 -- src/libCom/osi/os/default/osdMessageQueue.cpp | 3 +++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libCom/cxxTemplates/tsBTree.h b/src/libCom/cxxTemplates/tsBTree.h index 29b7b9c9d..7a7583a57 100644 --- a/src/libCom/cxxTemplates/tsBTree.h +++ b/src/libCom/cxxTemplates/tsBTree.h @@ -11,7 +11,6 @@ #ifndef assert // allow use of epicsAssert.h #include #endif -#include "locationException.h" // // tsBTreeRMRet diff --git a/src/libCom/osi/epicsMessageQueue.h b/src/libCom/osi/epicsMessageQueue.h index 0c18dd545..3137b3cf8 100644 --- a/src/libCom/osi/epicsMessageQueue.h +++ b/src/libCom/osi/epicsMessageQueue.h @@ -28,8 +28,6 @@ typedef struct epicsMessageQueueOSD *epicsMessageQueueId; #ifdef __cplusplus -#include "locationException.h" - class epicsShareClass epicsMessageQueue { public: epicsMessageQueue ( unsigned int capacity, diff --git a/src/libCom/osi/os/default/osdMessageQueue.cpp b/src/libCom/osi/os/default/osdMessageQueue.cpp index 9f589aaf4..ed599d62d 100644 --- a/src/libCom/osi/os/default/osdMessageQueue.cpp +++ b/src/libCom/osi/os/default/osdMessageQueue.cpp @@ -18,6 +18,9 @@ #include #include +#include +#include + #define epicsExportSharedSymbols #include "epicsMessageQueue.h" #include From 2af37d076d76055f655459f498d79ccb80746533 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 05/11] drop unused epicsOnce --- src/libCom/cxxTemplates/Makefile | 2 - src/libCom/cxxTemplates/epicsOnce.cpp | 113 -------------------------- src/libCom/cxxTemplates/epicsOnce.h | 46 ----------- 3 files changed, 161 deletions(-) delete mode 100644 src/libCom/cxxTemplates/epicsOnce.cpp delete mode 100644 src/libCom/cxxTemplates/epicsOnce.h diff --git a/src/libCom/cxxTemplates/Makefile b/src/libCom/cxxTemplates/Makefile index b15464aef..104296358 100644 --- a/src/libCom/cxxTemplates/Makefile +++ b/src/libCom/cxxTemplates/Makefile @@ -16,8 +16,6 @@ INC += tsBTree.h INC += tsFreeList.h INC += epicsSingleton.h INC += epicsGuard.h -INC += epicsOnce.h Com_SRCS += resourceLib.cpp -Com_SRCS += epicsOnce.cpp Com_SRCS += epicsSingletonMutex.cpp diff --git a/src/libCom/cxxTemplates/epicsOnce.cpp b/src/libCom/cxxTemplates/epicsOnce.cpp deleted file mode 100644 index e911314f0..000000000 --- a/src/libCom/cxxTemplates/epicsOnce.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -/* - * $Revision-Id$ - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, 1986, The Regents of the University of California. - * - * - * Author Jeff Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#define epicsExportSharedSymbols -#include "epicsMutex.h" -#include "epicsSingleton.h" -#include "epicsGuard.h" -#include "epicsOnce.h" -#include "tsFreeList.h" - -class epicsOnceImpl : public epicsOnce { -public: - epicsOnceImpl ( epicsOnceNotify & notifyIn ); - void * operator new ( size_t size ); - void operator delete ( void * pCadaver, size_t size ); -private: - epicsSingleton < epicsMutex > :: reference mutexRef; - epicsOnceNotify & notify; - bool onceFlag; - void destroy (); - void once (); - epicsOnceImpl ( epicsOnceImpl & ); // disabled - epicsOnceImpl & operator = ( epicsOnceImpl & ); // disabled - static epicsSingleton < epicsMutex > mutex; - static epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > freeList; -}; - -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class epicsSingleton < epicsMutex >; -template class tsFreeList < class epicsOnceImpl, 16 >; -template class epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif - -epicsSingleton < epicsMutex > epicsOnceImpl::mutex; -epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > epicsOnceImpl::freeList; - -inline void * epicsOnceImpl::operator new ( size_t size ) -{ - epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > :: reference ref = - epicsOnceImpl::freeList.getReference (); - return ref->allocate ( size ); -} - -inline void epicsOnceImpl::operator delete ( void *pCadaver, size_t size ) -{ - epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > :: reference ref = - epicsOnceImpl::freeList.getReference (); - ref->release ( pCadaver, size ); -} - -inline epicsOnceImpl::epicsOnceImpl ( epicsOnceNotify & notifyIn ) : -mutexRef ( epicsOnceImpl::mutex.getReference() ), notify ( notifyIn ), onceFlag ( false ) -{ -} - -void epicsOnceImpl::once () -{ - epicsGuard < epicsMutex > guard ( *this->mutexRef ); - if ( ! this->onceFlag ) { - this->notify.initialize (); - this->onceFlag = true; - } -} - -void epicsOnceImpl::destroy () -{ - delete this; -} - -epicsOnce & epicsOnce::create ( epicsOnceNotify & notifyIn ) -{ - // free list throws exception in no memory situation - return * new epicsOnceImpl ( notifyIn ); -} - -epicsOnce::~epicsOnce () -{ -} - -epicsOnceNotify::~epicsOnceNotify () -{ -} - diff --git a/src/libCom/cxxTemplates/epicsOnce.h b/src/libCom/cxxTemplates/epicsOnce.h deleted file mode 100644 index 28708dc77..000000000 --- a/src/libCom/cxxTemplates/epicsOnce.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ -/* - * $Revision-Id$ - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, 1986, The Regents of the University of California. - * - * - * Author Jeff Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#ifndef epicsOnceh -#define epicsOnceh - -#include "shareLib.h" - -class epicsOnceNotify { -public: - epicsShareFunc virtual ~epicsOnceNotify (); - virtual void initialize () = 0; -}; - -class epicsOnce { -public: - epicsShareFunc static epicsOnce & create ( epicsOnceNotify & notifyIn ); - virtual ~epicsOnce (); // use destroy - virtual void once () = 0; // run notifyIn.initialize() once only - virtual void destroy () = 0; // destroy this object -}; - -#endif // epicsOnceh - From d92af8c44d3589984e700abce886eb8cc468330d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 06/11] remove unused autoPtrDestroy.h --- src/ca/client/autoPtrDestroy.h | 94 ---------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 src/ca/client/autoPtrDestroy.h diff --git a/src/ca/client/autoPtrDestroy.h b/src/ca/client/autoPtrDestroy.h deleted file mode 100644 index ef7360736..000000000 --- a/src/ca/client/autoPtrDestroy.h +++ /dev/null @@ -1,94 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -/* - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, The Regents of the University of California. - * - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#ifndef autoPtrDestroyh -#define autoPtrDestroyh - -template < class T > -class autoPtrDestroy { -public: - autoPtrDestroy ( T * ); - ~autoPtrDestroy (); - T & operator * () const; - T * operator -> () const; - autoPtrDestroy & operator = ( T * ); - T * get () const; - T * release (); -private: - T * p; - // not implemented - autoPtrDestroy & operator = ( const autoPtrDestroy & ); - autoPtrDestroy ( const autoPtrDestroy & ); -}; - -template < class T > -inline autoPtrDestroy::autoPtrDestroy ( T *pIn ) : - p ( pIn ) {} - -template < class T > -inline autoPtrDestroy::~autoPtrDestroy () -{ - if ( this->p ) { - this->p->destroy (); - } -} - -template < class T > -inline T & autoPtrDestroy::operator * () const -{ - return * this->p; -} - -template < class T > -inline T * autoPtrDestroy::operator -> () const -{ - return this->p; -} - -template < class T > -inline autoPtrDestroy & autoPtrDestroy::operator = ( T * pIn ) -{ - if ( this->p ) { - this->p->destroy (); - } - this->p = pIn; - return *this; -} - -template < class T > -inline T * autoPtrDestroy::get () const -{ - return this->p; -} - -template < class T > -inline T * autoPtrDestroy::release () -{ - T *pTmp = this->p; - this->p = 0; - return pTmp; -} - -#endif // #ifdef autoPtrDestroyh From afd48be98cdd3a61a549c078fed664091e8e8a57 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 07/11] drop unused tsBTree.h --- src/libCom/cxxTemplates/Makefile | 1 - src/libCom/cxxTemplates/tsBTree.h | 278 ------------------------------ 2 files changed, 279 deletions(-) delete mode 100644 src/libCom/cxxTemplates/tsBTree.h diff --git a/src/libCom/cxxTemplates/Makefile b/src/libCom/cxxTemplates/Makefile index 104296358..c67668f55 100644 --- a/src/libCom/cxxTemplates/Makefile +++ b/src/libCom/cxxTemplates/Makefile @@ -12,7 +12,6 @@ INC += resourceLib.h INC += tsDLList.h INC += tsSLList.h INC += tsMinMax.h -INC += tsBTree.h INC += tsFreeList.h INC += epicsSingleton.h INC += epicsGuard.h diff --git a/src/libCom/cxxTemplates/tsBTree.h b/src/libCom/cxxTemplates/tsBTree.h deleted file mode 100644 index 7a7583a57..000000000 --- a/src/libCom/cxxTemplates/tsBTree.h +++ /dev/null @@ -1,278 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -#ifndef assert // allow use of epicsAssert.h -#include -#endif - -// -// tsBTreeRMRet -// -enum tsbtRR {tsbtrrNotFound, tsbtrrFound}; -template -class tsBTreeRMRet { -public: - tsBTreeRMRet (tsbtRR foundItIn, T *pNewSegIn) : - foundIt(foundItIn), pNewSeg(pNewSegIn) {} - - operator tsbtRR () - { - return this->foundIt; - } - - const tsbtRR foundIt; - T * const pNewSeg; -}; - -template class tsBTree; - -// -// tsBTreeNode -// -template -class tsBTreeNode -{ -friend class tsBTree; -public: - // - // exceptions - // - class invalid_btCmp {}; - - - // - // when someone copies into a class deriving from this - // do _not_ change the node pointers - // - void operator = (tsBTreeNode &) {} - - enum btCmp {btGreater, btLessOrEqual}; - - // - // class T must supply this member function which - // comapres *this with item - // - // returns: - // btGreater *this is greater than item - // btLessOrEqual *this is less than or equal to item - // - // btCmp tsBTreeCompare(const T &item) const; - // - -private: - T *pLeft; - T *pRight; - - // - // run callback for evey item in the B-Treee in sort order - // - static void traverse (T &item, void (T::*pCallBack)()) - { - tsBTreeNode &node = item; - if (node.pLeft) { - tsBTreeNode::traverse (*node.pLeft, pCallBack); - } - (item.*pCallBack)(); - if (node.pRight) { - tsBTreeNode::traverse (*node.pRight, pCallBack); - } - } - - // - // NOTE: - // no change to item.pLeft and item.pRight here - // so that an segment of a tree can be inserted - // - static void insert(T &self, T &item) - { - tsBTreeNode &node = self; - btCmp result = item.tsBTreeCompare(self); - if (result==btLessOrEqual) { - if (node.pLeft) { - tsBTreeNode::insert (*node.pLeft, item); - } - else { - node.pLeft = &item; - } - } - else if(result==btGreater) { - if (node.pRight) { - tsBTreeNode::insert (*node.pRight, item); - } - else { - node.pRight = &item; - } - } - else { - throwWithLocation ( invalid_btCmp () ); - } - } - - // - // remove() - // returns pointer to modified tree and found/not found - // (NULL if this portion of the tree is empty) - // - static tsBTreeRMRet remove(T &self, T &item) - { - tsBTreeNode &node = self; - if (&self == &item) { - if (node.pLeft) { - if (node.pRight) { - tsBTreeNode *pLeftNode = node.pLeft; - T *pR = pLeftNode->pRight; - if (pR) { - tsBTreeNode::insert (*pR, *node.pRight); - } - else { - pLeftNode->pRight = node.pRight; - } - } - return tsBTreeRMRet(tsbtrrFound, node.pLeft); // found it - } - else { - return tsBTreeRMRet(tsbtrrFound, node.pRight); // found it - } - } - - btCmp result = item.tsBTreeCompare(self); - if (result==btLessOrEqual) { - if (node.pLeft) { - tsBTreeRMRet ret = tsBTreeNode::remove(*node.pLeft, item); - if (ret.foundIt==tsbtrrFound) { - node.pLeft= ret.pNewSeg; - return tsBTreeRMRet (tsbtrrFound, &self); // TRUE - found it - } - } - return tsBTreeRMRet(tsbtrrNotFound, 0u); // not found - } - else if(result==btGreater) { - if (node.pRight) { - tsBTreeRMRet ret = tsBTreeNode::remove(*node.pRight, item); - if (ret.foundIt==tsbtrrFound) { - node.pRight = ret.pNewSeg; - return tsBTreeRMRet(tsbtrrFound,&self); // TRUE - found it - } - } - return tsBTreeRMRet(tsbtrrNotFound, 0u); // not found - } - else { - return tsBTreeRMRet(tsbtrrNotFound, 0u); // not found - } - } - // - // verify - // - static unsigned verify(const T &self, const T &item) - { - const tsBTreeNode &node = self; - - if (&self == &item) { - return 1u; // TRUE -item is present - } - btCmp result = item.tsBTreeCompare(self); - if (result==btLessOrEqual) { - if (node.pLeft) { - return tsBTreeNode::verify (*node.pLeft, item); - } - else { - return 0u; // FALSE - not found - } - } - else if(result==btGreater) { - if (node.pRight) { - return tsBTreeNode::verify (*node.pRight, item); - } - else { - return 0u; // FALSE - not found - } - } - else { - return 0u; // FALSE - not found - } - } -}; - -// -// tsBTree -// -template -class tsBTree -{ -public: - tsBTree() : pRoot(0u) {} - -// ~tsBTree() -// { -// this->traverse(T::~T); -// } - - void insert(T &item) - { - tsBTreeNode &node = item; - node.pLeft = 0; - node.pRight = 0; - if (this->pRoot) { - tsBTreeNode::insert(*this->pRoot, item); - } - else { - this->pRoot = &item; - } - } - // - // remove item from the tree - // - // returns true if item was in the tree - // (otherwise FALSE) - // - unsigned remove(T &item) - { - if (this->pRoot) { - tsBTreeRMRet ret = - tsBTreeNode::remove(*this->pRoot, item); - if (ret.foundIt) { - this->pRoot = ret.pNewSeg; - return 1u; // TRUE - found it - } - } - return 0u; // FALSE - not found - } - // - // verify that item is in the tree - // - // returns true if item is in the tree - // (otherwise FALSE) - // - unsigned verify(T &item) const - { - if (this->pRoot) { - return tsBTreeNode::verify(*this->pRoot, item); - } - else { - return 0u; // FALSE - not found - } - } - // - // Call (pT->*pCB) () for each item in the table - // - // where pT is a pointer to type T and pCB is - // a pointer to a memmber function of T with - // no parameters and returning void - // - void traverse(void (T::*pCB)()) - { - if (this->pRoot) { - tsBTreeNode::traverse(*this->pRoot, pCB); - } - } -private: - T *pRoot; -}; - From 17edfd0652262b122873c15c767204528e623da3 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 08/11] use epicsMin/Max instead of tsMin/Max Don't remove tsMinMax.h yet as it appeared in caServerApp template. --- src/ca/client/searchTimer.cpp | 1 - src/ca/client/udpiiu.h | 1 - src/ca/client/virtualCircuit.h | 1 - .../legacy/pcas/example/directoryService/directoryServer.cc | 4 ++-- src/template/base/top/caServerApp/exScalarPV.cc | 4 ++-- src/template/base/top/caServerApp/exServer.h | 2 +- src/template/base/top/caServerApp/exVectorPV.cc | 4 ++-- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ca/client/searchTimer.cpp b/src/ca/client/searchTimer.cpp index e5a8d1c54..e55e49eab 100644 --- a/src/ca/client/searchTimer.cpp +++ b/src/ca/client/searchTimer.cpp @@ -24,7 +24,6 @@ #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" -#include "tsMinMax.h" #include "envDefs.h" #define epicsExportSharedSymbols diff --git a/src/ca/client/udpiiu.h b/src/ca/client/udpiiu.h index b5ea2f20a..6b41e38ed 100644 --- a/src/ca/client/udpiiu.h +++ b/src/ca/client/udpiiu.h @@ -35,7 +35,6 @@ #include "osiSock.h" #include "epicsThread.h" #include "epicsTime.h" -#include "tsMinMax.h" #include "tsDLList.h" #ifdef udpiiuh_accessh_epicsExportSharedSymbols diff --git a/src/ca/client/virtualCircuit.h b/src/ca/client/virtualCircuit.h index 4309aac1e..d06d87c60 100644 --- a/src/ca/client/virtualCircuit.h +++ b/src/ca/client/virtualCircuit.h @@ -26,7 +26,6 @@ #define virtualCircuith #include "tsDLList.h" -#include "tsMinMax.h" #include "comBuf.h" #include "caServerID.h" diff --git a/src/ca/legacy/pcas/example/directoryService/directoryServer.cc b/src/ca/legacy/pcas/example/directoryService/directoryServer.cc index 45f04b4d6..4d43b0943 100644 --- a/src/ca/legacy/pcas/example/directoryService/directoryServer.cc +++ b/src/ca/legacy/pcas/example/directoryService/directoryServer.cc @@ -13,7 +13,7 @@ // #include "directoryServer.h" -#include "tsMinMax.h" +#include "epicsAlgorithm.h" const pvInfo *pvInfo::pFirst; @@ -128,7 +128,7 @@ pvExistReturn directoryServer::pvExistTest } else { size_t diff = pLastStr-pPVName; - diff = tsMin (diff, sizeof(pvNameBuf)-1); + diff = epicsMin (diff, sizeof(pvNameBuf)-1); memcpy (pvNameBuf, pPVName, diff); pvNameBuf[diff] = '\0'; pLastStr = pvNameBuf; diff --git a/src/template/base/top/caServerApp/exScalarPV.cc b/src/template/base/top/caServerApp/exScalarPV.cc index 0e91d81e9..1b326fa51 100644 --- a/src/template/base/top/caServerApp/exScalarPV.cc +++ b/src/template/base/top/caServerApp/exScalarPV.cc @@ -71,9 +71,9 @@ void exScalarPV::scan() } newValue += (float) ( sin (radians) / 10.0 ); limit = (float) this->info.getHopr (); - newValue = tsMin ( newValue, limit ); + newValue = epicsMin ( newValue, limit ); limit = (float) this->info.getLopr (); - newValue = tsMax ( newValue, limit ); + newValue = epicsMax ( newValue, limit ); *pDD = newValue; aitTimeStamp gddts ( this->currentTime ); pDD->setTimeStamp ( & gddts ); diff --git a/src/template/base/top/caServerApp/exServer.h b/src/template/base/top/caServerApp/exServer.h index 59ba11309..e0615c804 100644 --- a/src/template/base/top/caServerApp/exServer.h +++ b/src/template/base/top/caServerApp/exServer.h @@ -45,7 +45,7 @@ #include "casdef.h" #include "epicsAssert.h" #include "resourceLib.h" -#include "tsMinMax.h" +#include "epicsAlgorithm.h" #ifndef NELEMENTS # define NELEMENTS(A) (sizeof(A)/sizeof(A[0])) diff --git a/src/template/base/top/caServerApp/exVectorPV.cc b/src/template/base/top/caServerApp/exVectorPV.cc index 963b59082..22e642fab 100644 --- a/src/template/base/top/caServerApp/exVectorPV.cc +++ b/src/template/base/top/caServerApp/exVectorPV.cc @@ -135,9 +135,9 @@ void exVectorPV::scan() } newValue += (float) (sin (radians) / 10.0); limit = (float) this->info.getHopr(); - newValue = tsMin (newValue, limit); + newValue = epicsMin (newValue, limit); limit = (float) this->info.getLopr(); - newValue = tsMax (newValue, limit); + newValue = epicsMax (newValue, limit); *(pF++) = newValue; } From a38dccfb1ad6969d2a8a215a71929582c0721899 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Apr 2016 09:20:13 -0400 Subject: [PATCH 09/11] add guard/release typedefs for epicsMutex --- src/libCom/osi/epicsMutex.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libCom/osi/epicsMutex.h b/src/libCom/osi/epicsMutex.h index b24e5ecb8..6d74f9599 100644 --- a/src/libCom/osi/epicsMutex.h +++ b/src/libCom/osi/epicsMutex.h @@ -22,11 +22,14 @@ typedef enum { #ifdef __cplusplus #include "compilerDependencies.h" +#include "epicsGuard.h" #define newEpicsMutex new epicsMutex(__FILE__,__LINE__) class epicsShareClass epicsMutex { public: + typedef epicsGuard guard_t; + typedef epicsGuard release_t; class mutexCreateFailed; /* exception payload */ class invalidMutex; /* exception payload */ epicsMutex (); @@ -44,6 +47,8 @@ private: class epicsShareClass epicsDeadlockDetectMutex { public: + typedef epicsGuard guard_t; + typedef epicsGuard release_t; typedef unsigned hierarchyLevel_t; epicsDeadlockDetectMutex ( unsigned hierarchyLevel_t ); ~epicsDeadlockDetectMutex (); From a1bd644502f61975a49624a8720acc1eaa324970 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 2 May 2016 20:51:11 -0400 Subject: [PATCH 10/11] drop all templateInstances.cpp No longer needed by any targets. --- src/ca/client/Makefile | 1 - src/ca/client/templateInstances.cpp | 88 ------------------- src/ca/legacy/pcas/build/Makefile | 2 - .../legacy/pcas/generic/templateInstances.cpp | 29 ------ src/ioc/db/Makefile | 1 - src/ioc/db/templateInstances.cpp | 46 ---------- 6 files changed, 167 deletions(-) delete mode 100644 src/ca/client/templateInstances.cpp delete mode 100644 src/ca/legacy/pcas/generic/templateInstances.cpp delete mode 100644 src/ioc/db/templateInstances.cpp diff --git a/src/ca/client/Makefile b/src/ca/client/Makefile index fcbc574cf..b6881f473 100644 --- a/src/ca/client/Makefile +++ b/src/ca/client/Makefile @@ -69,7 +69,6 @@ LIBSRCS += comQueSend.cpp LIBSRCS += comBuf.cpp LIBSRCS += hostNameCache.cpp LIBSRCS += msgForMultiplyDefinedPV.cpp -LIBSRCS_vxWorks += templateInstances.cpp LIBRARY=ca diff --git a/src/ca/client/templateInstances.cpp b/src/ca/client/templateInstances.cpp deleted file mode 100644 index f83366087..000000000 --- a/src/ca/client/templateInstances.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -/* - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, 1986, The Regents of the University of California. - * - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#define epicsExportSharedSymbols -#include "virtualCircuit.h" -#include "bhe.h" -#include "cac.h" -#include "syncGroup.h" -#include "nciu.h" -#include "udpiiu.h" -#include "oldAccess.h" -#include "msgForMultiplyDefinedPV.h" -#include "repeaterClient.h" -#include "hostNameCache.h" -#include "comBuf.h" - -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class resTable < nciu, chronIntId >; -template class chronIntIdResTable < nciu >; -template class resTable < baseNMIU, chronIntId >; -template class chronIntIdResTable < baseNMIU >; -template class resTable < CASG, chronIntId >; -template class chronIntIdResTable < CASG >; -template class resTable < bhe, inetAddrID >; -template class resTable < tcpiiu, caServerID >; -template class tsFreeList < bhe, 0x100 >; -template class tsFreeList < tcpiiu, 32, epicsMutexNOOP >; -template class tsFreeList < netReadNotifyIO, 1024, epicsMutexNOOP >; -template class tsFreeList < netWriteNotifyIO, 1024, epicsMutexNOOP >; -template class tsFreeList < netSubscription, 1024, epicsMutexNOOP >; -template class tsFreeList < CASG, 128, epicsMutexNOOP >; -template class tsFreeList < syncGroupReadNotify, 128, epicsMutexNOOP >; -template class tsFreeList < syncGroupWriteNotify, 128, epicsMutexNOOP >; -template class tsFreeList < comBuf, 0x20 >; -template class tsFreeList < getCallback, 1024, epicsMutexNOOP >; -template class tsFreeList < getCopy, 1024, epicsMutexNOOP >; -template class tsFreeList < msgForMultiplyDefinedPV, 16 >; -template class tsFreeList < nciu, 1024, epicsMutexNOOP>; -template class tsFreeList < oldChannelNotify, 1024, epicsMutexNOOP >; -template class tsFreeList < oldSubscription, 1024, epicsMutexNOOP >; -template class tsFreeList < putCallback, 1024, epicsMutexNOOP >; -template class tsFreeList < repeaterClient, 0x20 >; -template class epicsSingleton < localHostName >; -template unsigned comBuf :: push ( const double * pValue, unsigned nElem ); -template unsigned comBuf :: push ( const float * pValue, unsigned nElem ); -template unsigned comBuf :: push ( const int * pValue, unsigned nElem ); -template unsigned comBuf :: push ( const short * pValue, unsigned nElem ); -template comBuf :: popStatus comBuf :: pop ( unsigned int & returnVal ); -template comBuf :: popStatus comBuf :: pop ( unsigned short & returnVal ); -template comBuf :: popStatus comBuf :: pop ( unsigned char & returnVal ); -template void WireSet ( float const &, unsigned char * ); -template void WireSet ( int const &, unsigned char * ); -template void WireSet ( short const &, unsigned char * ); -template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO - (epicsGuard < epicsMutex > &, syncGroupWriteNotify & ); -template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO - ( epicsGuard < epicsMutex > &, syncGroupReadNotify & ); - - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif diff --git a/src/ca/legacy/pcas/build/Makefile b/src/ca/legacy/pcas/build/Makefile index 0cb91fbea..707344d02 100644 --- a/src/ca/legacy/pcas/build/Makefile +++ b/src/ca/legacy/pcas/build/Makefile @@ -80,8 +80,6 @@ ifeq ($(VX_GNU_VERSION), 4.1.2) casStreamOS_CXXFLAGS_vxWorks-ppc604 = -O0 endif -LIBSRCS_vxWorks += templateInstances.cpp - LIBRARY = cas cas_LIBS = ca gdd Com cas_SYS_LIBS_WIN32 = ws2_32 diff --git a/src/ca/legacy/pcas/generic/templateInstances.cpp b/src/ca/legacy/pcas/generic/templateInstances.cpp deleted file mode 100644 index e1df222dc..000000000 --- a/src/ca/legacy/pcas/generic/templateInstances.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE is distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -#define epicsExportSharedSymbols -#include "ipIgnoreEntry.h" -#include "casChannelI.h" - -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class resTable < ipIgnoreEntry, ipIgnoreEntry >; -template class resTable < casChannelI, chronIntId >; -template class resTable < casEventMaskEntry, stringId >; -template class chronIntIdResTable < casChannelI >; -template class tsFreeList < casMonEvent, 1024, epicsMutexNOOP >; -template class tsFreeList < casMonitor, 1024, epicsMutex >; - - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif diff --git a/src/ioc/db/Makefile b/src/ioc/db/Makefile index 83cd2ce4a..15680bf60 100644 --- a/src/ioc/db/Makefile +++ b/src/ioc/db/Makefile @@ -85,7 +85,6 @@ dbCore_SRCS += dbChannelIO.cpp dbCore_SRCS += dbSubscriptionIO.cpp dbCore_SRCS += dbPutNotifyBlocker.cpp dbCore_SRCS += dbContextReadNotifyCache.cpp -dbCore_SRCS += templateInstances.cpp dbCore_SRCS += dbIocRegister.c dbCore_SRCS += chfPlugin.c dbCore_SRCS += dbState.c diff --git a/src/ioc/db/templateInstances.cpp b/src/ioc/db/templateInstances.cpp deleted file mode 100644 index 0b4adba57..000000000 --- a/src/ioc/db/templateInstances.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************\ -* Copyright (c) 2002 The University of Chicago, as Operator of Argonne -* National Laboratory. -* Copyright (c) 2002 The Regents of the University of California, as -* Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. -\*************************************************************************/ - -/* - * $Revision-Id$ - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, 1986, The Regents of the University of California. - * - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#define epicsExportSharedSymbols - -#include "dbCAC.h" -#include "dbChannelIO.h" -#include "dbPutNotifyBlocker.h" - -#ifdef _MSC_VER -# pragma warning ( push ) -# pragma warning ( disable:4660 ) -#endif - -template class tsFreeList < dbChannelIO, 256, epicsMutexNOOP >; -template class tsFreeList < dbPutNotifyBlocker, 64, epicsMutexNOOP >; -template class tsFreeList < dbSubscriptionIO, 256, epicsMutexNOOP >; -template class resTable < dbBaseIO, chronIntId >; -template class chronIntIdResTable < dbBaseIO >; - -#ifdef _MSC_VER -# pragma warning ( pop ) -#endif From d67486621999c3a24a0a0c9c09dc298f85371762 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 2 May 2016 20:53:51 -0400 Subject: [PATCH 11/11] epicsGuard.h add typedefs linking guard and release --- src/libCom/cxxTemplates/epicsGuard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libCom/cxxTemplates/epicsGuard.h b/src/libCom/cxxTemplates/epicsGuard.h index a51411bc6..acb80b084 100644 --- a/src/libCom/cxxTemplates/epicsGuard.h +++ b/src/libCom/cxxTemplates/epicsGuard.h @@ -30,6 +30,7 @@ template < class T > class epicsGuardRelease; template < class T > class epicsGuard { public: + typedef epicsGuardRelease release_t; epicsGuard ( T & ); void assertIdenticalMutex ( const T & ) const; ~epicsGuard (); @@ -46,6 +47,7 @@ private: template < class T > class epicsGuardRelease { public: + typedef epicsGuard guard_t; epicsGuardRelease ( epicsGuard < T > & ); ~epicsGuardRelease (); private: