Inherits YGP::Thread.
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) | |
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.
| typedef void*(T::* YGP::OThread< T >::THREAD_OBJMEMBER)(void *) |
Declaration of type of callback.
| YGP::OThread< T >::~OThread | ( | ) | [inline] |
Destructor.
| YGP::OThread< T >::OThread | ( | T * | obj, | |
| THREAD_OBJMEMBER | fnc, | |||
| void * | pArgs, | |||
| bool | threadAsArg = false | |||
| ) | throw (YGP::ExecError) [inline, protected] |
Constructor.
| 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 |
| 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.
| obj | Object having a member to execute in a thread | |
| fnc | Member to execute as thread | |
| pArgs | Argument to the thread |
| 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.
| obj | Object having a member to execute in a thread | |
| fnc | Member to execute as thread | |
| pArgs | Argument to the thread |