#include <JobWait.h>
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.
Constructor & Destructor Documentation
◆ JobWaitBase() [1/2]
|
default |
◆ ~JobWaitBase()
JobWaitBase::~JobWaitBase | ( | ) |
Definition at line 18 of file JobWait.cc.
References cancel().
◆ JobWaitBase() [2/2]
|
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()
|
inlineprivate |
◆ finish()
void JobWaitBase::finish | ( | ) |
ends wait (after receiving the call back) forgets the job which is likely to be gone by now
Definition at line 44 of file JobWait.cc.
References assert, clear(), and waiting().
Referenced by FwdState::connectedToPeer(), PeerPoolMgr::handleOpenedConnection(), PeerPoolMgr::handleSecuredPeer(), FwdState::noteConnection(), TunnelStateData::noteConnection(), TunnelStateData::noteSecurityPeerConnectorAnswer(), FwdState::tunnelEstablishmentDone(), and TunnelStateData::tunnelEstablishmentDone().
◆ operator bool()
|
inlineexplicit |
◆ 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_()
|
protected |
Definition at line 24 of file JobWait.cc.
References assert, callback_, CbcPointer< Cbc >::get(), job_, AsyncJob::Start(), CbcPointer< Cbc >::valid(), and waiting().
Referenced by JobWait< Job >::start().
◆ waiting()
|
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_
|
private |
◆ job_
|
private |
The documentation for this class was generated from the following files:
- src/base/JobWait.h
- src/base/JobWait.cc