replace server list with server pointer

This commit is contained in:
Jeff Hill
2003-01-17 01:20:31 +00:00
parent 2311b4c9d5
commit 36292e8c37
2 changed files with 16 additions and 18 deletions

View File

@@ -47,7 +47,7 @@
bhe::bhe ( const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (()) :
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
lastBeaconNumber ( initialBeaconNumber )
pIIU ( 0 ), lastBeaconNumber ( initialBeaconNumber )
{
# ifdef DEBUG
{
@@ -64,10 +64,8 @@ bhe::~bhe ()
void bhe::beaconAnomalyNotify ()
{
tsDLIter < tcpiiu > iter = this->iiuList.firstIter ();
while ( iter.valid() ) {
iter->beaconAnomalyNotify ();
iter++;
if ( this->pIIU ) {
this->pIIU->beaconAnomalyNotify ();
}
}
@@ -198,14 +196,10 @@ bool bhe::updatePeriod ( const epicsTime & programBeginTime,
this->beaconAnomalyNotify ();
netChange = true;
}
else {
else if ( this->pIIU ) {
// update state of health for active virtual circuits
// if the beacon looks ok
tsDLIter < tcpiiu > iter = this->iiuList.firstIter ();
while ( iter.valid() ) {
iter->beaconArrivalNotify ();
iter++;
}
this->pIIU->beaconArrivalNotify ();
}
// update a running average period
@@ -234,16 +228,20 @@ epicsTime bhe::updateTime () const
return this->timeStamp;
}
void bhe::registerIIU ( tcpiiu & iiu )
void bhe::registerIIU ( tcpiiu & iiu, const epicsTime & currentTime )
{
this->iiuList.add ( iiu );
this->pIIU = & iiu;
this->timeStamp = currentTime;
this->averagePeriod = - DBL_MAX;
}
void bhe::unregisterIIU ( tcpiiu & iiu )
{
this->iiuList.remove ( iiu );
this->timeStamp = epicsTime();
this->averagePeriod = - DBL_MAX;
if ( this->pIIU == & iiu ) {
this->pIIU = 0;
this->timeStamp = epicsTime();
this->averagePeriod = - DBL_MAX;
}
}
void * bhe::operator new ( size_t ) // X aCC 361

View File

@@ -65,16 +65,16 @@ public:
epicsShareFunc double period () const epicsThrows (());
epicsShareFunc epicsTime updateTime () const;
epicsShareFunc void show ( unsigned level) const;
epicsShareFunc void registerIIU ( tcpiiu & );
epicsShareFunc void registerIIU ( tcpiiu &, const epicsTime & );
epicsShareFunc void unregisterIIU ( tcpiiu & );
epicsShareFunc void * operator new ( size_t size, bheMemoryManager & );
#ifdef CXX_PLACEMENT_DELETE
epicsShareFunc void operator delete ( void *, bheMemoryManager & ) epicsThrows (());
#endif
private:
tsDLList < tcpiiu > iiuList;
epicsTime timeStamp;
double averagePeriod;
tcpiiu * pIIU;
ca_uint32_t lastBeaconNumber;
void beaconAnomalyNotify ();
bhe ( const bhe & );