diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index 755875aa7..625bead9f 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -81,8 +81,9 @@ udpiiu::udpiiu ( cac::lowestPriorityLevelAbove ( cac::lowestPriorityLevelAbove ( cac.getInitializingThreadsPriority () ) ) ), + m_repeaterTimerNotify ( *this ), repeaterSubscribeTmr ( - *this, timerQueue, cbMutexIn, ctxNotifyIn ), + m_repeaterTimerNotify, timerQueue, cbMutexIn, ctxNotifyIn ), govTmr ( *this, timerQueue, cacMutexIn ), maxPeriod ( maxSearchPeriodDefault ), rtteMean ( minRoundTripEstimate ), @@ -397,14 +398,14 @@ void udpRecvThread::run () } /* - * udpiiu::repeaterRegistrationMessage () + * udpiiu::M_repeaterTimerNotify::repeaterRegistrationMessage () * * register with the repeater */ -void udpiiu::repeaterRegistrationMessage ( unsigned attemptNumber ) +void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned attemptNumber ) { - epicsGuard < epicsMutex > cbGuard ( this->cacMutex ); - caRepeaterRegistrationMessage ( this->sock, this->repeaterPort, attemptNumber ); + epicsGuard < epicsMutex > cbGuard ( m_udpiiu.cacMutex ); + caRepeaterRegistrationMessage ( m_udpiiu.sock, m_udpiiu.repeaterPort, attemptNumber ); } /* @@ -1233,16 +1234,16 @@ void udpiiu::govExpireNotify ( this->ppSearchTmr[0]->installChannel ( guard, chan ); } -int udpiiu :: printFormated ( - epicsGuard < epicsMutex > & cbGuard, - const char * pformat, ... ) +int udpiiu :: M_repeaterTimerNotify :: printFormated ( + epicsGuard < epicsMutex > & cbGuard, + const char * pformat, ... ) { va_list theArgs; int status; va_start ( theArgs, pformat ); - status = this->cacRef.varArgsPrintFormated ( cbGuard, pformat, theArgs ); + status = m_udpiiu.cacRef.varArgsPrintFormated ( cbGuard, pformat, theArgs ); va_end ( theArgs ); diff --git a/src/ca/udpiiu.h b/src/ca/udpiiu.h index 3c9327547..5a0f869e1 100644 --- a/src/ca/udpiiu.h +++ b/src/ca/udpiiu.h @@ -88,8 +88,7 @@ static const double beaconAnomalySearchPeriod = 5.0; // seconds class udpiiu : private netiiu, private searchTimerNotify, - private disconnectGovernorNotify, - private repeaterTimerNotify { + private disconnectGovernorNotify { public: udpiiu ( epicsGuard < epicsMutex > & cacGuard, @@ -139,9 +138,24 @@ private: private: udpiiu & _udpiiu; }; + class M_repeaterTimerNotify : + public repeaterTimerNotify { + public: + M_repeaterTimerNotify ( udpiiu & iiu ) : + m_udpiiu ( iiu ) {} + // repeaterTimerNotify + void repeaterRegistrationMessage ( + unsigned attemptNumber ); + int printFormated ( + epicsGuard < epicsMutex > & callbackControl, + const char * pformat, ... ); + private: + udpiiu & m_udpiiu; + }; char xmitBuf [MAX_UDP_SEND]; char recvBuf [MAX_UDP_RECV]; udpRecvThread recvThread; + M_repeaterTimerNotify m_repeaterTimerNotify; repeaterSubscribeTimer repeaterSubscribeTmr; disconnectGovernorTimer govTmr; tsDLList < SearchDest > _searchDestList; @@ -278,14 +292,6 @@ private: void govExpireNotify ( epicsGuard < epicsMutex > &, nciu & ); - // repeaterTimerNotify - void repeaterRegistrationMessage ( - unsigned attemptNumber ); - - int printFormated ( - epicsGuard < epicsMutex > & callbackControl, - const char * pformat, ... ); - udpiiu ( const udpiiu & ); udpiiu & operator = ( const udpiiu & );