ERC CISST - cisst software

mtsTaskFromCallbackAdapter Class Reference

#include <mtsTaskFromCallback.h>

Inheritance diagram for mtsTaskFromCallbackAdapter:

Inheritance graph
[legend]
Collaboration diagram for mtsTaskFromCallbackAdapter:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class provides a callback adapter that can be used for systems that accept a user-supplied 'void *' that gets passed to the user-supplied callback. This enables the standard trick of passing the "this" pointer to the callback function. To be safe, we put the "this" pointer in a data structure that has a magic number (signature) that we can test.

Definition at line 152 of file mtsTaskFromCallback.h.

Public Member Functions

Static Public Member Functions

Protected Types

Protected Attributes

Classes


Member Function Documentation

template<class _callbackReturnType>
_callbackReturnType mtsTaskFromCallbackAdapter::CallbackAdapter ( void *  obj  )  [static]

This is a callback function that can be used with the external package, assuming that the package accepts a user-supplied 'void *' as the first parameter. This parameter must be obtained by calling GetCallbackParameter.

Note:
The MTS_TASK_CALLBACK_CONVENTION is a hack to allow the calling convention to be specified (e.g., __stdcall) by defining this in the source code before including this header file. Perhaps there is a better way!

Definition at line 203 of file mtsTaskFromCallback.h.

References CMN_LOG_INIT_ERROR, mtsTaskFromCallback::DoCallback(), mtsTaskFromCallbackAdapter::CallbackData::obj, and mtsTaskFromCallbackAdapter::CallbackData::signature.

virtual void* mtsTaskFromCallbackAdapter::GetCallbackParameter (  )  [inline, virtual]

This returns a callback parameter (as a 'void *') that can be supplied to an external package as the user data for the callback. The external package should pass this back as the first parameter to the callback function.

Definition at line 192 of file mtsTaskFromCallback.h.

References mtsTaskFromCallbackAdapter::CallbackData::obj, and mtsTaskFromCallbackAdapter::CallbackData::signature.


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