#include <JobWait.h>
Public Types | |
typedef CbcPointer< Job > | JobPointer |
Public Member Functions | |
void | start (const JobPointer &aJob, const AsyncCall::Pointer &aCallback) |
starts waiting for the given job to call the given callback More... | |
JobPointer | job () const |
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 | |
JobPointer | typedJob_ |
nearly duplicates JobWaitBase::job_ but exposes the actual job type More... | |
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
class JobWait< Job >
Manages waiting for an AsyncJob callback. Completes JobWaitBase by providing Job type-specific members.
Member Typedef Documentation
◆ JobPointer
typedef CbcPointer<Job> JobWait< Job >::JobPointer |
Member Function Documentation
◆ cancel()
|
inherited |
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 JobWaitBase::callback_, CallJobHere, AsyncCall::cancel(), JobWaitBase::clear(), AsyncCall::debugLevel, AsyncCall::debugSection, and JobWaitBase::job_.
Referenced by JobWaitBase::~JobWaitBase(), FwdState::cancelStep(), and TunnelStateData::cancelStep().
◆ clear()
|
inlineprivateinherited |
Definition at line 51 of file JobWait.h.
References JobWaitBase::callback_, CbcPointer< Cbc >::clear(), and JobWaitBase::job_.
Referenced by JobWaitBase::cancel(), and JobWaitBase::finish().
◆ finish()
|
inherited |
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, JobWaitBase::clear(), and JobWaitBase::waiting().
Referenced by FwdState::connectedToPeer(), PeerPoolMgr::handleOpenedConnection(), PeerPoolMgr::handleSecuredPeer(), FwdState::noteConnection(), TunnelStateData::noteConnection(), TunnelStateData::noteSecurityPeerConnectorAnswer(), FwdState::tunnelEstablishmentDone(), and TunnelStateData::tunnelEstablishmentDone().
◆ job()
|
inline |
- Returns
- a cbdata pointer to the job we are waiting for (or nil) the returned pointer may be falsy, even if we are still waiting()
Definition at line 76 of file JobWait.h.
References JobWait< Job >::typedJob_, and JobWaitBase::waiting().
Referenced by FwdState::notifyConnOpener(), and TunnelStateData::notifyConnOpener().
◆ operator bool()
|
inlineexplicitinherited |
Definition at line 28 of file JobWait.h.
References JobWaitBase::waiting().
◆ print()
|
inherited |
Definition at line 71 of file JobWait.cc.
References JobWaitBase::callback_, CbcPointer< Cbc >::get(), AsyncCall::id, and JobWaitBase::job_.
Referenced by operator<<().
◆ start()
|
inline |
Definition at line 69 of file JobWait.h.
References JobWaitBase::start_(), and JobWait< Job >::typedJob_.
Referenced by FwdState::connectStart(), FwdState::establishTunnelThruProxy(), TunnelStateData::establishTunnelThruProxy(), PeerPoolMgr::handleOpenedConnection(), HappyConnOpener::openFreshConnection(), PeerPoolMgr::openNewConnection(), FwdState::secureConnectionToPeer(), TunnelStateData::secureConnectionToPeer(), Ident::Start(), and TunnelStateData::startConnecting().
◆ start_()
|
protectedinherited |
Definition at line 24 of file JobWait.cc.
References assert, JobWaitBase::callback_, CbcPointer< Cbc >::get(), JobWaitBase::job_, AsyncJob::Start(), CbcPointer< Cbc >::valid(), and JobWaitBase::waiting().
Referenced by JobWait< Job >::start().
◆ waiting()
|
inlineinherited |
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 JobWaitBase::callback_.
Referenced by JobWaitBase::finish(), JobWait< Job >::job(), JobWaitBase::operator bool(), and JobWaitBase::start_().
Member Data Documentation
◆ callback_
|
privateinherited |
Definition at line 57 of file JobWait.h.
Referenced by JobWaitBase::cancel(), JobWaitBase::clear(), JobWaitBase::print(), JobWaitBase::start_(), and JobWaitBase::waiting().
◆ job_
|
privateinherited |
Definition at line 54 of file JobWait.h.
Referenced by JobWaitBase::cancel(), JobWaitBase::clear(), JobWaitBase::print(), and JobWaitBase::start_().
◆ typedJob_
|
private |
Definition at line 80 of file JobWait.h.
Referenced by JobWait< Job >::job(), and JobWait< Job >::start().
The documentation for this class was generated from the following files: