Inheritance diagram for HappyOrderEnforcer:
Collaboration diagram for HappyOrderEnforcer:

Public Member Functions

 HappyOrderEnforcer (const char *aName)
 
void checkpoint ()
 resumes jobs that need resuming (if any) More...
 
void enqueue (HappyConnOpener &)
 starts managing the job's wait; the job should expect a call back More...
 
void dequeue (HappyConnOpener &)
 stops managing the job's wait; cancels the pending callback, if any More...
 

Public Attributes

const char *const name
 waiting event name, for debugging More...
 

Protected Member Functions

virtual bool readyNow (const HappyConnOpener &) const =0
 
virtual AsyncCall::Pointer notify (const CbcPointer< HappyConnOpener > &)=0
 
bool waiting () const
 
bool startedWaiting (const HappyAbsoluteTime lastStart, const int cfgTimeoutMsec) const
 

Private Member Functions

void noteWaitOver ()
 

Static Private Member Functions

static void NoteWaitOver (void *raw)
 

Private Attributes

HappySpareWaitList jobs_
 queued jobs waiting their turn More...
 
HappyAbsoluteTime waitEnd_ = 0
 expected NoteWaitOver() call time (or zero) More...
 

Detailed Description

Efficiently drains a FIFO HappyConnOpener queue while delaying each "pop" event by the time determined by the top element currently in the queue. Its current cbdata-free implementation assumes static storage duration.

Definition at line 54 of file HappyConnOpener.cc.

Constructor & Destructor Documentation

◆ HappyOrderEnforcer()

HappyOrderEnforcer::HappyOrderEnforcer ( const char *  aName)
inline
Parameters
aNamenames scheduled events, for debugging

Definition at line 58 of file HappyConnOpener.cc.

Member Function Documentation

◆ checkpoint()

void HappyOrderEnforcer::checkpoint ( )

Definition at line 173 of file HappyConnOpener.cc.

References CallBack(), jobs_, and readyNow().

Referenced by SpareAllowanceGiver::forgetAllowance(), and noteWaitOver().

◆ dequeue()

◆ enqueue()

◆ noteWaitOver()

void HappyOrderEnforcer::noteWaitOver ( )
private

Definition at line 224 of file HappyConnOpener.cc.

References checkpoint(), Must, waitEnd_, and waiting().

Referenced by NoteWaitOver().

◆ NoteWaitOver()

void HappyOrderEnforcer::NoteWaitOver ( void *  raw)
staticprivate

Definition at line 217 of file HappyConnOpener.cc.

References assert, and noteWaitOver().

Referenced by startedWaiting().

◆ notify()

virtual AsyncCall::Pointer HappyOrderEnforcer::notify ( const CbcPointer< HappyConnOpener > &  )
protectedpure virtual

Implemented in PrimeChanceGiver, and SpareAllowanceGiver.

◆ readyNow()

virtual bool HappyOrderEnforcer::readyNow ( const HappyConnOpener ) const
protectedpure virtual

Implemented in PrimeChanceGiver, and SpareAllowanceGiver.

Referenced by checkpoint().

◆ startedWaiting()

bool HappyOrderEnforcer::startedWaiting ( const HappyAbsoluteTime  lastStart,
const int  cfgTimeoutMsec 
) const
protected

◆ waiting()

bool HappyOrderEnforcer::waiting ( ) const
inlineprotected

Definition at line 75 of file HappyConnOpener.cc.

References waitEnd_.

Referenced by noteWaitOver(), and startedWaiting().

Member Data Documentation

◆ jobs_

HappySpareWaitList HappyOrderEnforcer::jobs_
private

Definition at line 82 of file HappyConnOpener.cc.

Referenced by checkpoint(), dequeue(), and enqueue().

◆ name

const char* const HappyOrderEnforcer::name

Definition at line 69 of file HappyConnOpener.cc.

Referenced by startedWaiting().

◆ waitEnd_

HappyAbsoluteTime HappyOrderEnforcer::waitEnd_ = 0
mutableprivate

Definition at line 83 of file HappyConnOpener.cc.

Referenced by noteWaitOver(), startedWaiting(), and waiting().


The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors