OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Threads::Work Class Reference

The abstraction of something that can be done. It can be an ordinary CallBack, a static function (must return bool) or a TaskFunction on a CallBackerinheriting class, or a Task. The three examples are shown below. More...

Public Member Functions

 Work ()
 
 Work (const CallBack &)
 
 Work (CallBacker *o, TaskFunction f)
 
 Work (StaticTaskFunction f)
 
 Work (Task &t, bool takeover)
 
bool operator== (const Work &) const
 
bool isOK () const
 
bool doRun ()
 

Protected Member Functions

void destroy ()
 

Protected Attributes

CallBackerobj_
 
CallBackFunction cbf_
 
TaskFunction tf_
 
StaticTaskFunction stf_
 
bool takeover_
 

Friends

class WorkThread
 
class WorkManager
 

Detailed Description

The abstraction of something that can be done. It can be an ordinary CallBack, a static function (must return bool) or a TaskFunction on a CallBackerinheriting class, or a Task. The three examples are shown below.

mExpClass(Basic) MyClass : public CallBacker
{
void normalCallBack(CallBacker*);
bool taskFunction();
static bool staticFunc();
};

Calls to normalCallBack and task functions can be invoked as:

Work(mCB(this,MyClass,normalCallBack) ) );

or

Threads::WorkManager::twm().addWork( mWMT(this,MyClass,taskFunction));

or

Threads::WorkManager::twm().addWork( Work( &MyClass::staticFunc) );

You can also add Tasks, with the option that they may be deleted when the work is done, or if there is an error.

Constructor & Destructor Documentation

Threads::Work::Work ( )
inline
Threads::Work::Work ( const CallBack cb)
inline
Threads::Work::Work ( CallBacker o,
TaskFunction  f 
)
inline
Threads::Work::Work ( StaticTaskFunction  f)
inline
Threads::Work::Work ( Task t,
bool  takeover 
)
inline

Member Function Documentation

void Threads::Work::destroy ( )
protected
bool Threads::Work::doRun ( )
inline
bool Threads::Work::isOK ( ) const
inline
bool Threads::Work::operator== ( const Work ) const

Friends And Related Function Documentation

friend class WorkManager
friend
friend class WorkThread
friend

Member Data Documentation

CallBackFunction Threads::Work::cbf_
protected
CallBacker* Threads::Work::obj_
protected
StaticTaskFunction Threads::Work::stf_
protected
bool Threads::Work::takeover_
protected
TaskFunction Threads::Work::tf_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019