dhgdh

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by joey shelton

Embed: (wiki syntax)

« Back to documentation index

Callback< R()> Class Template Reference

Callback< R()> Class Template Reference

Callback class based on template specialization. More...

#include <Callback.h>

Inherited by FunctionPointerArg1< R, void >.

Public Member Functions

 Callback (R(*func)()=0)
 Create a Callback with a static function.
 Callback (void *obj, R(*func)(void *))
 Create a Callback with a static function and bound pointer.
 Callback (const void *obj, R(*func)(const void *))
 Create a Callback with a static function and bound pointer.
 Callback (volatile void *obj, R(*func)(volatile void *))
 Create a Callback with a static function and bound pointer.
 Callback (const volatile void *obj, R(*func)(const volatile void *))
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (T *obj, R(*func)(T *))
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (const T *obj, R(*func)(const T *))
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (volatile T *obj, R(*func)(volatile T *))
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (const volatile T *obj, R(*func)(const volatile T *))
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (T *obj, R(T::*func)())
 Create a Callback with a member function.
template<typename T >
 Callback (const T *obj, R(T::*func)() const)
 Create a Callback with a member function.
template<typename T >
 Callback (volatile T *obj, R(T::*func)() volatile)
 Create a Callback with a member function.
template<typename T >
 Callback (const volatile T *obj, R(T::*func)() const volatile)
 Create a Callback with a member function.
void attach (R(*func)())
 Attach a static function.
void attach (const Callback< R()> &func)
 Attach a Callback.
void attach (void *obj, R(*func)(void *))
 Attach a static function with a bound pointer.
void attach (const void *obj, R(*func)(const void *))
 Attach a static function with a bound pointer.
void attach (volatile void *obj, R(*func)(volatile void *))
 Attach a static function with a bound pointer.
void attach (const volatile void *obj, R(*func)(const volatile void *))
 Attach a static function with a bound pointer.
template<typename T >
void attach (T *obj, R(*func)(T *))
 Attach a static function with a bound pointer.
template<typename T >
void attach (const T *obj, R(*func)(const T *))
 Attach a static function with a bound pointer.
template<typename T >
void attach (volatile T *obj, R(*func)(volatile T *))
 Attach a static function with a bound pointer.
template<typename T >
void attach (const volatile T *obj, R(*func)(const volatile T *))
 Attach a static function with a bound pointer.
template<typename T >
void attach (T *obj, R(T::*func)())
 Attach a member function.
template<typename T >
void attach (const T *obj, R(T::*func)() const)
 Attach a member function.
template<typename T >
void attach (volatile T *obj, R(T::*func)() volatile)
 Attach a member function.
template<typename T >
void attach (const volatile T *obj, R(T::*func)() const volatile)
 Attach a member function.
call () const
 Call the attached function.
operator() () const
 Call the attached function.
 operator bool () const
 Test if function has been attached.

Static Public Member Functions

static R thunk (void *func)
 Static thunk for passing as C-style function.

Friends

bool operator== (const Callback &l, const Callback &r)
 Test for equality.
bool operator!= (const Callback &l, const Callback &r)
 Test for inequality.

Detailed Description

template<typename R>
class mbed::Callback< R()>

Callback class based on template specialization.

Synchronization level: Not protected

Definition at line 38 of file Callback.h.


Constructor & Destructor Documentation

Callback ( R(*)()  func = 0 )

Create a Callback with a static function.

Parameters:
funcStatic function to attach

Definition at line 43 of file Callback.h.

Callback ( void *  obj,
R(*)(void *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 51 of file Callback.h.

Callback ( const void *  obj,
R(*)(const void *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 59 of file Callback.h.

Callback ( volatile void *  obj,
R(*)(volatile void *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 67 of file Callback.h.

Callback ( const volatile void *  obj,
R(*)(const volatile void *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 75 of file Callback.h.

Callback ( T *  obj,
R(*)(T *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 84 of file Callback.h.

Callback ( const T *  obj,
R(*)(const T *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 93 of file Callback.h.

Callback ( volatile T *  obj,
R(*)(volatile T *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 102 of file Callback.h.

Callback ( const volatile T *  obj,
R(*)(const volatile T *)  func 
)

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 111 of file Callback.h.

Callback ( T *  obj,
R(T::*)()  func 
)

Create a Callback with a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 120 of file Callback.h.

Callback ( const T *  obj,
R(T::*)() const   func 
)

Create a Callback with a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 129 of file Callback.h.

Callback ( volatile T *  obj,
R(T::*)() volatile  func 
)

Create a Callback with a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 138 of file Callback.h.

Callback ( const volatile T *  obj,
R(T::*)() const volatile  func 
)

Create a Callback with a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 147 of file Callback.h.


Member Function Documentation

void attach ( R(*)()  func )

Attach a static function.

Parameters:
funcStatic function to attach

Definition at line 154 of file Callback.h.

void attach ( const Callback< R()> &  func )

Attach a Callback.

Parameters:
funcThe Callback to attach

Definition at line 171 of file Callback.h.

void attach ( const void *  obj,
R(*)(const void *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 200 of file Callback.h.

void attach ( const T *  obj,
R(*)(const T *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 274 of file Callback.h.

void attach ( volatile T *  obj,
R(*)(volatile T *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 293 of file Callback.h.

void attach ( const volatile T *  obj,
R(T::*)() const volatile  func 
)

Attach a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 391 of file Callback.h.

void attach ( volatile T *  obj,
R(T::*)() volatile  func 
)

Attach a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 371 of file Callback.h.

void attach ( const T *  obj,
R(T::*)() const   func 
)

Attach a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 351 of file Callback.h.

void attach ( T *  obj,
R(T::*)()  func 
)

Attach a member function.

Parameters:
objPointer to object to invoke member function on
funcMember function to attach

Definition at line 331 of file Callback.h.

void attach ( volatile void *  obj,
R(*)(volatile void *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 218 of file Callback.h.

void attach ( const volatile T *  obj,
R(*)(const volatile T *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 312 of file Callback.h.

void attach ( void *  obj,
R(*)(void *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 182 of file Callback.h.

void attach ( T *  obj,
R(*)(T *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 255 of file Callback.h.

void attach ( const volatile void *  obj,
R(*)(const volatile void *)  func 
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach

Definition at line 236 of file Callback.h.

R call ( void   ) const

Call the attached function.

Definition at line 408 of file Callback.h.

operator bool ( void   ) const

Test if function has been attached.

Definition at line 421 of file Callback.h.

R operator() ( void   ) const

Call the attached function.

Definition at line 415 of file Callback.h.

static R thunk ( void *  func ) [static]

Static thunk for passing as C-style function.

Parameters:
funcCallback to call passed as void pointer

Definition at line 440 of file Callback.h.


Friends And Related Function Documentation

bool operator!= ( const Callback< R()> &  l,
const Callback< R()> &  r 
) [friend]

Test for inequality.

Definition at line 433 of file Callback.h.

bool operator== ( const Callback< R()> &  l,
const Callback< R()> &  r 
) [friend]

Test for equality.

Definition at line 427 of file Callback.h.