changed tsDLIterBD to tsDLIter
This commit is contained in:
@@ -159,13 +159,13 @@ void CASG::show ( unsigned level ) const
|
||||
if ( level ) {
|
||||
epicsGuard < casgMutex > locker ( this->mutex );
|
||||
::printf ( "\tPending" );
|
||||
tsDLIterConstBD < syncGroupNotify > notifyPending = this->ioPendingList.firstIter ();
|
||||
tsDLIterConst < syncGroupNotify > notifyPending = this->ioPendingList.firstIter ();
|
||||
while ( notifyPending.valid () ) {
|
||||
notifyPending->show ( level - 1u );
|
||||
notifyPending++;
|
||||
}
|
||||
::printf ( "\tCompleted" );
|
||||
tsDLIterConstBD < syncGroupNotify > notifyCompleted = this->ioCompletedList.firstIter ();
|
||||
tsDLIterConst < syncGroupNotify > notifyCompleted = this->ioCompletedList.firstIter ();
|
||||
while ( notifyCompleted.valid () ) {
|
||||
notifyCompleted->show ( level - 1u );
|
||||
notifyCompleted++;
|
||||
|
||||
@@ -75,7 +75,7 @@ bhe::~bhe ()
|
||||
|
||||
void bhe::beaconAnomalyNotify ()
|
||||
{
|
||||
tsDLIterBD < tcpiiu > iter = this->iiuList.firstIter ();
|
||||
tsDLIter < tcpiiu > iter = this->iiuList.firstIter ();
|
||||
while ( iter.valid() ) {
|
||||
iter->beaconAnomalyNotify ();
|
||||
iter++;
|
||||
@@ -195,7 +195,7 @@ bool bhe::updatePeriod ( const epicsTime & programBeginTime,
|
||||
* update state of health for active virtual circuits
|
||||
* if the beacon looks ok
|
||||
*/
|
||||
tsDLIterBD < tcpiiu > iter = this->iiuList.firstIter ();
|
||||
tsDLIter < tcpiiu > iter = this->iiuList.firstIter ();
|
||||
while ( iter.valid() ) {
|
||||
iter->beaconArrivalNotify ();
|
||||
iter++;
|
||||
|
||||
@@ -991,10 +991,10 @@ void cac::ioExceptionNotifyAndDestroy ( unsigned id, int status,
|
||||
// (always called from a udp thread)
|
||||
void cac::connectAllIO ( epicsGuard < cacMutex > & guard, nciu & chan )
|
||||
{
|
||||
tsDLIterBD < baseNMIU > pNetIO =
|
||||
tsDLIter < baseNMIU > pNetIO =
|
||||
chan.cacPrivateListOfIO::eventq.firstIter ();
|
||||
while ( pNetIO.valid () ) {
|
||||
tsDLIterBD < baseNMIU > next = pNetIO;
|
||||
tsDLIter < baseNMIU > next = pNetIO;
|
||||
next++;
|
||||
class netSubscription *pSubscr = pNetIO->isSubscription ();
|
||||
// disconnected channels should have only subscription IO attached
|
||||
@@ -1014,9 +1014,9 @@ void cac::connectAllIO ( epicsGuard < cacMutex > & guard, nciu & chan )
|
||||
// -- callback lock and cac lock must be applied here
|
||||
void cac::disconnectAllIO ( epicsGuard < cacMutex > &locker, nciu & chan, bool enableCallbacks )
|
||||
{
|
||||
tsDLIterBD<baseNMIU> pNetIO = chan.cacPrivateListOfIO::eventq.firstIter();
|
||||
tsDLIter<baseNMIU> pNetIO = chan.cacPrivateListOfIO::eventq.firstIter();
|
||||
while ( pNetIO.valid() ) {
|
||||
tsDLIterBD<baseNMIU> pNext = pNetIO;
|
||||
tsDLIter<baseNMIU> pNext = pNetIO;
|
||||
pNext++;
|
||||
if ( ! pNetIO->isSubscription() ) {
|
||||
// no use after disconnected - so uninstall it
|
||||
|
||||
@@ -48,7 +48,7 @@ cacChannel * cacServiceList::createChannel (
|
||||
cacChannel *pChanIO = 0;
|
||||
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
tsDLIterBD < cacService > iter = this->services.firstIter ();
|
||||
tsDLIter < cacService > iter = this->services.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
pChanIO = iter->createChannel ( pName, chan, pri );
|
||||
if ( pChanIO ) {
|
||||
@@ -63,7 +63,7 @@ cacChannel * cacServiceList::createChannel (
|
||||
void cacServiceList::show ( unsigned level ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
tsDLIterConstBD < cacService > iter = this->services.firstIter ();
|
||||
tsDLIterConst < cacService > iter = this->services.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->show ( level );
|
||||
iter++;
|
||||
|
||||
@@ -98,14 +98,14 @@ void comQueSend::clear ()
|
||||
this->nBytesPending -= pBuf->occupiedBytes ();
|
||||
pBuf->destroy ();
|
||||
}
|
||||
this->pFirstUncommited = tsDLIterBD < comBuf > ();
|
||||
this->pFirstUncommited = tsDLIter < comBuf > ();
|
||||
assert ( this->nBytesPending == 0 );
|
||||
}
|
||||
|
||||
void comQueSend::clearUncommitted ()
|
||||
{
|
||||
while ( this->pFirstUncommited.valid() ) {
|
||||
tsDLIterBD < comBuf > next = this->pFirstUncommited;
|
||||
tsDLIter < comBuf > next = this->pFirstUncommited;
|
||||
next++;
|
||||
this->pFirstUncommited->clearUncommittedIncomming ();
|
||||
if ( this->pFirstUncommited->occupiedBytes() == 0u ) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
comBuf * popNextComBufToSend ();
|
||||
private:
|
||||
tsDLList < comBuf > bufs;
|
||||
tsDLIterBD < comBuf > pFirstUncommited;
|
||||
tsDLIter < comBuf > pFirstUncommited;
|
||||
wireSendAdapter & wire;
|
||||
unsigned nBytesPending;
|
||||
void copy_dbr_string ( const void *pValue, unsigned nElem );
|
||||
|
||||
@@ -415,7 +415,7 @@ static void register_new_client ( osiSockAddr &from )
|
||||
}
|
||||
}
|
||||
|
||||
tsDLIterBD < repeaterClient > pclient = client_list.firstIter ();
|
||||
tsDLIter < repeaterClient > pclient = client_list.firstIter ();
|
||||
while ( pclient.valid () ) {
|
||||
if ( pclient->identicalPort ( from ) ) {
|
||||
break;
|
||||
|
||||
@@ -701,7 +701,7 @@ void tcpiiu::show ( unsigned level ) const
|
||||
this->recvThread.show ( level-2u );
|
||||
::printf ("\techo pending bool = %u\n", this->echoRequestPending );
|
||||
::printf ( "IO identifier hash table:\n" );
|
||||
tsDLIterConstBD < nciu > pChan = this->channelList.firstIter ();
|
||||
tsDLIterConst < nciu > pChan = this->channelList.firstIter ();
|
||||
while ( pChan.valid () ) {
|
||||
pChan->show ( level - 2u );
|
||||
pChan++;
|
||||
|
||||
@@ -951,7 +951,7 @@ void udpiiu::show ( unsigned level ) const
|
||||
this->pSearchTmr->show ( level - 2u );
|
||||
::printf ( "repeater subscribee timer:\n" );
|
||||
this->pRepeaterSubscribeTmr->show ( level - 2u );
|
||||
tsDLIterConstBD < nciu > pChan = this->channelList.firstIter ();
|
||||
tsDLIterConst < nciu > pChan = this->channelList.firstIter ();
|
||||
while ( pChan.valid () ) {
|
||||
pChan->show ( level - 2u );
|
||||
pChan++;
|
||||
@@ -1003,7 +1003,7 @@ void udpiiu::beaconAnomalyNotify ()
|
||||
{
|
||||
epicsGuard <udpMutex> guard ( this->mutex );
|
||||
|
||||
tsDLIterBD < nciu > chan = this->channelList.firstIter ();
|
||||
tsDLIter < nciu > chan = this->channelList.firstIter ();
|
||||
while ( chan.valid () ) {
|
||||
chan->beaconAnomalyNotify ();
|
||||
chan++;
|
||||
|
||||
@@ -97,9 +97,9 @@ caServerI::~caServerI()
|
||||
//
|
||||
// delete all clients
|
||||
//
|
||||
tsDLIterBD <casStrmClient> iter = this->clientList.firstIter ();
|
||||
tsDLIter <casStrmClient> iter = this->clientList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
tsDLIterBD <casStrmClient> tmp = iter;
|
||||
tsDLIter <casStrmClient> tmp = iter;
|
||||
++tmp;
|
||||
//
|
||||
// destructor takes client out of list
|
||||
@@ -225,7 +225,7 @@ void caServerI::sendBeacon()
|
||||
//
|
||||
{
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
tsDLIterBD <casIntfOS> iter = this->intfList.firstIter ();
|
||||
tsDLIter <casIntfOS> iter = this->intfList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->sendBeacon ( this->beaconCounter );
|
||||
iter++;
|
||||
@@ -262,13 +262,13 @@ void caServerI::show (unsigned level) const
|
||||
|
||||
{
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
tsDLIterConstBD<casStrmClient> iterCl = this->clientList.firstIter ();
|
||||
tsDLIterConst<casStrmClient> iterCl = this->clientList.firstIter ();
|
||||
while ( iterCl.valid () ) {
|
||||
iterCl->show (level);
|
||||
++iterCl;
|
||||
}
|
||||
|
||||
tsDLIterConstBD<casIntfOS> iterIF = this->intfList.firstIter ();
|
||||
tsDLIterConst<casIntfOS> iterIF = this->intfList.firstIter ();
|
||||
while ( iterIF.valid () ) {
|
||||
iterIF->casIntfOS::show ( level );
|
||||
++iterIF;
|
||||
|
||||
@@ -46,12 +46,12 @@ casChannelI::~casChannelI()
|
||||
//
|
||||
// cancel any pending asynchronous IO
|
||||
//
|
||||
tsDLIterBD<casAsyncIOI> iterAIO = this->ioInProgList.firstIter ();
|
||||
tsDLIter<casAsyncIOI> iterAIO = this->ioInProgList.firstIter ();
|
||||
while ( iterAIO.valid () ) {
|
||||
//
|
||||
// destructor removes from this list
|
||||
//
|
||||
tsDLIterBD <casAsyncIOI> tmpAIO = iterAIO;
|
||||
tsDLIter <casAsyncIOI> tmpAIO = iterAIO;
|
||||
++tmpAIO;
|
||||
iterAIO->serverDestroy ();
|
||||
iterAIO = tmpAIO;
|
||||
@@ -60,12 +60,12 @@ casChannelI::~casChannelI()
|
||||
//
|
||||
// cancel the monitors
|
||||
//
|
||||
tsDLIterBD <casMonitor> iterMon = this->monitorList.firstIter ();
|
||||
tsDLIter <casMonitor> iterMon = this->monitorList.firstIter ();
|
||||
while ( iterMon.valid () ) {
|
||||
//
|
||||
// destructor removes from this list
|
||||
//
|
||||
tsDLIterBD <casMonitor> tmpMon = iterMon;
|
||||
tsDLIter <casMonitor> tmpMon = iterMon;
|
||||
++tmpMon;
|
||||
iterMon->destroy ();
|
||||
iterMon = tmpMon;
|
||||
@@ -91,12 +91,12 @@ void casChannelI::clearOutstandingReads()
|
||||
//
|
||||
// cancel any pending asynchronous IO
|
||||
//
|
||||
tsDLIterBD <casAsyncIOI> iterIO = this->ioInProgList.firstIter ();
|
||||
tsDLIter <casAsyncIOI> iterIO = this->ioInProgList.firstIter ();
|
||||
while ( iterIO.valid () ) {
|
||||
//
|
||||
// destructor removes from this list
|
||||
//
|
||||
tsDLIterBD<casAsyncIOI> tmp = iterIO;
|
||||
tsDLIter<casAsyncIOI> tmp = iterIO;
|
||||
++tmp;
|
||||
iterIO->serverDestroyIfReadOP();
|
||||
iterIO = tmp;
|
||||
@@ -112,7 +112,7 @@ void casChannelI::show ( unsigned level ) const
|
||||
{
|
||||
this->lock ();
|
||||
|
||||
tsDLIterConstBD <casMonitor> iter = this->monitorList.firstIter ();
|
||||
tsDLIterConst <casMonitor> iter = this->monitorList.firstIter ();
|
||||
if ( iter.valid () ) {
|
||||
printf("List of CA events (monitors) for \"%s\".\n",
|
||||
this->pv.getName());
|
||||
@@ -197,10 +197,10 @@ void casChannelI::destroyClientNotify ()
|
||||
// sane clients will require only one or two monitors
|
||||
// per channel)
|
||||
//
|
||||
tsDLIterBD <casMonitor> casChannelI::findMonitor (const caResId clientIdIn)
|
||||
tsDLIter <casMonitor> casChannelI::findMonitor (const caResId clientIdIn)
|
||||
{
|
||||
this->lock ();
|
||||
tsDLIterBD <casMonitor> iter = this->monitorList.firstIter ();
|
||||
tsDLIter <casMonitor> iter = this->monitorList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
if ( clientIdIn == iter->getClientId () ) {
|
||||
break;
|
||||
|
||||
@@ -45,7 +45,7 @@ inline void casChannelI::postEvent (const casEventMask &select, const gdd &event
|
||||
{
|
||||
this->lock();
|
||||
|
||||
tsDLIterBD<casMonitor> iter = this->monitorList.firstIter ();
|
||||
tsDLIter<casMonitor> iter = this->monitorList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->post (select, event);
|
||||
++iter;
|
||||
|
||||
@@ -44,7 +44,7 @@ casCoreClient::~casCoreClient()
|
||||
}
|
||||
|
||||
this->lock();
|
||||
tsDLIterBD<casAsyncIOI> iterIO = this->ioInProgList.firstIter ();
|
||||
tsDLIter<casAsyncIOI> iterIO = this->ioInProgList.firstIter ();
|
||||
|
||||
//
|
||||
// cancel any pending asynchronous IO
|
||||
@@ -53,7 +53,7 @@ casCoreClient::~casCoreClient()
|
||||
//
|
||||
// destructor removes from this list
|
||||
//
|
||||
tsDLIterBD <casAsyncIOI> tmpIO = iterIO;
|
||||
tsDLIter <casAsyncIOI> tmpIO = iterIO;
|
||||
++tmpIO;
|
||||
iterIO->serverDestroy ();
|
||||
iterIO = tmpIO;
|
||||
|
||||
@@ -312,7 +312,7 @@ public:
|
||||
// sane clients will require only one or two monitors
|
||||
// per channel)
|
||||
//
|
||||
tsDLIterBD <casMonitor> findMonitor (const caResId clientIdIn);
|
||||
tsDLIter <casMonitor> findMonitor (const caResId clientIdIn);
|
||||
|
||||
casPVI &getPVI () const
|
||||
{
|
||||
|
||||
@@ -53,9 +53,9 @@ casPVI::~casPVI()
|
||||
//
|
||||
// delete any attached channels
|
||||
//
|
||||
tsDLIterBD <casPVListChan> iter = this->chanList.firstIter ();
|
||||
tsDLIter <casPVListChan> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
tsDLIterBD<casPVListChan> tmp = iter;
|
||||
tsDLIter<casPVListChan> tmp = iter;
|
||||
++tmp;
|
||||
iter->destroyClientNotify ();
|
||||
iter = tmp;
|
||||
|
||||
@@ -122,7 +122,7 @@ inline void casPVI::postEvent (const casEventMask &select, const gdd &event)
|
||||
}
|
||||
|
||||
this->lock();
|
||||
tsDLIterBD<casPVListChan> iter = this->chanList.firstIter ();
|
||||
tsDLIter<casPVListChan> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->postEvent ( select, event );
|
||||
++iter;
|
||||
|
||||
@@ -73,12 +73,12 @@ casStrmClient::~casStrmClient()
|
||||
//
|
||||
// delete all channel attached
|
||||
//
|
||||
tsDLIterBD <casChannelI> iter = this->chanList.firstIter ();
|
||||
tsDLIter <casChannelI> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
//
|
||||
// destroying the channel removes it from the list
|
||||
//
|
||||
tsDLIterBD<casChannelI> tmp = iter;
|
||||
tsDLIter<casChannelI> tmp = iter;
|
||||
++tmp;
|
||||
iter->destroyNoClientNotify();
|
||||
iter = tmp;
|
||||
@@ -862,7 +862,7 @@ caStatus casStrmClient::hostNameAction()
|
||||
}
|
||||
this->pHostName = pMalloc;
|
||||
|
||||
tsDLIterBD <casChannelI> iter = this->chanList.firstIter ();
|
||||
tsDLIter <casChannelI> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->setOwner(this->pUserName, this->pHostName);
|
||||
++iter;
|
||||
@@ -910,7 +910,7 @@ caStatus casStrmClient::clientNameAction()
|
||||
}
|
||||
this->pUserName = pMalloc;
|
||||
|
||||
tsDLIterBD <casChannelI> iter = this->chanList.firstIter ();
|
||||
tsDLIter <casChannelI> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->setOwner ( this->pUserName, this->pHostName );
|
||||
++iter;
|
||||
@@ -1386,7 +1386,7 @@ caStatus casStrmClient::eventCancelAction ()
|
||||
/*
|
||||
* verify the event (monitor)
|
||||
*/
|
||||
tsDLIterBD <casMonitor> pMon = pciu->findMonitor ( mp->m_available );
|
||||
tsDLIter <casMonitor> pMon = pciu->findMonitor ( mp->m_available );
|
||||
if ( ! pMon.valid () ) {
|
||||
//
|
||||
// this indicates client or server library corruption so a
|
||||
@@ -1478,7 +1478,7 @@ caStatus casStrmClient::readSyncAction()
|
||||
// a read.
|
||||
//
|
||||
this->lock();
|
||||
tsDLIterBD <casChannelI> iter = this->chanList.firstIter ();
|
||||
tsDLIter <casChannelI> iter = this->chanList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->clearOutstandingReads ();
|
||||
++iter;
|
||||
|
||||
@@ -264,7 +264,7 @@ void dbServiceIO::ioShow ( const cacChannel::ioid &id, unsigned level ) const
|
||||
void dbServiceIO::showAllIO ( const dbChannelIO &chan, unsigned level ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
tsDLIterConstBD < dbSubscriptionIO > pItem =
|
||||
tsDLIterConst < dbSubscriptionIO > pItem =
|
||||
chan.dbServicePrivateListOfIO::eventq.firstIter ();
|
||||
while ( pItem.valid () ) {
|
||||
pItem->show ( level );
|
||||
|
||||
@@ -57,7 +57,6 @@ SRCS += epicsListBase.cpp
|
||||
SRC_DIRS += $(LIBCOM)/cxxTemplates
|
||||
INC += resourceLib.h
|
||||
INC += tsDLList.h
|
||||
INC += tsDLListDeprecated.h
|
||||
INC += tsSLList.h
|
||||
INC += tsMinMax.h
|
||||
INC += tsBTree.h
|
||||
|
||||
@@ -21,11 +21,8 @@
|
||||
#define tsDLListH_include
|
||||
|
||||
template <class T> class tsDLList;
|
||||
template <class T> class tsDLIterConstBD;
|
||||
template <class T> class tsDLIterBD;
|
||||
template <class T> class tsDLIter; // deprecated
|
||||
template <class T> class tsDLFwdIter; // deprecated
|
||||
template <class T> class tsDLBwdIter; // deprecated
|
||||
template <class T> class tsDLIterConst;
|
||||
template <class T> class tsDLIter;
|
||||
|
||||
//
|
||||
// class tsDLNode<T>
|
||||
@@ -40,14 +37,11 @@ public:
|
||||
tsDLNode ( const tsDLNode<T> & );
|
||||
const tsDLNode <T> & operator = ( const tsDLNode<T> & );
|
||||
private:
|
||||
T *pNext;
|
||||
T *pPrev;
|
||||
T * pNext;
|
||||
T * pPrev;
|
||||
friend class tsDLList<T>;
|
||||
friend class tsDLIterBD<T>;
|
||||
friend class tsDLIterConstBD<T>;
|
||||
friend class tsDLIter<T>; // deprecated
|
||||
friend class tsDLFwdIter<T>; // deprecated
|
||||
friend class tsDLBwdIter<T>; // deprecated
|
||||
friend class tsDLIter<T>;
|
||||
friend class tsDLIterConst<T>;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -72,12 +66,12 @@ public:
|
||||
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 <T> firstIter () const;
|
||||
tsDLIterBD <T> firstIter ();
|
||||
tsDLIterConstBD <T> lastIter () const;
|
||||
tsDLIterBD <T> lastIter ();
|
||||
static tsDLIterConstBD <T> invalidConstIter ();
|
||||
static tsDLIterBD <T> invalidIter ();
|
||||
tsDLIterConst <T> firstIter () const;
|
||||
tsDLIter <T> firstIter ();
|
||||
tsDLIterConst <T> lastIter () const;
|
||||
tsDLIter <T> lastIter ();
|
||||
static tsDLIterConst <T> invalidConstIter ();
|
||||
static tsDLIter <T> invalidIter ();
|
||||
private:
|
||||
T * pFirst;
|
||||
T * pLast;
|
||||
@@ -85,60 +79,57 @@ private:
|
||||
void clear ();
|
||||
tsDLList ( const tsDLList & ); // not allowed
|
||||
const tsDLList <T> & operator = ( const tsDLList <T> & ); // not allowed
|
||||
friend class tsDLIter<T>; // deprecated
|
||||
friend class tsDLFwdIter<T>; // deprecated
|
||||
friend class tsDLBwdIter<T>; // deprecated
|
||||
};
|
||||
|
||||
//
|
||||
// class tsDLIterConstBD<T>
|
||||
// class tsDLIterConst<T>
|
||||
//
|
||||
// bi-directional iterator for a const doubly linked list
|
||||
//
|
||||
template <class T>
|
||||
class tsDLIterConstBD {
|
||||
class tsDLIterConst {
|
||||
public:
|
||||
tsDLIterConstBD ();
|
||||
tsDLIterConst ();
|
||||
bool valid () const;
|
||||
bool operator == ( const tsDLIterConstBD<T> & rhs ) const;
|
||||
bool operator != ( const tsDLIterConstBD<T> & rhs ) const;
|
||||
tsDLIterConstBD<T> & operator = ( const tsDLIterConstBD<T> & );
|
||||
bool operator == ( const tsDLIterConst<T> & rhs ) const;
|
||||
bool operator != ( const tsDLIterConst<T> & rhs ) const;
|
||||
tsDLIterConst<T> & operator = ( const tsDLIterConst<T> & );
|
||||
const T & operator * () const;
|
||||
const T * operator -> () const;
|
||||
tsDLIterConstBD<T> & operator ++ ();
|
||||
tsDLIterConstBD<T> operator ++ (int);
|
||||
tsDLIterConstBD<T> & operator -- ();
|
||||
tsDLIterConstBD<T> operator -- (int);
|
||||
tsDLIterConst<T> & operator ++ ();
|
||||
tsDLIterConst<T> operator ++ (int);
|
||||
tsDLIterConst<T> & operator -- ();
|
||||
tsDLIterConst<T> operator -- (int);
|
||||
const T * pointer () const;
|
||||
private:
|
||||
const T * pEntry;
|
||||
tsDLIterConstBD ( const T * pInitialEntry );
|
||||
tsDLIterConst ( const T * pInitialEntry );
|
||||
friend class tsDLList <T>;
|
||||
};
|
||||
|
||||
//
|
||||
// class tsDLIterBD<T>
|
||||
// class tsDLIter<T>
|
||||
//
|
||||
// bi-directional iterator for a doubly linked list
|
||||
//
|
||||
template <class T>
|
||||
class tsDLIterBD {
|
||||
class tsDLIter {
|
||||
public:
|
||||
tsDLIterBD ();
|
||||
tsDLIter ();
|
||||
bool valid () const;
|
||||
bool operator == ( const tsDLIterBD<T> & rhs ) const;
|
||||
bool operator != ( const tsDLIterBD<T> & rhs ) const;
|
||||
tsDLIterBD<T> & operator = ( const tsDLIterBD<T> & );
|
||||
bool operator == ( const tsDLIter<T> & rhs ) const;
|
||||
bool operator != ( const tsDLIter<T> & rhs ) const;
|
||||
tsDLIter<T> & operator = ( const tsDLIter<T> & );
|
||||
T & operator * () const;
|
||||
T * operator -> () const;
|
||||
tsDLIterBD<T> & operator ++ ();
|
||||
tsDLIterBD<T> operator ++ ( int );
|
||||
tsDLIterBD<T> & operator -- ();
|
||||
tsDLIterBD<T> operator -- ( int );
|
||||
tsDLIter<T> & operator ++ ();
|
||||
tsDLIter<T> operator ++ ( int );
|
||||
tsDLIter<T> & operator -- ();
|
||||
tsDLIter<T> operator -- ( int );
|
||||
T * pointer () const;
|
||||
private:
|
||||
T * pEntry;
|
||||
tsDLIterBD ( T *pInitialEntry );
|
||||
tsDLIter ( T *pInitialEntry );
|
||||
friend class tsDLList <T>;
|
||||
};
|
||||
|
||||
@@ -410,8 +401,8 @@ inline void tsDLList<T>::push (T &item)
|
||||
template < class T >
|
||||
int tsDLList < T > :: find ( const T &item ) const
|
||||
{
|
||||
tsDLIterConstBD < T > thisItem ( &item );
|
||||
tsDLIterConstBD < T > iter ( this->first () );
|
||||
tsDLIterConst < T > thisItem ( &item );
|
||||
tsDLIterConst < T > iter ( this->first () );
|
||||
int itemNo = 0;
|
||||
|
||||
while ( iter.valid () ) {
|
||||
@@ -425,85 +416,85 @@ int tsDLList < T > :: find ( const T &item ) const
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterConstBD <T> tsDLList < T > :: firstIter () const
|
||||
inline tsDLIterConst <T> tsDLList < T > :: firstIter () const
|
||||
{
|
||||
return tsDLIterConstBD < T > ( this->pFirst );
|
||||
return tsDLIterConst < T > ( this->pFirst );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterBD <T> tsDLList < T > :: firstIter ()
|
||||
inline tsDLIter <T> tsDLList < T > :: firstIter ()
|
||||
{
|
||||
return tsDLIterBD < T > ( this->pFirst );
|
||||
return tsDLIter < T > ( this->pFirst );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterConstBD <T> tsDLList < T > :: lastIter () const
|
||||
inline tsDLIterConst <T> tsDLList < T > :: lastIter () const
|
||||
{
|
||||
return tsDLIterConstBD < T > ( this->pLast );
|
||||
return tsDLIterConst < T > ( this->pLast );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterBD <T> tsDLList < T > :: lastIter ()
|
||||
inline tsDLIter <T> tsDLList < T > :: lastIter ()
|
||||
{
|
||||
return tsDLIterBD < T > ( this->pLast );
|
||||
return tsDLIter < T > ( this->pLast );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterConstBD <T> tsDLList < T > :: invalidConstIter ()
|
||||
inline tsDLIterConst <T> tsDLList < T > :: invalidConstIter ()
|
||||
{
|
||||
return tsDLIterConstBD < T > ( 0 );
|
||||
return tsDLIterConst < T > ( 0 );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline tsDLIterBD <T> tsDLList < T > :: invalidIter ()
|
||||
inline tsDLIter <T> tsDLList < T > :: invalidIter ()
|
||||
{
|
||||
return tsDLIterBD < T > ( 0 );
|
||||
return tsDLIter < T > ( 0 );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////
|
||||
// tsDLIterConstBD<T> member functions
|
||||
// tsDLIterConst<T> member functions
|
||||
//////////////////////////////////////////
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T>::tsDLIterConstBD ( const T *pInitialEntry ) :
|
||||
inline tsDLIterConst<T>::tsDLIterConst ( const T *pInitialEntry ) :
|
||||
pEntry ( pInitialEntry ) {}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T>::tsDLIterConstBD () :
|
||||
inline tsDLIterConst<T>::tsDLIterConst () :
|
||||
pEntry ( 0 ) {}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterConstBD<T>::valid () const
|
||||
inline bool tsDLIterConst<T>::valid () const
|
||||
{
|
||||
return this->pEntry != 0;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterConstBD<T>::operator == (const tsDLIterConstBD<T> &rhs) const
|
||||
inline bool tsDLIterConst<T>::operator == (const tsDLIterConst<T> &rhs) const
|
||||
{
|
||||
return this->pEntry == rhs.pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterConstBD<T>::operator != (const tsDLIterConstBD<T> &rhs) const
|
||||
inline bool tsDLIterConst<T>::operator != (const tsDLIterConst<T> &rhs) const
|
||||
{
|
||||
return this->pEntry != rhs.pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator = ( const tsDLIterConstBD<T> & rhs )
|
||||
inline tsDLIterConst<T> & tsDLIterConst<T>::operator = ( const tsDLIterConst<T> & rhs )
|
||||
{
|
||||
this->pEntry = rhs.pEntry;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline const T & tsDLIterConstBD<T>::operator * () const
|
||||
inline const T & tsDLIterConst<T>::operator * () const
|
||||
{
|
||||
return *this->pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline const T * tsDLIterConstBD<T>::operator -> () const
|
||||
inline const T * tsDLIterConst<T>::operator -> () const
|
||||
{
|
||||
return this->pEntry;
|
||||
}
|
||||
@@ -512,7 +503,7 @@ inline const T * tsDLIterConstBD<T>::operator -> () const
|
||||
// prefix ++
|
||||
//
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator ++ ()
|
||||
inline tsDLIterConst<T> & tsDLIterConst<T>::operator ++ ()
|
||||
{
|
||||
const tsDLNode<T> &node = *this->pEntry;
|
||||
this->pEntry = node.pNext;
|
||||
@@ -523,9 +514,9 @@ inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator ++ ()
|
||||
// postfix ++
|
||||
//
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T> tsDLIterConstBD<T>::operator ++ (int)
|
||||
inline tsDLIterConst<T> tsDLIterConst<T>::operator ++ (int)
|
||||
{
|
||||
const tsDLIterConstBD<T> tmp = *this;
|
||||
const tsDLIterConst<T> tmp = *this;
|
||||
const tsDLNode<T> &node = *this->pEntry;
|
||||
this->pEntry = node.pNext;
|
||||
return tmp;
|
||||
@@ -535,7 +526,7 @@ inline tsDLIterConstBD<T> tsDLIterConstBD<T>::operator ++ (int)
|
||||
// prefix --
|
||||
//
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator -- ()
|
||||
inline tsDLIterConst<T> & tsDLIterConst<T>::operator -- ()
|
||||
{
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pPrev;
|
||||
@@ -546,71 +537,71 @@ inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator -- ()
|
||||
// postfix --
|
||||
//
|
||||
template <class T>
|
||||
inline tsDLIterConstBD<T> tsDLIterConstBD<T>::operator -- (int)
|
||||
inline tsDLIterConst<T> tsDLIterConst<T>::operator -- (int)
|
||||
{
|
||||
const tsDLIterConstBD<T> tmp = *this;
|
||||
const tsDLIterConst<T> tmp = *this;
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pPrev;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline const T * tsDLIterConstBD<T>::pointer () const
|
||||
inline const T * tsDLIterConst<T>::pointer () const
|
||||
{
|
||||
return this->pEntry;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////
|
||||
// tsDLIterBD<T> member functions
|
||||
// tsDLIter<T> member functions
|
||||
//////////////////////////////////////////
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T>::tsDLIterBD ( T * pInitialEntry ) :
|
||||
inline tsDLIter<T>::tsDLIter ( T * pInitialEntry ) :
|
||||
pEntry ( pInitialEntry ) {}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T>::tsDLIterBD () :
|
||||
inline tsDLIter<T>::tsDLIter () :
|
||||
pEntry ( 0 ) {}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterBD<T>::valid () const
|
||||
inline bool tsDLIter<T>::valid () const
|
||||
{
|
||||
return this->pEntry != 0;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterBD<T>::operator == (const tsDLIterBD<T> &rhs) const
|
||||
inline bool tsDLIter<T>::operator == (const tsDLIter<T> &rhs) const
|
||||
{
|
||||
return this->pEntry == rhs.pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline bool tsDLIterBD<T>::operator != (const tsDLIterBD<T> &rhs) const
|
||||
inline bool tsDLIter<T>::operator != (const tsDLIter<T> &rhs) const
|
||||
{
|
||||
return this->pEntry != rhs.pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T> & tsDLIterBD<T>::operator = ( const tsDLIterBD<T> & rhs )
|
||||
inline tsDLIter<T> & tsDLIter<T>::operator = ( const tsDLIter<T> & rhs )
|
||||
{
|
||||
this->pEntry = rhs.pEntry;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T & tsDLIterBD<T>::operator * () const
|
||||
inline T & tsDLIter<T>::operator * () const
|
||||
{
|
||||
return *this->pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T * tsDLIterBD<T>::operator -> () const
|
||||
inline T * tsDLIter<T>::operator -> () const
|
||||
{
|
||||
return this->pEntry;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T> & tsDLIterBD<T>::operator ++ () // prefix ++
|
||||
inline tsDLIter<T> & tsDLIter<T>::operator ++ () // prefix ++
|
||||
{
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pNext;
|
||||
@@ -618,16 +609,16 @@ inline tsDLIterBD<T> & tsDLIterBD<T>::operator ++ () // prefix ++
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T> tsDLIterBD<T>::operator ++ (int) // postfix ++
|
||||
inline tsDLIter<T> tsDLIter<T>::operator ++ (int) // postfix ++
|
||||
{
|
||||
const tsDLIterBD<T> tmp = *this;
|
||||
const tsDLIter<T> tmp = *this;
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pNext;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T> & tsDLIterBD<T>::operator -- () // prefix --
|
||||
inline tsDLIter<T> & tsDLIter<T>::operator -- () // prefix --
|
||||
{
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pPrev;
|
||||
@@ -635,21 +626,19 @@ inline tsDLIterBD<T> & tsDLIterBD<T>::operator -- () // prefix --
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline tsDLIterBD<T> tsDLIterBD<T>::operator -- (int) // postfix --
|
||||
inline tsDLIter<T> tsDLIter<T>::operator -- (int) // postfix --
|
||||
{
|
||||
const tsDLIterBD<T> tmp = *this;
|
||||
const tsDLIter<T> tmp = *this;
|
||||
const tsDLNode<T> &entryNode = *this->pEntry;
|
||||
this->pEntry = entryNode.pPrev;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T * tsDLIterBD<T>::pointer () const
|
||||
inline T * tsDLIter<T>::pointer () const
|
||||
{
|
||||
return this->pEntry;
|
||||
}
|
||||
|
||||
#include "tsDLListDeprecated.h"
|
||||
|
||||
#endif // tsDLListH_include
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ epicsShareFunc void fdManager::process (double delay)
|
||||
minDelay = delay;
|
||||
}
|
||||
|
||||
tsDLIterBD < fdReg > iter = this->regList.firstIter ();
|
||||
tsDLIter < fdReg > iter = this->regList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
FD_SET(iter->getFD(), &this->fdSets[iter->getType()]);
|
||||
ioPending = 1;
|
||||
@@ -165,7 +165,7 @@ epicsShareFunc void fdManager::process (double delay)
|
||||
//
|
||||
iter=this->regList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
tsDLIterBD<fdReg> tmp = iter;
|
||||
tsDLIter<fdReg> tmp = iter;
|
||||
tmp++;
|
||||
if (FD_ISSET(iter->getFD(), &this->fdSets[iter->getType()])) {
|
||||
FD_CLR(iter->getFD(), &this->fdSets[iter->getType()]);
|
||||
|
||||
@@ -122,7 +122,7 @@ void ipAddrToAsciiEngine::show ( unsigned level ) const
|
||||
printf ( "ipAddrToAsciiEngine at %p with %u requests pending\n",
|
||||
static_cast <const void *> (this), this->labor.count () );
|
||||
if ( level > 0u ) {
|
||||
tsDLIterConstBD < ipAddrToAsciiAsynchronous > pItem = this->labor.firstIter ();
|
||||
tsDLIterConst < ipAddrToAsciiAsynchronous > pItem = this->labor.firstIter ();
|
||||
while ( pItem.valid () ) {
|
||||
pItem->show ( level - 1u );
|
||||
pItem++;
|
||||
|
||||
@@ -80,7 +80,7 @@ void timer::privateStart ( epicsTimerNotify & notify, const epicsTime & expire )
|
||||
//
|
||||
// **** this should use a binary tree ????
|
||||
//
|
||||
tsDLIterBD < timer > pTmr = this->queue.timerList.lastIter ();
|
||||
tsDLIter < timer > pTmr = this->queue.timerList.lastIter ();
|
||||
while ( true ) {
|
||||
if ( ! pTmr.valid () ) {
|
||||
//
|
||||
|
||||
@@ -167,7 +167,7 @@ void timerQueue::show ( unsigned level ) const
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
printf ( "epicsTimerQueue with %u items pending\n", this->timerList.count () );
|
||||
if ( level >= 1u ) {
|
||||
tsDLIterConstBD < timer > iter = this->timerList.firstIter ();
|
||||
tsDLIterConst < timer > iter = this->timerList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
iter->show ( level - 1u );
|
||||
++iter;
|
||||
|
||||
@@ -35,7 +35,7 @@ epicsTimerQueueActiveForC & timerQueueActiveMgr::allocate (
|
||||
{
|
||||
epicsGuard < epicsMutex > locker ( this->mutex );
|
||||
if ( okToShare ) {
|
||||
tsDLIterBD < epicsTimerQueueActiveForC > iter = this->sharedQueueList.firstIter ();
|
||||
tsDLIter < epicsTimerQueueActiveForC > iter = this->sharedQueueList.firstIter ();
|
||||
while ( iter.valid () ) {
|
||||
if ( iter->threadPriority () == threadPriority ) {
|
||||
assert ( iter->timerQueueActiveMgrPrivate::referenceCount < UINT_MAX );
|
||||
|
||||
Reference in New Issue
Block a user