UNIVERS
15.3
UNIVERS base processing software API
|
#include <thread_calc_block.hpp>
Public Member Functions | |
ThreadCalcBlock (const dcf::Manager &manager) | |
virtual | ~ThreadCalcBlock () |
virtual void | start () |
virtual void | stop () |
virtual void | wait () |
int | id () const |
Public Member Functions inherited from dcf::CalcBlock | |
CalcBlock (const dcf::Manager &manager) | |
CalcBlock (const dcf::CalcBlock &cb) | |
virtual | ~CalcBlock () |
virtual bool | running () const |
const dcf::Manager * | manager () const |
dcf::error_t | resultCode () |
Protected Member Functions | |
virtual void | run () |
void | setStopPoint () |
void | setThreadStatus (dcf::error_t st) |
const dcf::error_t & | getThreadStatus () |
dcf::error_t | releaseUnit () |
Protected Attributes | |
bool | m_ready |
Protected Attributes inherited from dcf::CalcBlock | |
dcf::Manager * | m_manager |
dcf::error_t | m_result_code |
Thread calculations block.
dcf::ThreadCalcBlock::ThreadCalcBlock | ( | const dcf::Manager & | manager | ) |
Constructor. Only ThreadManager provides correct working.
|
virtual |
Destructor
|
protected |
Get thread calculation result status
|
inline |
Id of current thread.
|
protected |
Release allocated unit and define status as "not working"
|
protectedvirtual |
Main thread calculation method.
Default implementation sets Deferred type of cancelation. If developer decide to use in reimplemented run() method the functions, that are not safe for asynchronous cancelation, he should run default run() method in his reimplementaion, and then manually define (by means of setStopPoint() method) the points of code, where the cancelation can be applied.
Reimplemented from dcf::CalcBlock.
|
protected |
Can be used in run() method to define the time points,
where the thread can be forcibly canceled without negative consequences. For more information one should read about asynchronous cancellation and async-cancel-safe functions.
|
protected |
Set thread calculation result status
|
virtual |
Initialize thread and start calculations by executing exec() method
Reimplemented from dcf::CalcBlock.
|
virtual |
Send request for thread termination
Reimplemented from dcf::CalcBlock.
|
virtual |
Wait for thead work finishing (or thread termination)
Reimplemented from dcf::CalcBlock.
|
protected |
object status (=true if manager of correct type received)