#include "searchTimer.h"
|
| searchTimer (class searchTimerNotify &, epicsTimerQueue &, const unsigned index, epicsMutex &, bool boostPossible) |
|
virtual | ~searchTimer () |
|
void | start (epicsGuard< epicsMutex > &) |
|
void | shutdown (epicsGuard< epicsMutex > &cbGuard, epicsGuard< epicsMutex > &guard) |
|
void | moveChannels (epicsGuard< epicsMutex > &, searchTimer &dest) |
|
void | installChannel (epicsGuard< epicsMutex > &, nciu &) |
|
void | uninstallChan (epicsGuard< epicsMutex > &, nciu &) |
|
void | uninstallChanDueToSuccessfulSearchResponse (epicsGuard< epicsMutex > &, nciu &, ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid, const epicsTime ¤tTime) |
|
void | show (unsigned level) const |
|
Definition at line 52 of file searchTimer.h.
searchTimer::searchTimer |
( |
class searchTimerNotify & |
iiuIn, |
|
|
epicsTimerQueue & |
queueIn, |
|
|
const unsigned |
index, |
|
|
epicsMutex & |
mutexIn, |
|
|
bool |
boostPossible |
|
) |
| |
Definition at line 38 of file searchTimer.cpp.
44 timeAtLastSend ( epicsTime::getCurrent () ),
45 timer ( queueIn.createTimer () ),
48 framesPerTry ( initialTriesPerFrame ),
49 framesPerTryCongestThresh ( DBL_MAX ),
51 searchAttempts ( 0u ),
52 searchResponses ( 0u ),
54 dgSeqNoAtTimerExpireBegin ( 0u ),
55 dgSeqNoAtTimerExpireEnd ( 0u ),
56 boostPossible ( boostPossibleIn ),
searchTimer::~searchTimer |
( |
| ) |
|
|
virtual |
Definition at line 67 of file searchTimer.cpp.
#define assert(exp)
Declare that a condition should be true.
void searchTimer::installChannel |
( |
epicsGuard< epicsMutex > & |
guard, |
|
|
nciu & |
chan |
|
) |
| |
Definition at line 99 of file searchTimer.cpp.
102 this->chanListReqPending.
add ( chan );
103 chan.channelNode::setReqPendingState ( guard, this->index );
Definition at line 106 of file searchTimer.cpp.
109 while (
nciu * pChan = this->chanListRespPending.
get () ) {
110 if ( this->searchAttempts > 0 ) {
111 this->searchAttempts--;
115 while (
nciu * pChan = this->chanListReqPending.
get () ) {
void installChannel(epicsGuard< epicsMutex > &, nciu &)
void searchTimer::show |
( |
unsigned |
level | ) |
const |
Definition at line 289 of file searchTimer.cpp.
292 ::printf (
"searchTimer with period %f\n", this->period ( guard ) );
294 ::printf (
"channels with search request pending = %u\n",
295 this->chanListReqPending.
count () );
299 while ( pChan.
valid () ) {
300 pChan->
show ( level - 2u );
304 ::printf (
"channels with search response pending = %u\n",
305 this->chanListRespPending.
count () );
309 while ( pChan.
valid () ) {
310 pChan->
show ( level - 2u );
tsDLIterConst< T > firstIter() const
void show(unsigned level) const
Definition at line 74 of file searchTimer.cpp.
87 while (
nciu * pChan = this->chanListReqPending.
get () ) {
88 pChan->channelNode::listMember =
90 pChan->serviceShutdownNotify ( cbGuard, guard );
92 while (
nciu * pChan = this->chanListRespPending.
get () ) {
93 pChan->channelNode::listMember =
95 pChan->serviceShutdownNotify ( cbGuard, guard );
void searchTimer::start |
( |
epicsGuard< epicsMutex > & |
guard | ) |
|
Definition at line 61 of file searchTimer.cpp.
64 this->
timer.
start ( *
this, this->period ( guard ) );
void assertIdenticalMutex(const T &) const
void start(class epicsTimerNotify &, const epicsTime &)
void searchTimer::uninstallChan |
( |
epicsGuard< epicsMutex > & |
cacGuard, |
|
|
nciu & |
chan |
|
) |
| |
Definition at line 363 of file searchTimer.cpp.
368 static_cast <
unsigned> ( chan.channelNode::listMember );
370 static_cast <
unsigned> ( channelNode::cs_searchReqPending0 );
371 if ( ulistmem == this->index + uReqBase ) {
372 this->chanListReqPending.
remove ( chan );
376 static_cast <
unsigned > (
377 channelNode::cs_searchRespPending0 );
378 if ( ulistmem == this->index + uRespBase ) {
379 this->chanListRespPending.
remove ( chan );
382 throw std::runtime_error (
383 "uninstalling channel search timer, but channel " 387 chan.channelNode::listMember = channelNode::cs_none;
void assertIdenticalMutex(const T &) const
void searchTimer::uninstallChanDueToSuccessfulSearchResponse |
( |
epicsGuard< epicsMutex > & |
guard, |
|
|
nciu & |
chan, |
|
|
ca_uint32_t |
respDatagramSeqNo, |
|
|
bool |
seqNumberIsValid, |
|
|
const epicsTime & |
currentTime |
|
) |
| |
Definition at line 322 of file searchTimer.cpp.
330 if ( this->stopped ) {
334 bool validResponse =
true;
335 if ( seqNumberIsValid ) {
337 this->dgSeqNoAtTimerExpireBegin <= respDatagramSeqNo &&
338 this->dgSeqNoAtTimerExpireEnd >= respDatagramSeqNo;
343 if ( validResponse ) {
344 double measured =
currentTime - this->timeAtLastSend;
347 if ( this->searchResponses < UINT_MAX ) {
348 this->searchResponses++;
349 if ( this->searchResponses == this->searchAttempts ) {
350 if ( this->chanListReqPending.
count () ) {
355 debugPrintf ( (
"All requests succesful, set timer delay to zero\n" ) );
void assertIdenticalMutex(const T &) const
void uninstallChan(epicsGuard< epicsMutex > &, nciu &)
#define debugPrintf(argsInParen)
void start(class epicsTimerNotify &, const epicsTime &)
virtual void updateRTTE(epicsGuard< epicsMutex > &, double rtte)=0
The documentation for this class was generated from the following files: