Changed URIBeaconConfigService.h to work with ST board

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

FunctionPointerWithContext< ContextType > Class Template Reference

FunctionPointerWithContext< ContextType > Class Template Reference

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

#include <FunctionPointerWithContext.h>

Public Member Functions

 FunctionPointerWithContext (void(*function)(ContextType context)=NULL)
 Create a FunctionPointerWithContext, attaching a static function.
template<typename T >
 FunctionPointerWithContext (T *object, void(T::*member)(ContextType context))
 Create a FunctionPointerWithContext, attaching a member function.
void attach (void(*function)(ContextType context)=NULL)
 Attach a static function.
template<typename T >
void attach (T *object, void(T::*member)(ContextType context))
 Attach a member function.
void call (ContextType context)
 Call the attached static or member function; and if there are chained FunctionPointers their callbacks are invoked as well.
void chainAsNext (pFunctionPointerWithContext_t next)
 Setup an external FunctionPointer as a next in the chain of related callbacks.

Detailed Description

template<typename ContextType>
class FunctionPointerWithContext< ContextType >

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

Definition at line 27 of file FunctionPointerWithContext.h.


Constructor & Destructor Documentation

FunctionPointerWithContext ( void(*)(ContextType context)  function = NULL )

Create a FunctionPointerWithContext, attaching a static function.

Parameters:
functionThe void static function to attach (default is none)

Definition at line 36 of file FunctionPointerWithContext.h.

FunctionPointerWithContext ( T *  object,
void(T::*)(ContextType context)  member 
)

Create a FunctionPointerWithContext, 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 47 of file FunctionPointerWithContext.h.


Member Function Documentation

void attach ( void(*)(ContextType context)  function = NULL )

Attach a static function.

Parameters:
functionThe void static function to attach (default is none)

Definition at line 56 of file FunctionPointerWithContext.h.

void attach ( T *  object,
void(T::*)(ContextType context)  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 66 of file FunctionPointerWithContext.h.

void call ( ContextType  context )

Call the attached static or member function; and if there are chained FunctionPointers their callbacks are invoked as well.

: all chained callbacks stack up; so hopefully there won't be too many FunctionPointers in a chain.

Definition at line 76 of file FunctionPointerWithContext.h.

void chainAsNext ( pFunctionPointerWithContext_t  next )

Setup an external FunctionPointer as a next in the chain of related callbacks.

Invoking call() on the head FunctionPointer will invoke all chained callbacks.

Refer to 'CallChain' as an alternative.

Definition at line 96 of file FunctionPointerWithContext.h.