Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format

Dependents:   NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more

Fork of mbed by mbed official

Embed: (wiki syntax)

« Back to documentation index

FunctionPointer Class Reference

FunctionPointer Class Reference

A class for storing and calling a pointer to a static or member void function. More...

#include <FunctionPointer.h>

Public Member Functions

 FunctionPointer (void(*function)(void)=0)
 Create a FunctionPointer, attaching a static function.
template<typename T >
 FunctionPointer (T *object, void(T::*member)(void))
 Create a FunctionPointer, attaching a member function.
void attach (void(*function)(void)=0)
 Attach a static function.
template<typename T >
void attach (T *object, void(T::*member)(void))
 Attach a member function.
void call ()
 Call the attached static or member function.

Detailed Description

A class for storing and calling a pointer to a static or member void function.

Definition at line 14 of file FunctionPointer.h.


Constructor & Destructor Documentation

FunctionPointer ( void(*)(void)  function = 0 )

Create a FunctionPointer, attaching a static function.

Parameters:
functionThe void static function to attach (default is none)
FunctionPointer ( T *  object,
void(T::*)(void)  member 
)

Create a FunctionPointer, attaching a member function.

Parameters:
objectThe object pointer to invoke the member function on (i.e. the this pointer)
functionThe address of the void member function to attach

Definition at line 30 of file FunctionPointer.h.


Member Function Documentation

void attach ( void(*)(void)  function = 0 )

Attach a static function.

Parameters:
functionThe void static function to attach (default is none)
void attach ( T *  object,
void(T::*)(void)  member 
)

Attach a member function.

Parameters:
objectThe object pointer to invoke the member function on (i.e. the this pointer)
functionThe address of the void member function to attach

Definition at line 46 of file FunctionPointer.h.

void call (  )

Call the attached static or member function.