adapt to new timer API
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#undef epicsExportSharedSymbols
|
||||
|
||||
repeaterSubscribeTimer::repeaterSubscribeTimer ( udpiiu &iiuIn, epicsTimerQueue &queueIn ) :
|
||||
timer ( queueIn.createTimer () ), iiu ( iiuIn ),
|
||||
queue ( queueIn ), timer ( queueIn.createTimer () ), iiu ( iiuIn ),
|
||||
attempts ( 0 ), registered ( false ), once ( false )
|
||||
{
|
||||
this->timer.start ( *this, 10.0 );
|
||||
@@ -30,7 +30,7 @@ repeaterSubscribeTimer::repeaterSubscribeTimer ( udpiiu &iiuIn, epicsTimerQueue
|
||||
|
||||
repeaterSubscribeTimer::~repeaterSubscribeTimer ()
|
||||
{
|
||||
delete & this->timer;
|
||||
this->queue.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
epicsTimerNotify::expireStatus repeaterSubscribeTimer::expire ( const epicsTime & currentTime )
|
||||
|
||||
@@ -24,11 +24,12 @@ class udpiiu;
|
||||
|
||||
class repeaterSubscribeTimer : private epicsTimerNotify {
|
||||
public:
|
||||
repeaterSubscribeTimer ( udpiiu &iiu, epicsTimerQueue &queue );
|
||||
repeaterSubscribeTimer ( udpiiu &, epicsTimerQueue & );
|
||||
virtual ~repeaterSubscribeTimer ();
|
||||
void confirmNotify ();
|
||||
void show (unsigned level) const;
|
||||
void show ( unsigned level ) const;
|
||||
private:
|
||||
epicsTimerQueue &queue;
|
||||
epicsTimer &timer;
|
||||
udpiiu &iiu;
|
||||
unsigned attempts;
|
||||
|
||||
@@ -37,6 +37,7 @@ static const double maxSearchPeriod = 5.0; // seconds
|
||||
searchTimer::searchTimer ( udpiiu &iiuIn, epicsTimerQueue &queueIn, epicsMutex &mutexIn ) :
|
||||
period ( initialRoundTripEstimate * 2.0 ),
|
||||
roundTripDelayEstimate ( initialRoundTripEstimate ),
|
||||
queue ( queueIn ),
|
||||
timer ( queueIn.createTimer () ),
|
||||
mutex ( mutexIn ),
|
||||
iiu ( iiuIn ),
|
||||
@@ -57,7 +58,7 @@ searchTimer::searchTimer ( udpiiu &iiuIn, epicsTimerQueue &queueIn, epicsMutex &
|
||||
|
||||
searchTimer::~searchTimer ()
|
||||
{
|
||||
delete & this->timer;
|
||||
this->queue.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -25,7 +25,7 @@ class udpiiu;
|
||||
|
||||
class searchTimer : private epicsTimerNotify {
|
||||
public:
|
||||
searchTimer ( udpiiu &iiu, epicsTimerQueue &queue, epicsMutex & );
|
||||
searchTimer ( udpiiu &, epicsTimerQueue &, epicsMutex & );
|
||||
virtual ~searchTimer ();
|
||||
void notifySearchResponse ( unsigned short retrySeqNo, const epicsTime & currentTime );
|
||||
void resetPeriod ( double delayToNextTry );
|
||||
@@ -34,6 +34,7 @@ private:
|
||||
epicsTime timeAtLastRetry;
|
||||
double period; /* period between tries */
|
||||
double roundTripDelayEstimate;
|
||||
epicsTimerQueue &queue;
|
||||
epicsTimer &timer;
|
||||
epicsMutex &mutex;
|
||||
udpiiu &iiu;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//
|
||||
tcpRecvWatchdog::tcpRecvWatchdog
|
||||
( tcpiiu &iiuIn, double periodIn, epicsTimerQueue & queueIn ) :
|
||||
period ( periodIn ), timer ( queueIn.createTimer () ),
|
||||
period ( periodIn ), queue ( queueIn ), timer ( queueIn.createTimer () ),
|
||||
iiu ( iiuIn ), responsePending ( false ),
|
||||
beaconAnomaly ( true )
|
||||
{
|
||||
@@ -28,7 +28,7 @@ tcpRecvWatchdog::tcpRecvWatchdog
|
||||
|
||||
tcpRecvWatchdog::~tcpRecvWatchdog ()
|
||||
{
|
||||
delete & this->timer;
|
||||
this->queue.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
epicsTimerNotify::expireStatus tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
tcpSendWatchdog::tcpSendWatchdog
|
||||
( tcpiiu &iiuIn, double periodIn, epicsTimerQueue & queueIn ) :
|
||||
period ( periodIn ), timer ( queueIn.createTimer () ),
|
||||
period ( periodIn ), queue ( queueIn ), timer ( queueIn.createTimer () ),
|
||||
iiu ( iiuIn )
|
||||
{
|
||||
}
|
||||
|
||||
tcpSendWatchdog::~tcpSendWatchdog ()
|
||||
{
|
||||
delete & this->timer;
|
||||
this->queue.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
epicsTimerNotify::expireStatus tcpSendWatchdog::expire ( const epicsTime & currentTime )
|
||||
|
||||
@@ -67,7 +67,9 @@ exAsyncWriteIO::exAsyncWriteIO ( const casCtx &ctxIn, exAsyncPV &pvIn,
|
||||
exAsyncWriteIO::~exAsyncWriteIO()
|
||||
{
|
||||
this->pv.removeIO();
|
||||
delete & this->timer;
|
||||
if ( this->pv.getCAS() ) {
|
||||
this->pv.getCAS()->destroyTimer ( this->timer );
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -99,7 +101,9 @@ exAsyncReadIO::exAsyncReadIO ( const casCtx &ctxIn, exAsyncPV &pvIn,
|
||||
exAsyncReadIO::~exAsyncReadIO()
|
||||
{
|
||||
this->pv.removeIO ();
|
||||
delete & this->timer;
|
||||
if ( this->pv.getCAS() ) {
|
||||
this->pv.getCAS()->destroyTimer ( this->timer );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ exPV::exPV ( pvInfo &setup, bool preCreateFlag, bool scanOnIn ) :
|
||||
//
|
||||
exPV::~exPV()
|
||||
{
|
||||
delete & this->timer;
|
||||
if ( this->getCAS() ) {
|
||||
this->getCAS()->destroyTimer ( this->timer );
|
||||
}
|
||||
this->info.unlinkPV();
|
||||
}
|
||||
|
||||
|
||||
@@ -328,8 +328,8 @@ exAsyncExistIO::exAsyncExistIO ( const pvInfo &pviIn, const casCtx &ctxIn,
|
||||
//
|
||||
exAsyncExistIO::~exAsyncExistIO()
|
||||
{
|
||||
this->cas.removeIO();
|
||||
delete & this->timer;
|
||||
this->cas.removeIO ();
|
||||
this->cas.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -364,7 +364,7 @@ exAsyncCreateIO::exAsyncCreateIO ( pvInfo &pviIn, exServer &casIn,
|
||||
exAsyncCreateIO::~exAsyncCreateIO()
|
||||
{
|
||||
this->cas.removeIO ();
|
||||
delete & this->timer;
|
||||
this->cas.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -208,9 +208,14 @@ epicsShareFunc casEventMask caServer::alarmEventMask () const
|
||||
//
|
||||
// caServer::alarmEventMask ()
|
||||
//
|
||||
class epicsTimer & caServer::createTimer()
|
||||
class epicsTimer & caServer::createTimer ()
|
||||
{
|
||||
return fileDescriptorManager.createTimer();
|
||||
return fileDescriptorManager.createTimer ();
|
||||
}
|
||||
|
||||
void caServer::destroyTimer ( class epicsTimer & tmr )
|
||||
{
|
||||
fileDescriptorManager.destroyTimer ( tmr );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -186,8 +186,8 @@ private:
|
||||
caResId const clientId;
|
||||
unsigned char const dbrType;
|
||||
unsigned char nPend;
|
||||
unsigned ovf:1;
|
||||
unsigned enabled:1;
|
||||
bool ovf;
|
||||
bool enabled;
|
||||
|
||||
void enable();
|
||||
void disable();
|
||||
|
||||
@@ -51,8 +51,8 @@ casMonitor::casMonitor(caResId clientIdIn, casChannelI &chan,
|
||||
clientId(clientIdIn),
|
||||
dbrType(dbrTypeIn),
|
||||
nPend(0u),
|
||||
ovf(FALSE),
|
||||
enabled(FALSE)
|
||||
ovf(false),
|
||||
enabled(false)
|
||||
{
|
||||
//
|
||||
// If these are nill it is a programmer error
|
||||
@@ -96,7 +96,7 @@ void casMonitor::enable()
|
||||
|
||||
this->mutex.lock();
|
||||
if (!this->enabled && this->ciu.readAccess()) {
|
||||
this->enabled = TRUE;
|
||||
this->enabled = true;
|
||||
status = this->ciu.getPVI().registerEvent();
|
||||
if (status) {
|
||||
errMessage(status,
|
||||
@@ -113,7 +113,7 @@ void casMonitor::disable()
|
||||
{
|
||||
this->mutex.lock();
|
||||
if (this->enabled) {
|
||||
this->enabled = FALSE;
|
||||
this->enabled = false;
|
||||
this->ciu.getPVI().unregisterEvent();
|
||||
}
|
||||
this->mutex.unlock();
|
||||
@@ -176,7 +176,7 @@ void casMonitor::push (const smartConstGDDPointer &pNewValue)
|
||||
// no log block
|
||||
// => use the over flow block in the event structure
|
||||
//
|
||||
this->ovf = TRUE;
|
||||
this->ovf = true;
|
||||
this->overFlowEvent.assign (*this, pNewValue);
|
||||
this->nPend++;
|
||||
pLog = &this->overFlowEvent;
|
||||
@@ -222,8 +222,8 @@ caStatus casMonitor::executeEvent(casMonEvent *pEV)
|
||||
// saved in the call back object
|
||||
//
|
||||
if (pEV == &this->overFlowEvent) {
|
||||
assert (this->ovf==TRUE);
|
||||
this->ovf = FALSE;
|
||||
assert (this->ovf);
|
||||
this->ovf = false;
|
||||
pEV->clear();
|
||||
}
|
||||
else {
|
||||
@@ -241,10 +241,10 @@ caStatus casMonitor::executeEvent(casMonEvent *pEV)
|
||||
void casMonitor::show(unsigned level) const
|
||||
{
|
||||
if (level>1u) {
|
||||
printf(
|
||||
printf(
|
||||
"\tmonitor type=%u count=%lu client id=%u enabled=%u OVF=%u nPend=%u\n",
|
||||
dbrType, nElem, clientId, enabled, ovf, nPend);
|
||||
this->mask.show(level);
|
||||
this->mask.show(level);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -374,6 +374,7 @@ public:
|
||||
#endif
|
||||
|
||||
epicsShareFunc class epicsTimer & createTimer ();
|
||||
epicsShareFunc void destroyTimer ( class epicsTimer & );
|
||||
|
||||
//caStatus enableClients ();
|
||||
//caStatus disableClients ();
|
||||
|
||||
@@ -34,7 +34,7 @@ casBeaconTimer::casBeaconTimer ( double delay, caServerOS &osIn ) :
|
||||
|
||||
casBeaconTimer::~casBeaconTimer ()
|
||||
{
|
||||
delete & this->timer;
|
||||
fileDescriptorManager.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -91,7 +91,7 @@ casDGIntfOS::~casDGIntfOS()
|
||||
// casDGEvWakeup::casDGEvWakeup()
|
||||
//
|
||||
casDGEvWakeup::casDGEvWakeup () :
|
||||
timer ( fileDescriptorManager.createTimer() ), pOS ( 0 )
|
||||
timer ( fileDescriptorManager.createTimer() ), pOS ( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ casDGEvWakeup::casDGEvWakeup () :
|
||||
//
|
||||
casDGEvWakeup::~casDGEvWakeup()
|
||||
{
|
||||
delete & this->timer;
|
||||
fileDescriptorManager.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
void casDGEvWakeup::start ( casDGIntfOS &os )
|
||||
@@ -148,7 +148,7 @@ casDGIOWakeup::casDGIOWakeup () :
|
||||
//
|
||||
casDGIOWakeup::~casDGIOWakeup()
|
||||
{
|
||||
delete & this->timer;
|
||||
fileDescriptorManager.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -108,7 +108,7 @@ inline casStreamWriteReg::~casStreamWriteReg ()
|
||||
// casStreamEvWakeup()
|
||||
//
|
||||
casStreamEvWakeup::casStreamEvWakeup () :
|
||||
timer ( fileDescriptorManager.createTimer() ), pOS ( 0 )
|
||||
timer ( fileDescriptorManager.createTimer() ), pOS ( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ casStreamEvWakeup::casStreamEvWakeup () :
|
||||
//
|
||||
casStreamEvWakeup::~casStreamEvWakeup()
|
||||
{
|
||||
delete & this->timer;
|
||||
fileDescriptorManager.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -185,13 +185,13 @@ casStreamIOWakeup::casStreamIOWakeup () :
|
||||
//
|
||||
casStreamIOWakeup::~casStreamIOWakeup()
|
||||
{
|
||||
delete & this->timer;
|
||||
fileDescriptorManager.destroyTimer ( this->timer );
|
||||
}
|
||||
|
||||
//
|
||||
// casStreamIOWakeup::show()
|
||||
//
|
||||
void casStreamIOWakeup::show(unsigned level) const
|
||||
void casStreamIOWakeup::show ( unsigned level ) const
|
||||
{
|
||||
printf ( "casStreamIOWakeup at %p {\n",
|
||||
static_cast <const void *> ( this ) );
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
//
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.21 2001/02/16 03:13:27 jhill
|
||||
// fixed gnu warnings
|
||||
//
|
||||
// Revision 1.20 2000/04/28 02:23:34 jhill
|
||||
// many, many changes
|
||||
//
|
||||
@@ -281,7 +284,7 @@ xBlockingStatus casStreamIO::blockingState() const
|
||||
bufSizeT casStreamIO::incommingBytesPresent() const
|
||||
{
|
||||
int status;
|
||||
osiSockIoctl_t nchars;
|
||||
osiSockIoctl_t nchars = 0;
|
||||
|
||||
status = socket_ioctl(this->sock, FIONREAD, &nchars);
|
||||
if (status<0) {
|
||||
|
||||
Reference in New Issue
Block a user