diff --git a/src/ca/CASG.cpp b/src/ca/CASG.cpp index 3c6242687..a2fd6dce5 100644 --- a/src/ca/CASG.cpp +++ b/src/ca/CASG.cpp @@ -47,10 +47,10 @@ CASG::~CASG () { if ( this->verify () ) { this->mutex.lock (); - tsDLIterBD notify ( this->ioList.first () ); + tsDLIterBD notify = this->ioList.firstIter (); while ( notify.valid () ) { notify->release (); - notify = this->ioList.first (); + notify = this->ioList.firstIter (); } this->mutex.unlock (); this->client.uninstallCASG ( *this ); @@ -160,9 +160,10 @@ void CASG::show ( unsigned level) const if ( level ) { this->mutex.lock (); - tsDLIterBD notify ( this->ioList.first () ); + tsDLIterConstBD notify = this->ioList.firstIter (); while ( notify.valid () ) { notify->show (level); + notify++; } this->mutex.unlock (); } diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index dd3d12daf..c289bc434 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -156,9 +156,10 @@ cac::~cac () { epicsAutoMutex autoMutex ( this->iiuListMutex ); - tsDLIterBD piiu ( this->iiuList.first () ); + tsDLIterBD piiu = this->iiuList.firstIter (); while ( piiu.valid () ) { - tsDLIterBD pnext = piiu.itemAfter (); + tsDLIterBD pnext = piiu; + pnext++; { epicsAutoMutex autoMutexTmp ( this->defaultMutex ); piiu->disconnectAllChan ( limboIIU ); @@ -168,9 +169,10 @@ cac::~cac () piiu = pnext; } - piiu = this->iiuListLimbo.first (); + piiu = this->iiuListLimbo.firstIter (); while ( piiu.valid () ) { - tsDLIterBD pnext = piiu.itemAfter (); + tsDLIterBD pnext = piiu; + pnext++; piiu->suicide (); piiu = pnext; } @@ -220,9 +222,10 @@ void cac::processRecvBacklog () { epicsAutoMutex autoMutex ( this->iiuListMutex ); - tsDLIterBD < tcpiiu > piiu ( this->iiuList.first () ); + tsDLIterBD < tcpiiu > piiu = this->iiuList.firstIter (); while ( piiu.valid () ) { - tsDLIterBD < tcpiiu > pNext = piiu.itemAfter (); + tsDLIterBD < tcpiiu > pNext = piiu; + pNext++; if ( ! piiu->alive () ) { assert ( this->pudpiiu && this->pSearchTmr ); @@ -271,7 +274,7 @@ void cac::flush () * set the push pending flag on all virtual circuits */ epicsAutoMutex autoMutex ( this->iiuListMutex ); - tsDLIterBD piiu ( this->iiuList.first () ); + tsDLIterBD piiu = this->iiuList.firstIter (); while ( piiu.valid () ) { piiu->flush (); piiu++; @@ -292,7 +295,7 @@ void cac::show ( unsigned level ) const ::printf ( "Channel Access Client Context at %p for user %s\n", this, this->pUserName ); if ( level > 0u ) { - tsDLIterConstBD < tcpiiu > piiu ( this->iiuList.first () ); + tsDLIterConstBD < tcpiiu > piiu = this->iiuList.firstIter (); while ( piiu.valid () ) { piiu->show ( level - 1u ); piiu++; diff --git a/src/ca/cacServiceList.cpp b/src/ca/cacServiceList.cpp index 62f8b3357..a5a125777 100644 --- a/src/ca/cacServiceList.cpp +++ b/src/ca/cacServiceList.cpp @@ -36,7 +36,7 @@ cacChannelIO * cacServiceList::createChannelIO ( const char *pName, cacChannelIO *pChanIO = 0; this->lock (); - tsDLIterBD < cacServiceIO > iter ( this->services.first () ); + tsDLIterBD < cacServiceIO > iter = this->services.firstIter (); while ( iter.valid () ) { pChanIO = iter->createChannelIO ( pName, cacCtx, chan ); if ( pChanIO ) { @@ -52,7 +52,7 @@ cacChannelIO * cacServiceList::createChannelIO ( const char *pName, void cacServiceList::show ( unsigned level ) const { this->lock (); - tsDLIterConstBD < cacServiceIO > iter ( this->services.first () ); + tsDLIterConstBD < cacServiceIO > iter = this->services.firstIter (); while ( iter.valid () ) { iter->show ( level ); iter++; diff --git a/src/ca/inetAddrID_IL.h b/src/ca/inetAddrID_IL.h index 76e7cbd7c..9bb8dc3d9 100644 --- a/src/ca/inetAddrID_IL.h +++ b/src/ca/inetAddrID_IL.h @@ -15,7 +15,7 @@ inline inetAddrID::inetAddrID (const struct sockaddr_in &addrIn) : { } -inline bool inetAddrID::operator == (const inetAddrID &rhs) +inline bool inetAddrID::operator == (const inetAddrID &rhs) const { if (this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr) { if (this->addr.sin_port == rhs.addr.sin_port) { diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h index 6399ec9ac..c4612b612 100644 --- a/src/ca/iocinf.h +++ b/src/ca/iocinf.h @@ -865,7 +865,7 @@ private: class inetAddrID { public: inetAddrID ( const struct sockaddr_in &addrIn ); - bool operator == ( const inetAddrID & ); + bool operator == ( const inetAddrID & ) const; resTableIndex hash ( unsigned nBitsHashIndex ) const; static unsigned maxIndexBitWidth (); static unsigned minIndexBitWidth (); diff --git a/src/ca/netiiu.cpp b/src/ca/netiiu.cpp index df9105961..1111e2556 100644 --- a/src/ca/netiiu.cpp +++ b/src/ca/netiiu.cpp @@ -32,10 +32,10 @@ void netiiu::show ( unsigned level ) const printf ( "network IO base class\n" ); if ( level > 1 ) { - tsDLIterConstBD < nciu > pChan ( this->channelList.first () ); + tsDLIterConstBD < nciu > pChan = this->channelList.firstIter (); while ( pChan.valid () ) { pChan->show ( level - 1u ); - pChan = pChan.itemAfter (); + pChan++; } } if ( level > 2u ) { @@ -78,9 +78,10 @@ void netiiu::disconnectAllChan ( netiiu & newiiu ) { epicsAutoMutex autoMutex ( this->mutex ); - tsDLIterBD < nciu > chan ( this->channelList.first () ); + tsDLIterBD < nciu > chan = this->channelList.firstIter (); while ( chan.valid () ) { - tsDLIterBD < nciu > next = chan.itemAfter (); + tsDLIterBD < nciu > next = chan; + next++; this->clearChannelRequest ( *chan ); this->channelList.remove ( *chan ); chan->disconnect ( newiiu ); @@ -123,7 +124,7 @@ bool netiiu::destroyAllIO ( nciu &chan ) void netiiu::connectTimeoutNotify () { epicsAutoMutex autoMutex ( this->mutex ); - tsDLIterBD < nciu > chan ( this->channelList.first () ); + tsDLIterBD < nciu > chan = this->channelList.firstIter (); while ( chan.valid () ) { chan->connectTimeoutNotify (); chan++; @@ -133,7 +134,7 @@ void netiiu::connectTimeoutNotify () void netiiu::resetChannelRetryCounts () { epicsAutoMutex autoMutex ( this->mutex ); - tsDLIterBD < nciu > chan ( this->channelList.first () ); + tsDLIterBD < nciu > chan = this->channelList.firstIter (); while ( chan.valid () ) { chan->resetRetryCount (); chan++; @@ -146,12 +147,12 @@ bool netiiu::searchMsg ( unsigned short retrySeqNumber, unsigned &retryNoForThis epicsAutoMutex autoMutex ( this->mutex ); - tsDLIterBD < nciu > chan = this->channelList.first (); - if ( chan.valid () ) { - status = chan->searchMsg ( retrySeqNumber, retryNoForThisChannel ); + nciu *pChan = this->channelList.first (); + if ( pChan ) { + status = pChan->searchMsg ( retrySeqNumber, retryNoForThisChannel ); if ( status ) { - this->channelList.remove ( *chan ); - this->channelList.add ( *chan ); + this->channelList.remove ( *pChan ); + this->channelList.add ( *pChan ); } } else { diff --git a/src/ca/repeater.cpp b/src/ca/repeater.cpp index d5c6d6861..30b667b79 100644 --- a/src/ca/repeater.cpp +++ b/src/ca/repeater.cpp @@ -412,33 +412,35 @@ LOCAL void register_new_client ( osiSockAddr &from ) } } - tsDLIterBD < repeaterClient > pclient = client_list.first (); + tsDLIterBD < repeaterClient > pclient = client_list.firstIter (); while ( pclient.valid () ) { if ( pclient->identicalPort ( from ) ) { break; } - pclient = pclient.itemAfter (); - } - - if ( ! pclient.valid () ) { - pclient = new repeaterClient ( from ); - if ( ! pclient.valid () ) { + pclient++; + } + + repeaterClient *pNewClient; + if ( pclient.valid () ) { + pNewClient = pclient.pointer (); + } + else { + repeaterClient *pNewClient = new repeaterClient ( from ); + if ( ! pNewClient ) { ca_printf ( "%s: no memory for new client\n", __FILE__ ); return; } - - if ( ! pclient->connect () ) { + if ( ! pNewClient->connect () ) { pclient->destroy (); return; } - - client_list.add ( *pclient ); + client_list.add ( *pNewClient ); newClient = true; } - if ( ! pclient->sendConfirm () ) { - client_list.remove (*pclient ); - pclient->destroy (); + if ( ! pNewClient->sendConfirm () ) { + client_list.remove ( *pNewClient ); + pNewClient->destroy (); debugPrintf ( ( "Deleted repeater client=%u (error while sending ack)\n", ntohs (from.ia.sin_port) ) ); } diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 5573f3de0..258bf4145 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -1958,9 +1958,10 @@ void tcpiiu::connectAllIO ( nciu &chan ) epicsAutoMutex autoMutex ( this->mutex ); if ( chan.verifyConnected ( *this ) ) { tsDLIterBD < baseNMIU > pNetIO = - chan.tcpiiuPrivateListOfIO::eventq.first (); + chan.tcpiiuPrivateListOfIO::eventq.firstIter (); while ( pNetIO.valid () ) { - tsDLIterBD < baseNMIU > next = pNetIO.itemAfter (); + tsDLIterBD < baseNMIU > next = pNetIO; + next++; class netSubscription *pSubscr = pNetIO->isSubscription (); if ( pSubscr ) { this->subscriptionRequest ( *pSubscr, false ); @@ -1984,9 +1985,10 @@ void tcpiiu::disconnectAllIO ( nciu &chan ) epicsAutoMutex autoMutex ( this->mutex ); if ( chan.verifyConnected ( *this ) ) { tsDLIterBD < baseNMIU > pNetIO = - chan.tcpiiuPrivateListOfIO::eventq.first (); + chan.tcpiiuPrivateListOfIO::eventq.firstIter (); while ( pNetIO.valid () ) { - tsDLIterBD < baseNMIU > next = pNetIO.itemAfter (); + tsDLIterBD < baseNMIU > next = pNetIO; + next++; class netSubscription *pSubscr = pNetIO->isSubscription (); this->ioTable.remove ( *pNetIO ); if ( pSubscr ) { diff --git a/src/cas/generic/caServerI.cc b/src/cas/generic/caServerI.cc index b1e37afdf..18e340036 100644 --- a/src/cas/generic/caServerI.cc +++ b/src/cas/generic/caServerI.cc @@ -109,7 +109,7 @@ caServerI::~caServerI() // // delete all clients // - tsDLIterBD iter ( this->clientList.first () ); + tsDLIterBD iter = this->clientList.firstIter (); while ( iter.valid () ) { tsDLIterBD tmp = iter; ++tmp; @@ -245,7 +245,7 @@ void caServerI::sendBeacon() // addresses. // this->lock(); - tsDLIterBD iter ( this->intfList.first () ); + tsDLIterBD iter = this->intfList.firstIter (); while ( iter.valid () ) { iter->sendBeacon (); iter++; @@ -271,7 +271,7 @@ double caServerI::getBeaconPeriod() const // void caServerI::show (unsigned level) const { - int bytes_reserved; + int bytes_reserved; printf( "Channel Access Server Status V%d.%d\n", CA_PROTOCOL_VERSION, CA_MINOR_VERSION); @@ -279,13 +279,13 @@ void caServerI::show (unsigned level) const this->epicsMutex::show(level); this->lock(); - tsDLIterBD iterCl( this->clientList.first () ); + tsDLIterConstBD iterCl = this->clientList.firstIter (); while ( iterCl.valid () ) { iterCl->show (level); ++iterCl; } - tsDLIterBD iterIF ( this->intfList.first () ); + tsDLIterConstBD iterIF = this->intfList.firstIter (); while ( iterIF.valid () ) { iterIF->casIntfOS::show ( level ); ++iterIF; diff --git a/src/cas/generic/casChannelI.cc b/src/cas/generic/casChannelI.cc index 214713a9e..3a706cb0b 100644 --- a/src/cas/generic/casChannelI.cc +++ b/src/cas/generic/casChannelI.cc @@ -59,12 +59,12 @@ casChannelI::~casChannelI() // // cancel any pending asynchronous IO // - tsDLIterBD iterAIO ( this->ioInProgList.first () ); + tsDLIterBD iterAIO = this->ioInProgList.firstIter (); while ( iterAIO.valid () ) { // // destructor removes from this list // - tsDLIterBD tmpAIO = iterAIO; + tsDLIterBD tmpAIO = iterAIO; ++tmpAIO; iterAIO->serverDestroy (); iterAIO = tmpAIO; @@ -73,7 +73,7 @@ casChannelI::~casChannelI() // // cancel the monitors // - tsDLIterBD iterMon ( this->monitorList.first () ); + tsDLIterBD iterMon = this->monitorList.firstIter (); while ( iterMon.valid () ) { // // destructor removes from this list @@ -104,7 +104,7 @@ void casChannelI::clearOutstandingReads() // // cancel any pending asynchronous IO // - tsDLIterBD iterIO ( this->ioInProgList.first () ); + tsDLIterBD iterIO = this->ioInProgList.firstIter (); while ( iterIO.valid () ) { // // destructor removes from this list @@ -121,11 +121,11 @@ void casChannelI::clearOutstandingReads() // // casChannelI::show() // -void casChannelI::show(unsigned level) const +void casChannelI::show ( unsigned level ) const { - this->lock(); + this->lock (); - tsDLIterBD iter(this->monitorList.first()); + tsDLIterConstBD iter = this->monitorList.firstIter (); if ( iter.valid () ) { printf("List of CA events (monitors) for \"%s\".\n", this->pv.getName()); @@ -135,9 +135,9 @@ void casChannelI::show(unsigned level) const ++iter; } - this->show(level); + this->show ( level ); - this->unlock(); + this->unlock (); } // diff --git a/src/cas/generic/casChannelIIL.h b/src/cas/generic/casChannelIIL.h index 007cddf3a..ce7b947b9 100644 --- a/src/cas/generic/casChannelIIL.h +++ b/src/cas/generic/casChannelIIL.h @@ -60,7 +60,7 @@ inline void casChannelI::postEvent (const casEventMask &select, const smartConst { this->lock(); - tsDLIterBD iter(this->monitorList.first()); + tsDLIterBD iter = this->monitorList.firstIter (); while ( iter.valid () ) { iter->post (select, pEvent); ++iter; @@ -105,7 +105,7 @@ inline void casChannelI::addMonitor(casMonitor &mon) inline tsDLIterBD casChannelI::findMonitor (const caResId clientIdIn) { this->lock (); - tsDLIterBD iter ( this->monitorList.first () ); + tsDLIterBD iter = this->monitorList.firstIter (); while ( iter.valid () ) { if ( clientIdIn == iter->getClientId () ) { break; diff --git a/src/cas/generic/casCoreClient.cc b/src/cas/generic/casCoreClient.cc index f1cfac974..dca3860ca 100644 --- a/src/cas/generic/casCoreClient.cc +++ b/src/cas/generic/casCoreClient.cc @@ -57,7 +57,7 @@ casCoreClient::~casCoreClient() } this->lock(); - tsDLIterBD iterIO(this->ioInProgList.first()); + tsDLIterBD iterIO = this->ioInProgList.firstIter (); // // cancel any pending asynchronous IO diff --git a/src/cas/generic/casPVI.cc b/src/cas/generic/casPVI.cc index 1a740f686..343108328 100644 --- a/src/cas/generic/casPVI.cc +++ b/src/cas/generic/casPVI.cc @@ -62,12 +62,8 @@ casPVI::~casPVI() // // delete any attached channels // - tsDLIterBD iter ( this->chanList.first () ); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { - // - // deleting the channel removes it from the list - // - tsDLIterBD tmp = iter; ++tmp; iter->destroyClientNotify (); diff --git a/src/cas/generic/casPVIIL.h b/src/cas/generic/casPVIIL.h index d3a5a0093..cc3a701ec 100644 --- a/src/cas/generic/casPVIIL.h +++ b/src/cas/generic/casPVIIL.h @@ -135,9 +135,9 @@ inline void casPVI::postEvent (const casEventMask &select, const smartConstGDDPo } this->lock(); - tsDLIterBD iter(this->chanList.first()); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { - iter->postEvent(select, pEvent); + iter->postEvent ( select, pEvent ); ++iter; } this->unlock(); diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc index 5dec128e9..715f54cf7 100644 --- a/src/cas/generic/casStrmClient.cc +++ b/src/cas/generic/casStrmClient.cc @@ -95,7 +95,7 @@ casStrmClient::~casStrmClient() // // delete all channel attached // - tsDLIterBD iter(this->chanList.first()); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { // // destroying the channel removes it from the list @@ -975,7 +975,7 @@ caStatus casStrmClient::hostNameAction() } this->pHostName = pMalloc; - tsDLIterBD iter(this->chanList.first()); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { iter->setOwner(this->pUserName, this->pHostName); ++iter; @@ -1023,7 +1023,7 @@ caStatus casStrmClient::clientNameAction() } this->pUserName = pMalloc; - tsDLIterBD iter ( this->chanList.first () ); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { iter->setOwner ( this->pUserName, this->pHostName ); ++iter; @@ -1495,11 +1495,11 @@ caStatus casStrmClient::clearChannelAction () // caStatus casStrmClient::eventCancelAction () { - const caHdr *mp = this->ctx.getMsg (); - void *dp = this->ctx.getData (); + const caHdr *mp = this->ctx.getMsg (); + void *dp = this->ctx.getData (); casChannelI *pciu; - caHdr *reply; - int status; + caHdr *reply; + int status; /* * Verify the channel @@ -1519,19 +1519,19 @@ caStatus casStrmClient::eventCancelAction () /* * verify the event (monitor) */ - tsDLIterBD < casMonitor > pMon = pciu->findMonitor ( mp->m_available ); + tsDLIterBD pMon = pciu->findMonitor ( mp->m_available ); if ( ! pMon.valid () ) { // // this indicates client or server library corruption // - return logBadId (mp, dp, ECA_BADMONID, mp->m_cid); + return logBadId ( mp, dp, ECA_BADMONID, mp->m_cid ); } /* * allocate delete confirmed message */ - status = allocMsg (0u, &reply); - if (status) { + status = allocMsg ( 0u, &reply ); + if ( status ) { return status; } @@ -1619,21 +1619,21 @@ caStatus casStrmClient::readSyncAction() // a read. // this->lock(); - tsDLIterBD iter(this->chanList.first()); + tsDLIterBD iter = this->chanList.firstIter (); while ( iter.valid () ) { iter->clearOutstandingReads (); ++iter; } this->unlock(); - status = this->allocMsg(0u, &reply); - if(status){ + status = this->allocMsg ( 0u, &reply ); + if ( status ) { return status; } *reply = *mp; - this->commitMsg(); + this->commitMsg (); return S_cas_success; } diff --git a/src/db/dbChannelIO.cpp b/src/db/dbChannelIO.cpp index a63714fc1..10ebc9558 100644 --- a/src/db/dbChannelIO.cpp +++ b/src/db/dbChannelIO.cpp @@ -50,9 +50,10 @@ dbChannelIO::~dbChannelIO () /* * remove any subscriptions attached to this channel */ - tsDLIterBD iter = this->eventq.first (); + tsDLIterBD iter = this->eventq.firstIter (); while ( iter.valid () ) { - tsDLIterBD next = iter.itemAfter (); + tsDLIterBD next = iter; + next++; iter->destroy (); iter = next; } @@ -206,7 +207,7 @@ void dbChannelIO::show ( unsigned level ) const this->serviceIO.show ( level - 2u ); printf ( "\tget callback cache at %p, with size %lu\n", this->pGetCallbackCache, this->getCallbackCacheSize ); - tsDLIterConstBD < dbSubscriptionIO > pItem = this->eventq.first (); + tsDLIterConstBD < dbSubscriptionIO > pItem = this->eventq.firstIter (); while ( pItem.valid () ) { pItem->show ( level - 2u ); pItem++; diff --git a/src/libCom/cxxTemplates/resourceLib.h b/src/libCom/cxxTemplates/resourceLib.h index ad2464310..6b7f0bc83 100644 --- a/src/libCom/cxxTemplates/resourceLib.h +++ b/src/libCom/cxxTemplates/resourceLib.h @@ -100,79 +100,34 @@ template class resTableIter; // template class resTable { - friend class resTableIter; public: - + resTable (unsigned nHashTableEntries); + virtual ~resTable(); + // Call " void T::show (unsigned level)" for each entry + void show (unsigned level) const; + int add (T &res); // returns -1 (id exists in table), 0 (success) + T *remove (const ID &idIn); // remove entry + T *lookup (const ID &idIn) const; // locate entry + // Call (pT->*pCB) () for each entry + void traverse ( void (T::*pCB)() ); + void traverseConst ( void (T::*pCB)() const ) const; + unsigned numEntriesInstalled () const; // // exceptions thrown // class epicsShareClass dynamicMemoryAllocationFailed {}; class epicsShareClass sizeExceedsMaxIndexWidth {}; - - resTable (unsigned nHashTableEntries); - - virtual ~resTable(); - - // - // Call (pT->show) (level) for each entry - // where pT is a pointer to type T. Show - // returns "void". Show dumps increasing - // diagnostics to std out with increasing - // magnitude of the its level argument. - // - void show (unsigned level) const; - - // - // add entry - // - // returns -1 if the id already exits in the table - // and zero if successful - // - int add (T &res); - - T *remove (const ID &idIn); // remove entry - - T *lookup (const ID &idIn) const; // locate entry - -#if defined(_MSC_VER) && _MSC_VER < 1100 - // - // required by MS vis c++ 5.0 (but not by 4.0) - // - typedef void (T::*pSetMFArg_t)(); -# define pSetMFArg(ARG) pSetMFArg_t ARG - typedef void (T::*pSetMFArgConst_t)() const; -# define pSetMFArgConst(ARG) pSetMFArgConst_t ARG -#else - // - // required by gnu g++ 2.7.2 - // -# define pSetMFArg(ARG) void (T:: * ARG)() -# define pSetMFArgConst(ARG) void (T:: * ARG)() const -#endif - - // - // Call (pT->*pCB) () for each entry - // - // where pT is a pointer to type T and pCB is - // a pointer to a member function of T with - // no parameters that returns void - // - void traverse ( pSetMFArg(pCB) ); - void traverseConst ( pSetMFArgConst(pCB) ) const; - - unsigned numEntriesInstalled () const; - private: - tsSLList *pTable; - unsigned hashIdMask; - unsigned hashIdNBits; - unsigned nInUse; - + tsSLList *pTable; + unsigned hashIdMask; + unsigned hashIdNBits; + unsigned nInUse; resTableIndex hash (const ID & idIn) const; T *find (tsSLList &list, const ID &idIn) const; T *findDelete (tsSLList &list, const ID &idIn); resTable ( const resTable & ); resTable & operator = ( const resTable & ); + friend class resTableIter; }; @@ -229,7 +184,6 @@ public: static resTableIndex hashEngine (const T &id); static const unsigned maxIndexBitWidth (); static const unsigned minIndexBitWidth (); - protected: T id; }; @@ -279,11 +233,6 @@ private: // class epicsShareClass stringId { public: - - // - // exceptions - // - class epicsShareClass dynamicMemoryAllocationFailed {}; enum allocationType {copyString, refString}; stringId (const char * idIn, allocationType typeIn=copyString); virtual ~stringId(); @@ -293,7 +242,10 @@ public: void show (unsigned level) const; static const unsigned maxIndexBitWidth (); static const unsigned minIndexBitWidth (); - + // + // exceptions + // + class epicsShareClass dynamicMemoryAllocationFailed {}; private: stringId & operator = ( const stringId & ); stringId ( const stringId &); @@ -401,15 +353,14 @@ void resTable::show (unsigned level) const maxEntries = 0u; while ( pList < &this->pTable[this->hashIdMask+1] ) { unsigned count; - tsSLIter pItem ( pList->first () ); - + tsSLIter pItem = pList->firstIter (); count = 0; while ( pItem.valid () ) { if ( level >= 3u ) { pItem->show (level); } count++; - pItem = pItem.itemAfter (); + pItem++; } if ( count > 0u ) { X += count; @@ -433,17 +384,16 @@ void resTable::show (unsigned level) const // resTable::traverse // template -void resTable::traverse (pSetMFArg(pCB)) +void resTable::traverse ( void (T::*pCB)() ) { tsSLList *pList; pList = this->pTable; while ( pList < &this->pTable[this->hashIdMask+1] ) { - tsSLIter pItem ( pList->first () ); + tsSLIter pItem = pList->firstIter (); while ( pItem.valid () ) { - T * p = & ( *pItem ); - pItem = pItem.itemAfter (); - (p->*pCB) (); + ( pItem.pointer ()->*pCB ) (); + pItem++; } pList++; } @@ -453,17 +403,16 @@ void resTable::traverse (pSetMFArg(pCB)) // resTable::traverseConst // template -void resTable::traverseConst (pSetMFArgConst(pCB)) const +void resTable::traverseConst ( void (T::*pCB)() const ) const { const tsSLList *pList; pList = this->pTable; while ( pList < &this->pTable[this->hashIdMask+1] ) { - tsSLIterConst pItem ( pList->first () ); + tsSLIterConst pItem = pList->firstIter (); while ( pItem.valid () ) { - const T * p = & ( *pItem ); - pItem = pItem.itemAfter (); - (p->*pCB) (); + ( pItem.pointer ()->*pCB ) (); + pItem++; } pList++; } @@ -509,17 +458,15 @@ int resTable::add (T &res) template T *resTable::find (tsSLList &list, const ID &idIn) const { - tsSLIter pItem ( list.first () ); - ID *pId; - + tsSLIter pItem = list.firstIter (); while ( pItem.valid () ) { - pId = & (*pItem) ; - if ( *pId == idIn ) { + const ID &id = *pItem; + if ( id == idIn ) { break; } - pItem = pItem.itemAfter (); + pItem++; } - return & (*pItem); + return pItem.pointer (); } // @@ -535,14 +482,13 @@ T *resTable::find (tsSLList &list, const ID &idIn) const template T *resTable::findDelete (tsSLList &list, const ID &idIn) { - tsSLIter pItem ( list.first () ); - tsSLIter pPrev ( 0 ); - ID *pId; + tsSLIter pItem = list.firstIter (); + T *pPrev = 0; while ( pItem.valid () ) { - pId = & (*pItem); - if ( *pId == idIn ) { - if ( pPrev.valid () ) { + const ID &id = *pItem; + if ( id == idIn ) { + if ( pPrev ) { list.remove ( *pPrev ); } else { @@ -551,10 +497,10 @@ T *resTable::findDelete (tsSLList &list, const ID &idIn) this->nInUse--; break; } - pPrev = pItem; - pItem = pItem.itemAfter (); + pPrev = pItem.pointer (); + pItem++; } - return & (*pItem); + return pItem.pointer (); } // @@ -585,8 +531,8 @@ inline resTableIter::resTableIter (const resTable &tableIn) : template T * resTableIter::next () { - if ( this->iter.valid () ) { - T *p = & (*this->iter); + if ( this->iter ) { + T *p = this->iter; this->iter++; return p; } @@ -595,8 +541,8 @@ T * resTableIter::next () return 0; } this->iter = tsSLIter ( this->table.pTable[this->index++].first () ); - if ( this->iter.valid () ) { - T *p = & (*this->iter); + if ( this->iter ) { + T *p = this->iter; this->iter++; return p; } diff --git a/src/libCom/cxxTemplates/test/tsDLListTest.cc b/src/libCom/cxxTemplates/test/tsDLListTest.cc index 01f042c2b..1d8ab6fbf 100644 --- a/src/libCom/cxxTemplates/test/tsDLListTest.cc +++ b/src/libCom/cxxTemplates/test/tsDLListTest.cc @@ -80,7 +80,7 @@ int main () tsDLIterConstBD bdIter ( janeList.first () ); i = 0; - while ( bdIter != bdIter.eol () ) { + while ( bdIter ) { i++; bdIter++; } diff --git a/src/libCom/cxxTemplates/test/tsSLListBench.cc b/src/libCom/cxxTemplates/test/tsSLListBench.cc index 7d9cfb566..cf5c39a43 100644 --- a/src/libCom/cxxTemplates/test/tsSLListBench.cc +++ b/src/libCom/cxxTemplates/test/tsSLListBench.cc @@ -46,7 +46,7 @@ int main () clk = clock(); { tsSLIter iter ( list.first () ); - while ( iter.valid () ) { + while ( iter ) { iter->inc (); iter++; } diff --git a/src/libCom/cxxTemplates/test/tsSLListTest.cc b/src/libCom/cxxTemplates/test/tsSLListTest.cc index f9822ff80..ed249fe9f 100644 --- a/src/libCom/cxxTemplates/test/tsSLListTest.cc +++ b/src/libCom/cxxTemplates/test/tsSLListTest.cc @@ -59,7 +59,7 @@ int main () { tsSLIter iter ( list.first() ); - while ( iter.valid () ) { + while ( iter ) { iter->show(); ++iter; } @@ -72,7 +72,7 @@ int main () { tsSLIter iter ( janeList.first() ); - while ( iter.valid () ) { + while ( iter ) { iter->show(); ++iter; } @@ -80,7 +80,7 @@ int main () { tsSLIter iter ( list.first () ); - while ( iter.valid () ) { + while ( iter ) { iter->show(); iter++; } @@ -90,7 +90,7 @@ int main () { tsSLIter iter (list.first()); - assert ( iter == tsSLIter::eol() ); + assert ( ! iter ); } return 0; diff --git a/src/libCom/cxxTemplates/tsDLList.h b/src/libCom/cxxTemplates/tsDLList.h index 42056f1d7..2b63bd8c7 100644 --- a/src/libCom/cxxTemplates/tsDLList.h +++ b/src/libCom/cxxTemplates/tsDLList.h @@ -52,18 +52,18 @@ template class tsDLBwdIter; // deprecated // template class tsDLNode { +public: + tsDLNode(); + tsDLNode operator = (const tsDLNode &) const; +private: + T *pNext; + T *pPrev; friend class tsDLList; friend class tsDLIterBD; friend class tsDLIterConstBD; friend class tsDLIter; // deprecated friend class tsDLFwdIter; // deprecated friend class tsDLBwdIter; // deprecated -public: - tsDLNode(); - tsDLNode operator = (const tsDLNode &) const; -private: - T *pNext; - T *pPrev; }; // @@ -75,65 +75,34 @@ private: // template class tsDLList { +public: + tsDLList (); // create empty list + unsigned count () const; // number of items on list + void add ( T &item ); // add item to end of list + void add ( tsDLList &addList ); // add to end of list - addList left empty + void push ( T &item ); // add item to beginning of list + void remove ( T &item ); // remove item from list + T * get (); // removes first item on list + T * pop (); // same as get () + void insertAfter ( T &item, T &itemBefore ); // insert item immediately after itemBefore + void insertBefore ( T &item, T &itemAfter ); // insert item immediately before itemAfter + int find (const T &item) const; // returns -1 if not present, node number if present + T *first (void) const; // ptr to first item on list + T *last (void) const; // ptr to last item on list + tsDLIterConstBD firstIter () const; + tsDLIterBD firstIter (); + tsDLIterConstBD lastIter () const; + tsDLIterBD lastIter (); +private: + T *pFirst; + T *pLast; + unsigned itemCount; + void clear (); + tsDLList (const tsDLList &); // not allowed + const tsDLList & operator = ( const tsDLList & ); // not allowed friend class tsDLIter; // deprecated friend class tsDLFwdIter; // deprecated friend class tsDLBwdIter; // deprecated -public: - - tsDLList (); // create empty list - - unsigned count () const; // number of items on list - - void add (T &item); // add item to end of list - - // all Ts in addList added to end of list - // (addList left empty) - void add (tsDLList &addList); - - void push (T &item); // add item to beginning of list - - // remove item from list - void remove (T &item); - - T * get (); // removes first item on list - T * pop (); // same as get () - - // insert item in the list immediately after itemBefore - void insertAfter (T &item, T &itemBefore); - - // insert item in the list immediately before itemAfter) - void insertBefore (T &item, T &itemAfter); - - // - // returns -1 if the item isnt on the list and the node - // number (beginning with zero if it is) - // - int find (const T &item) const; - - T *first (void) const; // ptr to first item on list - T *last (void) const; // ptr to last item on list - -private: - T *pFirst; - T *pLast; - unsigned itemCount; - - // - // create empty list - // (throw away any knowledge of current list) - // - void clear (); - - // - // copying one list item into another and - // ending up with to list headers pointing - // at the same list is always a questionable - // thing to do. - // - // therefore, this is intentionally private - // and _not_ implemented. - // - tsDLList (const tsDLList &); }; // @@ -144,40 +113,24 @@ private: template class tsDLIterConstBD { public: - tsDLIterConstBD (const T *pInitialEntry); - - tsDLIterConstBD & operator = (const T *pNewEntry); - - tsDLIterConstBD itemAfter (); - tsDLIterConstBD itemBefore (); - + bool valid () const; bool operator == (const tsDLIterConstBD &rhs) const; bool operator != (const tsDLIterConstBD &rhs) const; - const T & operator * () const; const T * operator -> () const; - - tsDLIterConstBD operator ++ (); // prefix ++ - tsDLIterConstBD operator ++ (int); // postfix ++ - tsDLIterConstBD operator -- (); // prefix -- - tsDLIterConstBD operator -- (int); // postfix -- - -# if defined(_MSC_VER) && _MSC_VER < 1200 - tsDLIterConstBD (const class tsDLIterConstBD ©In); -# endif - - bool valid () const; - - // - // end of the list constant - // - static const tsDLIterConstBD eol (); - + tsDLIterConstBD operator ++ (); + tsDLIterConstBD operator ++ (int); + tsDLIterConstBD operator -- (); + tsDLIterConstBD operator -- (int); + const T * pointer () const; protected: union { const T *pConstEntry; T *pEntry; }; + tsDLIterConstBD ( const T *pInitialEntry ); +private: + friend class tsDLList ; }; // @@ -188,37 +141,19 @@ protected: template class tsDLIterBD : private tsDLIterConstBD { public: - tsDLIterBD (T *pInitialEntry); - - tsDLIterBD & operator = (T *pNewEntry); - - tsDLIterBD itemAfter (); - tsDLIterBD itemBefore (); - + bool valid () const; bool operator == (const tsDLIterBD &rhs) const; bool operator != (const tsDLIterBD &rhs) const; - T & operator * () const; T * operator -> () const; - - tsDLIterBD operator ++ (); // prefix ++ - - tsDLIterBD operator ++ (int); // postfix ++ - - tsDLIterBD operator -- (); // prefix -- - - tsDLIterBD operator -- (int); // postfix -- - -# if defined(_MSC_VER) && _MSC_VER < 1200 - tsDLIterBD (const class tsDLIterBD ©In); -# endif - - bool valid () const; - - // - // end of the list constant - // - static const tsDLIterBD eol (); + tsDLIterBD operator ++ (); + tsDLIterBD operator ++ (int); + tsDLIterBD operator -- (); + tsDLIterBD operator -- (int); + T * pointer () const; +private: + tsDLIterBD ( T *pInitialEntry ); + friend class tsDLList ; }; /////////////////////////////////// @@ -238,19 +173,10 @@ inline tsDLNode::tsDLNode() : pNext(0), pPrev(0) {} // do _not_ change the node pointers // template -inline tsDLNode tsDLNode::operator = (const tsDLNode &) const { return tsDLNode(); } - -//template -//T * tsDLNode::getNext (void) const -//{ -// return pNext; -//} - -//template -//T * tsDLNode::getPrev (void) const -//{ -// return pPrev; -//} +inline tsDLNode tsDLNode::operator = (const tsDLNode &) const +{ + return tsDLNode(); +} ////////////////////////////////////// // tsDLList member functions @@ -515,7 +441,7 @@ int tsDLList < T > :: find ( const T &item ) const tsDLIterConstBD < T > iter ( this->first () ); int itemNo = 0; - while ( iter.valid () ) { + while ( iter ) { if ( iter == thisItem ) { return itemNo; } @@ -525,31 +451,41 @@ int tsDLList < T > :: find ( const T &item ) const return -1; } +template < class T > +inline tsDLIterConstBD tsDLList < T > :: firstIter () const +{ + return tsDLIterConstBD < T > ( this->pFirst ); +} + +template < class T > +inline tsDLIterBD tsDLList < T > :: firstIter () +{ + return tsDLIterBD < T > ( this->pFirst ); +} + +template < class T > +inline tsDLIterConstBD tsDLList < T > :: lastIter () const +{ + return tsDLIterConstBD < T > ( this->pLast ); +} + +template < class T > +inline tsDLIterBD tsDLList < T > :: lastIter () +{ + return tsDLIterBD < T > ( this->pLast ); +} + ////////////////////////////////////////// // tsDLIterConstBD member functions ////////////////////////////////////////// template -inline tsDLIterConstBD::tsDLIterConstBD (const T * pInitialEntry) : - pConstEntry (pInitialEntry) {} - -// -// This is apparently required by some compiler, but -// only causes trouble with MS Visual C 6.0. This -// should not be required by any compiler. I am assuming -// that this "some compiler" is a past version of MS -// Visual C. -// -# if defined(_MSC_VER) && _MSC_VER < 1200 - template - inline tsDLIterConstBD::tsDLIterConstBD (const class tsDLIterBD ©In) : - pConstEntry (copyIn.pEntry) {} -# endif +inline tsDLIterConstBD::tsDLIterConstBD ( const T *pInitialEntry ) : + pConstEntry ( pInitialEntry ) {} template -inline tsDLIterConstBD & tsDLIterConstBD::operator = (const T *pNewEntry) +inline bool tsDLIterConstBD::valid () const { - this->pConstEntry = pNewEntry; - return *this; + return this->pConstEntry != 0; } template @@ -576,20 +512,6 @@ inline const T * tsDLIterConstBD::operator -> () const return this->pConstEntry; } -template -inline tsDLIterConstBD tsDLIterConstBD::itemAfter () -{ - const tsDLNode &node = *this->pConstEntry; - return tsDLIterConstBD (node.pNext); -} - -template -inline tsDLIterConstBD tsDLIterConstBD::itemBefore () -{ - const tsDLNode &node = *this->pConstEntry; - return tsDLIterConstBD (node.pPrev); -} - // // prefix ++ // @@ -637,18 +559,9 @@ inline tsDLIterConstBD tsDLIterConstBD::operator -- (int) } template -inline bool tsDLIterConstBD::valid () const +inline const T * tsDLIterConstBD::pointer () const { - return this->pEntry ? true : false; -} - -// -// tsDLIterConstBD::eol -// -template -inline const tsDLIterConstBD tsDLIterConstBD::eol () -{ - return tsDLIterConstBD(0); + return this->pConstEntry; } ////////////////////////////////////////// @@ -656,27 +569,13 @@ inline const tsDLIterConstBD tsDLIterConstBD::eol () ////////////////////////////////////////// template -inline tsDLIterBD::tsDLIterBD (T * pInitialEntry) : - tsDLIterConstBD (pInitialEntry) {} - -// -// This is apparently required by some compiler, but -// only causes trouble with MS Visual C 6.0. This -// should not be required by any compiler. I am assuming -// that this "some compiler" is a past version of MS -// Visual C. -// -# if defined(_MSC_VER) && _MSC_VER < 1200 - template - inline tsDLIterBD::tsDLIterBD (const class tsDLIterBD ©In) : - tsDLIterConstBD (copyIn) {} -# endif +inline tsDLIterBD::tsDLIterBD ( T * pInitialEntry ) : + tsDLIterConstBD ( pInitialEntry ) {} template -inline tsDLIterBD & tsDLIterBD::operator = (T *pNewEntry) +inline bool tsDLIterBD::valid () const { - tsDLIterConstBD::operator = (pNewEntry); - return *this; + return this->pEntry != 0; } template @@ -703,32 +602,6 @@ inline T * tsDLIterBD::operator -> () const return this->pEntry; } -template -inline tsDLIterBD tsDLIterBD::itemAfter () -{ - tsDLNode &node = *this->pEntry; - return tsDLIterBD (node.pNext); -} - -template -inline tsDLIterBD tsDLIterBD::itemBefore () -{ - tsDLNode &node = *this->pEntry; - return tsDLIterBD (node.pPrev); -} - -template -inline bool tsDLIterBD::valid () const -{ - return this->pEntry ? true : false; -} - -template -inline const tsDLIterBD tsDLIterBD::eol () -{ - return tsDLIterBD(0); -} - template inline tsDLIterBD tsDLIterBD::operator ++ () // prefix ++ { @@ -759,6 +632,12 @@ inline tsDLIterBD tsDLIterBD::operator -- (int) // postfix -- return tmp; } +template +inline T * tsDLIterBD::pointer () const +{ + return this->pEntry; +} + #include "tsDLListDeprecated.h" #endif // tsDLListH_include diff --git a/src/libCom/cxxTemplates/tsSLList.h b/src/libCom/cxxTemplates/tsSLList.h index 933f6eece..32e30e4f6 100644 --- a/src/libCom/cxxTemplates/tsSLList.h +++ b/src/libCom/cxxTemplates/tsSLList.h @@ -54,16 +54,16 @@ template < class T > class tsSLIterConst; // template class tsSLNode { -friend class tsSLList < T >; -friend class tsSLIter < T >; -friend class tsSLIterConst < T >; public: tsSLNode (); const tsSLNode < T > & operator = ( const tsSLNode < T > & ) const; private: - tsSLNode ( const tsSLNode < T > & ); void removeNextItem (); // removes the item after this node T *pNext; + tsSLNode ( const tsSLNode < T > & ); + friend class tsSLList < T >; + friend class tsSLIter < T >; + friend class tsSLIterConst < T >; }; @@ -82,8 +82,11 @@ public: void push ( T &item ); // same as add T * first () const; void remove ( T &itemBefore ); + tsSLIterConst firstIter () const; + tsSLIter firstIter (); private: - tsSLList ( const tsSLList & ); // intentionally _not_ implemented + tsSLList ( const tsSLList & ); // dissallowed + const tsSLList < T > & operator = ( const tsSLList < T > & ) const; }; // @@ -92,37 +95,21 @@ private: template < class T > class tsSLIterConst { public: - tsSLIterConst ( const T *pInitialEntry ); - - tsSLIterConst & operator = ( const T *pNewEntry ); - - tsSLIterConst itemAfter (); - + bool valid () const; bool operator == (const tsSLIterConst &rhs) const; bool operator != (const tsSLIterConst &rhs) const; - const T & operator * () const; const T * operator -> () const; - - tsSLIterConst & operator ++ (); // prefix ++ - tsSLIterConst operator ++ (int); // postfix ++ - -# if defined(_MSC_VER) && _MSC_VER < 1200 - tsSLIterConst (const class tsSLIterConst ©In); -# endif - - bool valid () const; - - // - // end of the list constant - // - static const tsSLIterConst eol (); - + tsSLIterConst & operator ++ (); + tsSLIterConst operator ++ (int); + const T * pointer () const; protected: union { const T *pConstEntry; T *pEntry; }; + tsSLIterConst ( const T *pInitialEntry ); + friend class tsSLList < T >; }; // @@ -131,31 +118,17 @@ protected: template < class T > class tsSLIter : private tsSLIterConst { public: - tsSLIter ( T *pInitialEntry ); - - tsSLIter & operator = ( T *pNewEntry ); - - tsSLIter itemAfter (); - + bool valid () const; bool operator == (const tsSLIter &rhs) const; bool operator != (const tsSLIter &rhs) const; - T & operator * () const; T * operator -> () const; - - tsSLIter & operator ++ (); // prefix ++ - tsSLIter operator ++ (int); // postfix ++ - -# if defined(_MSC_VER) && _MSC_VER < 1200 - tsSLIter (class tsSLIter ©In); -# endif - - bool valid () const; - - // - // end of the list constant - // - static const tsSLIter eol (); + tsSLIter & operator ++ (); + tsSLIter operator ++ (int); + T * pointer () const; +private: + tsSLIter ( T *pInitialEntry ); + friend class tsSLList < T >; }; ////////////////////////////////////////// @@ -272,13 +245,27 @@ inline T * tsSLList < T > :: first () const } template -void tsSLList < T > :: remove ( T &itemBefore ) +inline void tsSLList < T > :: remove ( T &itemBefore ) { tsSLNode < T > *pBeforeNode = &itemBefore; tsSLNode < T > *pAfterNode = pBeforeNode->pNext; pBeforeNode->pNext = pAfterNode->pNext; } +template +inline tsSLIterConst tsSLList < T > :: firstIter () const +{ + const tsSLNode < T > *pThisNode = this; + return tsSLIterConst ( pThisNode->pNext ); +} + +template +inline tsSLIter tsSLList < T > :: firstIter () +{ + tsSLNode < T > *pThisNode = this; + return tsSLIter ( pThisNode->pNext ); +} + ////////////////////////////////////////// // // tsSLIterConst inline member functions @@ -292,17 +279,9 @@ inline tsSLIterConst::tsSLIterConst ( const T *pInitialEntry ) : } template < class T > -inline tsSLIterConst & tsSLIterConst::operator = ( const T *pNewEntry ) +inline bool tsSLIterConst::valid () const { - this->pConstEntry = pNewEntry; - return *this; -} - -template < class T > -inline tsSLIterConst tsSLIterConst::itemAfter () -{ - const tsSLNode < T > *pCurNode = this->pConstEntry; - return pCurNode->pNext; + return this->pConstEntry != 0; } template < class T > @@ -346,28 +325,10 @@ inline tsSLIterConst tsSLIterConst::operator ++ (int) // postfix ++ return tmp; } - -# if defined(_MSC_VER) && _MSC_VER < 1200 -template < class T > -inline tsSLIterConst::tsSLIterConst (const class tsSLIterConst ©In) : - pConstEntry ( copyIn.pConstEntry ) +template +inline const T * tsSLIterConst < T > :: pointer () const { -} -# endif - -template < class T > -inline bool tsSLIterConst::valid () const -{ - return this->pConstEntry ? true : false; -} - -// -// end of the list constant -// -template < class T > -inline const tsSLIterConst tsSLIterConst::eol () -{ - return 0; + return this->pConstEntry; } ////////////////////////////////////////// @@ -383,17 +344,9 @@ inline tsSLIter::tsSLIter ( T *pInitialEntry ) : } template < class T > -inline tsSLIter & tsSLIter::operator = ( T *pNewEntry ) +inline bool tsSLIter::valid () const { - tsSLIterConst::operator = ( pNewEntry ); - return *this; -} - -template < class T > -inline tsSLIter tsSLIter::itemAfter () -{ - tsSLNode < T > *pCurNode = this->pEntry; - return pCurNode->pNext; + return this->pEntry != 0; } template < class T > @@ -435,29 +388,10 @@ inline tsSLIter tsSLIter::operator ++ (int) // postfix ++ return tmp; } - -# if defined(_MSC_VER) && _MSC_VER < 1200 -template < class T > -inline tsSLIter::tsSLIter (const class tsSLIter ©In) : - tsSLIterConst ( copyIn ) +template +inline T * tsSLIter < T > :: pointer () const { + return this->pEntry; } -# endif - -template < class T > -inline bool tsSLIter::valid () const -{ - return this->pEntry ? true : false; -} - -// -// end of the list constant -// -template < class T > -inline const tsSLIter tsSLIter::eol () -{ - return 0; -} - #endif // tsSLListh diff --git a/src/libCom/fdmgr/fdManager.cpp b/src/libCom/fdmgr/fdManager.cpp index b8db1b8b1..0c1a202f2 100644 --- a/src/libCom/fdmgr/fdManager.cpp +++ b/src/libCom/fdmgr/fdManager.cpp @@ -163,7 +163,7 @@ epicsShareFunc void fdManager::process (double delay) minDelay = delay; } - tsDLIterBD iter (this->regList.first()); + tsDLIterBD < fdReg > iter = this->regList.firstIter (); while ( iter.valid () ) { FD_SET(iter->getFD(), &this->fdSets[iter->getType()]); ioPending = 1; @@ -216,7 +216,7 @@ epicsShareFunc void fdManager::process (double delay) // // Look for activity // - iter=this->regList.first(); + iter=this->regList.firstIter (); while ( iter.valid () ) { tsDLIterBD tmp = iter; tmp++; diff --git a/src/libCom/misc/ipAddrToAsciiAsynchronous.cpp b/src/libCom/misc/ipAddrToAsciiAsynchronous.cpp index ccf2adad2..5d7215a6c 100644 --- a/src/libCom/misc/ipAddrToAsciiAsynchronous.cpp +++ b/src/libCom/misc/ipAddrToAsciiAsynchronous.cpp @@ -97,9 +97,10 @@ void ipAddrToAsciiEngine::show ( unsigned level ) const printf ( "ipAddrToAsciiEngine at %p with %u requests pendingh\n", this, this->labor.count () ); if ( level > 0u ) { - tsDLIterConstBD < ipAddrToAsciiAsynchronous > pItem = this->labor.first (); + tsDLIterConstBD < ipAddrToAsciiAsynchronous > pItem = this->labor.firstIter (); while ( pItem.valid () ) { pItem->show ( level - 1u ); + pItem++; } printf ( "nextId = %u\n", this->nextId ); }