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 52 of file

Constructor & Destructor Documentation

◆ HappyOrderEnforcer()

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

Definition at line 56 of file

Member Function Documentation

◆ checkpoint()

void HappyOrderEnforcer::checkpoint ( )

Definition at line 171 of file

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

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

◆ dequeue()

◆ enqueue()

◆ noteWaitOver()

void HappyOrderEnforcer::noteWaitOver ( )

Definition at line 222 of file

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

Referenced by NoteWaitOver().

◆ NoteWaitOver()

void HappyOrderEnforcer::NoteWaitOver ( void *  raw)

Definition at line 215 of file

References assert, and noteWaitOver().

Referenced by startedWaiting().

◆ notify()

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

Implemented in SpareAllowanceGiver, and PrimeChanceGiver.

◆ readyNow()

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

Implemented in SpareAllowanceGiver, and PrimeChanceGiver.

Referenced by checkpoint().

◆ startedWaiting()

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

◆ waiting()

bool HappyOrderEnforcer::waiting ( ) const

Definition at line 73 of file

References waitEnd_.

Referenced by noteWaitOver(), and startedWaiting().

Member Data Documentation

◆ jobs_

HappySpareWaitList HappyOrderEnforcer::jobs_

Definition at line 80 of file

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

◆ name

const char* const HappyOrderEnforcer::name

Definition at line 67 of file

Referenced by startedWaiting().

◆ waitEnd_

HappyAbsoluteTime HappyOrderEnforcer::waitEnd_ = 0

Definition at line 81 of file

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

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






Web Site Translations