sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl > Class Template Reference

#include <ClassMethodThread.h>

Inheritance diagram for sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >:
Collaboration diagram for sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >:

List of all members.

Classes

struct  RunArgs

Public Types

typedef void *(T::* ThreadMethodPtr )(UserArgs *)
- Public Types inherited from sttcl::internal::SttclThread< ThreadImpl >

Public Member Functions

 ClassMethodThread (T *argInstance, ThreadMethodPtr argThreadMethod)
virtual ~ClassMethodThread ()
bool run (UserArgs *userArgs=0)
bool isRunning ()
void join ()
- Public Member Functions inherited from sttcl::internal::SttclThread< ThreadImpl >
 SttclThread (ThreadMethodPtr argThreadMethod)
 ~SttclThread ()
bool run (void *args)
void detach ()

Additional Inherited Members

- Static Public Member Functions inherited from sttcl::internal::SttclThread< ThreadImpl >
static bool isSelf (const ThreadImpl &otherThread)

Detailed Description

template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
class sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >

Represents a thread running a class member method of T.

Template Parameters:
TThe class providing the thread method.
UserArgsThe optional user arguments type passed to the thread method, the default is void.
Theoptional thread class implementation, the default is STTCL_DEFAULT_THREADIMPL.

Member Typedef Documentation

template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
typedef void*(T::* sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::ThreadMethodPtr)(UserArgs *)

Defines the method pointer signature used for the thread method.

Reimplemented from sttcl::internal::SttclThread< ThreadImpl >.


Constructor & Destructor Documentation

template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::ClassMethodThread ( T *  argInstance,
ThreadMethodPtr  argThreadMethod 
)
inline

Constructor for the ClassMethodThread class.

Parameters:
argInstanceThe instance providing the thread method.
argThreadMethodA function pointer for the thread method.
template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
virtual sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::~ClassMethodThread ( )
inlinevirtual

Destructor for the ClassMethodThread class.


Member Function Documentation

template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
bool sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::isRunning ( )
inline
template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
void sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::join ( )
inline

Waits blocking forever until the thread method exits.

Reimplemented from sttcl::internal::SttclThread< ThreadImpl >.

template<class T, class UserArgs = void, class ThreadImpl = STTCL_DEFAULT_THREADIMPL, class MutexImpl = STTCL_DEFAULT_MUTEXIMPL>
bool sttcl::ClassMethodThread< T, UserArgs, ThreadImpl, MutexImpl >::run ( UserArgs *  userArgs = 0)
inline

Runs the thread method within a separate thread.

Parameters:
userArgsArguments passed to the thread method.

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