cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | Protected Member Functions | List of all members
osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType > Struct Template Reference

#include <osaThreadAdapter.h>

Inheritance diagram for osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >:
osaCallBackBase< _objectType, _callBackReturnType(_objectType::*)(_userDataType), _userDataType >

Public Types

typedef osaCallBackBase
< _objectType,
_callBackReturnType(_objectType::*)(_userDataType),
_userDataType > 
BaseType
 
- Public Types inherited from osaCallBackBase< _objectType, _callBackReturnType(_objectType::*)(_userDataType), _userDataType >
typedef osaCallBackBase osaCallBackBaseType
 

Static Public Member Functions

static osaHeapCallBackCreate (_objectType *obj, _callBackReturnType(_objectType::*callBackFunction)(_userDataType), _userDataType userData)
 
static void * CallbackAndDestroy (_callBackArgumentType obj)
 

Protected Member Functions

 osaHeapCallBack (_objectType *obj, _callBackReturnType(_objectType::*callBackFunction)(_userDataType), _userDataType userData)
 

Additional Inherited Members

- Public Member Functions inherited from osaCallBackBase< _objectType, _callBackReturnType(_objectType::*)(_userDataType), _userDataType >
 osaCallBackBase (_objectType *obj, _callBackReturnType(_objectType::*)(_userDataType)callBackFunction, _userDataType userData)
 
- Public Attributes inherited from osaCallBackBase< _objectType, _callBackReturnType(_objectType::*)(_userDataType), _userDataType >
_objectType * Obj
 
_callBackReturnType(_objectType::*)(_userDataType) CallBackFunction
 
_userDataType UserData
 

Detailed Description

template<class _objectType, class _userDataType, class _callBackReturnType, class _callBackArgumentType>
struct osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >

Adapter for callback functions with one user defined argument and adapter instance created on the heap. The adapter instance is automatically destroyed with delete after processing the callback. This is used for CreateThread() R MyCallback( A1 arg1 ) is redirected to [virtual] R O::MyMemberCallback( U UserData ); PKAZ: Clean up the above comment.

Member Typedef Documentation

template<class _objectType , class _userDataType , class _callBackReturnType , class _callBackArgumentType >
typedef osaCallBackBase<_objectType, _callBackReturnType(_objectType::*)(_userDataType), _userDataType> osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::BaseType

Constructor & Destructor Documentation

template<class _objectType , class _userDataType , class _callBackReturnType , class _callBackArgumentType >
osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::osaHeapCallBack ( _objectType *  obj,
_callBackReturnType(_objectType::*)(_userDataType)  callBackFunction,
_userDataType  userData 
)
inlineprotected

Constructor is protected to prevent instances on the stack.

Member Function Documentation

template<class _objectType , class _userDataType , class _callBackReturnType , class _callBackArgumentType >
static void* osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::CallbackAndDestroy ( _callBackArgumentType  obj)
inlinestatic

The static function to be passed as the 'start routine' argument of functions such as pthread_create. We use the argument to the 'start routine' to send an object that packs the member function to be called, along with the receiver object and user data.

Parameters
objThis object must be of type _callBackArgumentType, which is the same as that of the 'start routine' prototype defined by the platform. g
Returns
The result of the callback method which must be of type _callBackReturnType type, which is the same as the return type of the 'start routine' defined by the platform.
template<class _objectType , class _userDataType , class _callBackReturnType , class _callBackArgumentType >
static osaHeapCallBack* osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::Create ( _objectType *  obj,
_callBackReturnType(_objectType::*)(_userDataType)  callBackFunction,
_userDataType  userData 
)
inlinestatic

Creates an object that can be passed as argument of the 'start routine'.


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