![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Represent state of asynchronous operation. More...
#include <CTaskState.h>
Inherits istd::IPolymorphic.
Public Types | |
using | Status = ITaskPromise::Status |
typedef std::function< void(CTaskState::Status)> | FinishedFn |
Public Member Functions | |
CTaskState (const CTaskState &)=delete | |
CTaskState () | |
CTaskState (CTaskState &&state) | |
CTaskState (CTaskState::Status state) | |
Constructs this object using some final state. | |
CTaskState (istd::TOptDelPtr< ITaskPromise > &&promisePtr) | |
Constructs this object using promise of doing some operation in the future. | |
~CTaskState () override | |
Destructor. | |
bool | IsFinished () const |
Check, if this operation is finished. | |
Status | GetStatus () const |
Get current state of operation. | |
void | CallAfterFinished (FinishedFn handler, bool futureOnly=false) |
Add handler will be called once after the operation is finished. | |
void | DoCancel () |
Cancel this operation. | |
CTaskState::Status | WaitForFinished (const double *periodPtr=nullptr, bool cancelOnTimeout=false) |
Wait for operation finished. | |
CTaskState & | operator= (const CTaskState &)=delete |
CTaskState & | operator= (CTaskState &&state) |
bool | operator== (Status status) const |
bool | operator!= (Status status) const |
Represent state of asynchronous operation.
This implementation is fully reentrant.
Definition at line 27 of file CTaskState.h.
std::function<void (CTaskState::Status)> iproc::CTaskState::FinishedFn |
Definition at line 31 of file CTaskState.h.
Definition at line 30 of file CTaskState.h.
|
delete |
iproc::CTaskState::CTaskState | ( | ) |
iproc::CTaskState::CTaskState | ( | CTaskState && | state | ) |
iproc::CTaskState::CTaskState | ( | CTaskState::Status | state | ) |
Constructs this object using some final state.
state | final state, it cannot be iproc::ITaskPromise::Running. |
iproc::CTaskState::CTaskState | ( | istd::TOptDelPtr< ITaskPromise > && | promisePtr | ) |
Constructs this object using promise of doing some operation in the future.
promisePtr | promise pointer object. |
|
override |
Destructor.
void iproc::CTaskState::CallAfterFinished | ( | FinishedFn | handler, |
bool | futureOnly = false ) |
Add handler will be called once after the operation is finished.
The handlers will be called in order of adding. Note: this handler call may be done after synchronization method WaitForFinished
is ready.
handler | function will be called after task is finished. |
futureOnly | if false and the opertion is already finished, the handler will be called. If it is true, than than the handler will be called only on the future finish. |
void iproc::CTaskState::DoCancel | ( | ) |
Cancel this operation.
Status iproc::CTaskState::GetStatus | ( | ) | const |
bool iproc::CTaskState::IsFinished | ( | ) | const |
Check, if this operation is finished.
|
inline |
Definition at line 143 of file CTaskState.h.
References GetStatus().
|
delete |
CTaskState & iproc::CTaskState::operator= | ( | CTaskState && | state | ) |
|
inline |
Definition at line 137 of file CTaskState.h.
References GetStatus().
CTaskState::Status iproc::CTaskState::WaitForFinished | ( | const double * | periodPtr = nullptr, |
bool | cancelOnTimeout = false ) |
Wait for operation finished.
periodPtr | optional waiting time in seconds. |
cancelOnTimeout | do cancel when timeout. |
© Witold Gantzke and Kirill Lepskiy