#include <JobWait.h>

Inheritance diagram for JobWaitBase:
Collaboration diagram for JobWaitBase:

Public Member Functions

 JobWaitBase ()
 
 ~JobWaitBase ()
 
 JobWaitBase (JobWaitBase &&)=delete
 no copying of any kind: each waiting context needs a dedicated AsyncCall More...
 
 operator bool () const
 
bool waiting () const
 
void finish ()
 
void cancel (const char *reason)
 
void print (std::ostream &) const
 summarizes what we are waiting for (for debugging) More...
 

Protected Member Functions

void start_ (AsyncJob::Pointer, AsyncCall::Pointer)
 starts waiting for the given job to call the given callback More...
 

Private Member Functions

void clear ()
 the common part of finish() and cancel() More...
 

Private Attributes

AsyncJob::Pointer job_
 the job that we are waiting to call us back (or nil) More...
 
AsyncCall::Pointer callback_
 the call we are waiting for the job_ to make (or nil) More...
 

Detailed Description

Manages waiting for an AsyncJob callback. Use type-safe JobWait instead. This base class does not contain code specific to the actual Job type.

Definition at line 19 of file JobWait.h.

Constructor & Destructor Documentation

◆ JobWaitBase() [1/2]

JobWaitBase::JobWaitBase ( )
default

◆ ~JobWaitBase()

JobWaitBase::~JobWaitBase ( )

Definition at line 18 of file JobWait.cc.

References cancel().

◆ JobWaitBase() [2/2]

JobWaitBase::JobWaitBase ( JobWaitBase &&  )
delete

Member Function Documentation

◆ cancel()

void JobWaitBase::cancel ( const char *  reason)

aborts wait (if any) before receiving the call back does nothing if we are not waiting

Definition at line 54 of file JobWait.cc.

References callback_, CallJobHere, AsyncCall::cancel(), clear(), AsyncCall::debugLevel, AsyncCall::debugSection, and job_.

Referenced by ~JobWaitBase(), FwdState::cancelStep(), and TunnelStateData::cancelStep().

◆ clear()

void JobWaitBase::clear ( )
inlineprivate

Definition at line 51 of file JobWait.h.

References callback_, CbcPointer< Cbc >::clear(), and job_.

Referenced by cancel(), and finish().

◆ finish()

◆ operator bool()

JobWaitBase::operator bool ( ) const
inlineexplicit

Definition at line 28 of file JobWait.h.

References waiting().

◆ print()

void JobWaitBase::print ( std::ostream &  os) const

Definition at line 71 of file JobWait.cc.

References callback_, CbcPointer< Cbc >::get(), AsyncCall::id, and job_.

Referenced by operator<<().

◆ start_()

void JobWaitBase::start_ ( AsyncJob::Pointer  aJob,
AsyncCall::Pointer  aCall 
)
protected

◆ waiting()

bool JobWaitBase::waiting ( ) const
inline

whether we are currently waiting for the job to call us back the job itself may be gone even if this returns true

Definition at line 32 of file JobWait.h.

References callback_.

Referenced by finish(), JobWait< Job >::job(), operator bool(), and start_().

Member Data Documentation

◆ callback_

AsyncCall::Pointer JobWaitBase::callback_
private

Definition at line 57 of file JobWait.h.

Referenced by cancel(), clear(), print(), start_(), and waiting().

◆ job_

AsyncJob::Pointer JobWaitBase::job_
private

Definition at line 54 of file JobWait.h.

Referenced by cancel(), clear(), print(), and start_().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors