codaObject::pthreadDispatcher< C, R, T > Class Template Reference

Allows pthread_create() to dispatch to an object member function that takes a single argument, used internally. More...

#include <CodaObject.hxx>

List of all members.

Public Member Functions

 pthreadDispatcher (C *c, R(C::*mfp)(T), T mfArg)
 Constructor stores object pointer, member function pointer, member function arg.

Static Public Member Functions

static void * dispatchIt (void *pthreadArg)
 Static function given to pthread_create dispatches to member function.

Public Attributes

C * c
 Pointer to object of type C having the member function.
R(C::* mfp )(T)
 Pointer to member function of object of type C, return is of type R.
mfArg
 Member function arg is of type T.

Detailed Description

template<class C, typename R, typename T>
class codaObject::pthreadDispatcher< C, R, T >

Allows pthread_create() to dispatch to an object member function that takes a single argument, used internally.

Static function dispatchIt() is actually given to pthread_create(). The pthread_create() user arg is a pointer to this dispatcher object, which contains all info needed to dispatch correctly.

Definition at line 92 of file CodaObject.hxx.


Constructor & Destructor Documentation

template<class C, typename R, typename T>
codaObject::pthreadDispatcher< C, R, T >::pthreadDispatcher ( C *  c,
R(C::*)(T)  mfp,
mfArg 
) [inline]

Constructor stores object pointer, member function pointer, member function arg.

Parameters:
c Pointer to object
mfp Pointer to member function
mfArg Arg to give to member function when invoked

Definition at line 105 of file CodaObject.hxx.


Member Function Documentation

template<class C, typename R, typename T>
static void* codaObject::pthreadDispatcher< C, R, T >::dispatchIt ( void *  pthreadArg  )  [inline, static]

Static function given to pthread_create dispatches to member function.

Parameters:
pthreadArg Pointer to dispatcher object

Definition at line 113 of file CodaObject.hxx.


Member Data Documentation

template<class C, typename R, typename T>
C* codaObject::pthreadDispatcher< C, R, T >::c

Pointer to object of type C having the member function.

Definition at line 94 of file CodaObject.hxx.

Referenced by codaObject::pthreadDispatcher< SessionObject, void *, void * >::dispatchIt().

template<class C, typename R, typename T>
T codaObject::pthreadDispatcher< C, R, T >::mfArg

Member function arg is of type T.

Definition at line 96 of file CodaObject.hxx.

Referenced by codaObject::pthreadDispatcher< SessionObject, void *, void * >::dispatchIt().

template<class C, typename R, typename T>
R(C::* codaObject::pthreadDispatcher< C, R, T >::mfp)(T)

Pointer to member function of object of type C, return is of type R.

Referenced by codaObject::pthreadDispatcher< SessionObject, void *, void * >::dispatchIt().


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

Generated on 4 Feb 2014 for CodaObject by  doxygen 1.6.1