YGP::OThread< T > Class Template Reference

Class to execute a member-function in a thread. More...

Inherits YGP::Thread.

List of all members.

Public Types

typedef void *(T::* THREAD_OBJMEMBER )(void *)

Public Member Functions

 ~OThread ()

Static Public Member Functions

static OThread< T > * create (T *obj, THREAD_OBJMEMBER fnc, void *pArgs) throw (YGP::ExecError)
static OThread< T > * create2 (T *obj, THREAD_OBJMEMBER fnc, void *pArgs) throw (YGP::ExecError)

Protected Member Functions

 OThread (T *obj, THREAD_OBJMEMBER fnc, void *pArgs, bool threadAsArg=false) throw (YGP::ExecError)


Detailed Description

template<class T>
class YGP::OThread< T >

Class to execute a member-function in a thread.

There are two create-functions: The first calles the passed function with the parameters directly; the second passed a pointer to the created thread and enables to get the paramters with its getArgs-method. This enables controlling the thread.


Member Typedef Documentation

template<class T >
typedef void*(T::* YGP::OThread< T >::THREAD_OBJMEMBER)(void *)

Declaration of type of callback.


Constructor & Destructor Documentation

template<class T >
YGP::OThread< T >::~OThread (  )  [inline]

Destructor.

template<class T >
YGP::OThread< T >::OThread ( T *  obj,
THREAD_OBJMEMBER  fnc,
void *  pArgs,
bool  threadAsArg = false 
) throw (YGP::ExecError) [inline, protected]

Constructor.

Parameters:
obj Object having a member to execute in a thread
fnc Member to execute as thread
pArgs Argument to the thread
threadAsArg Flag, if the thread expects its argument directly


Member Function Documentation

template<class T >
static OThread<T>* YGP::OThread< T >::create ( T *  obj,
THREAD_OBJMEMBER  fnc,
void *  pArgs 
) throw (YGP::ExecError) [inline, static]

Creates a new thread; the argument is passed directly to the thread function.

Parameters:
obj Object having a member to execute in a thread
fnc Member to execute as thread
pArgs Argument to the thread

template<class T >
static OThread<T>* YGP::OThread< T >::create2 ( T *  obj,
THREAD_OBJMEMBER  fnc,
void *  pArgs 
) throw (YGP::ExecError) [inline, static]

Creates a new thread; a pointer to the thread is passed to the thread function.

Parameters:
obj Object having a member to execute in a thread
fnc Member to execute as thread
pArgs Argument to the thread


The documentation for this class was generated from the following file:

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:28 2009 by doxygen 1.5.8