ERC CISST - cisst software

osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType > Struct Template Reference
[OS Abstraction]

#include <osaThreadAdapter.h>

Inheritance diagram for osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >:

Inheritance graph
[legend]
Collaboration diagram for osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >:

Collaboration graph
[legend]
List of all members.

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.

Definition at line 86 of file osaThreadAdapter.h.

Public Types

Static Public Member Functions

Protected Member Functions


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 
) [inline, protected]

Constructor is protected to prevent instances on the stack.

Definition at line 132 of file osaThreadAdapter.h.

Referenced by osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::Create().


Member Function Documentation

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 
) [inline, static]

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

Definition at line 89 of file osaThreadAdapter.h.

References osaHeapCallBack< _objectType, _userDataType, _callBackReturnType, _callBackArgumentType >::osaHeapCallBack().

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

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:
obj This 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.

Definition at line 111 of file osaThreadAdapter.h.

References osaCallBackBase< _objectType, _callBackMethodType, _userDataType >::CallBackFunction, osaCallBackBase< _objectType, _callBackMethodType, _userDataType >::Obj, and osaCallBackBase< _objectType, _callBackMethodType, _userDataType >::UserData.


The documentation for this struct was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu