Changed repeaterTimerNotify interface implementation into a nested class of udpiiu so that we dont use multiple inheritance, and therefore hopefully avoid code generation problems with certain versions of g++ on MacOSX (I cant reproduce this problem on any ofthe machines here)

This commit is contained in:
Jeff Hill
2011-07-26 16:23:34 -06:00
parent f9f8d1150c
commit 1b9ca756cc
2 changed files with 26 additions and 19 deletions

View File

@@ -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 );

View File

@@ -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 & );