Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Public Member Functions | Static Public Member Functions | Friends
Callback< R(A0, A1, A2, A3, A4)> Class Template Reference

Callback class based on template specialization. More...

#include <Callback.h>

Public Member Functions

 Callback (R(*func)(A0, A1, A2, A3, A4)=0)
 Create a Callback with a static function. More...
 
 Callback (const Callback< R(A0, A1, A2, A3, A4)> &func)
 Attach a Callback. More...
 
template<typename T , typename U >
 Callback (U *obj, R(T::*method)(A0, A1, A2, A3, A4))
 Create a Callback with a member function. More...
 
template<typename T , typename U >
 Callback (const U *obj, R(T::*method)(A0, A1, A2, A3, A4) const)
 Create a Callback with a member function. More...
 
template<typename T , typename U >
 Callback (volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile)
 Create a Callback with a member function. More...
 
template<typename T , typename U >
 Callback (const volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile)
 Create a Callback with a member function. More...
 
template<typename T , typename U >
 Callback (R(*func)(T *, A0, A1, A2, A3, A4), U *arg)
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (R(*func)(const T *, A0, A1, A2, A3, A4), const U *arg)
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (R(*func)(volatile T *, A0, A1, A2, A3, A4), volatile U *arg)
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (R(*func)(const volatile T *, A0, A1, A2, A3, A4), const volatile U *arg)
 Create a Callback with a static function and bound pointer. More...
 
template<typename F >
 Callback (F f,)
 Create a Callback with a function object. More...
 
template<typename F >
 Callback (const F f,)
 Create a Callback with a function object. More...
 
template<typename F >
 Callback (volatile F f,)
 Create a Callback with a function object. More...
 
template<typename F >
 Callback (const volatile F f,)
 Create a Callback with a function object. More...
 
template<typename T , typename U >
 Callback (U *obj, R(*func)(T *, A0, A1, A2, A3, A4))
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (const U *obj, R(*func)(const T *, A0, A1, A2, A3, A4))
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3, A4))
 Create a Callback with a static function and bound pointer. More...
 
template<typename T , typename U >
 Callback (const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3, A4))
 Create a Callback with a static function and bound pointer. More...
 
 ~Callback ()
 Destroy a callback. More...
 
void attach (R(*func)(A0, A1, A2, A3, A4))
 Attach a static function. More...
 
void attach (const Callback< R(A0, A1, A2, A3, A4)> &func)
 Attach a Callback. More...
 
template<typename T , typename U >
void attach (U *obj, R(T::*method)(A0, A1, A2, A3, A4))
 Attach a member function. More...
 
template<typename T , typename U >
void attach (const U *obj, R(T::*method)(A0, A1, A2, A3, A4) const)
 Attach a member function. More...
 
template<typename T , typename U >
void attach (volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile)
 Attach a member function. More...
 
template<typename T , typename U >
void attach (const volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile)
 Attach a member function. More...
 
template<typename T , typename U >
void attach (R(*func)(T *, A0, A1, A2, A3, A4), U *arg)
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (R(*func)(const T *, A0, A1, A2, A3, A4), const U *arg)
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (R(*func)(volatile T *, A0, A1, A2, A3, A4), volatile U *arg)
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (R(*func)(const volatile T *, A0, A1, A2, A3, A4), const volatile U *arg)
 Attach a static function with a bound pointer. More...
 
template<typename F >
void attach (F f,)
 Attach a function object. More...
 
template<typename F >
void attach (const F f,)
 Attach a function object. More...
 
template<typename F >
void attach (volatile F f,)
 Attach a function object. More...
 
template<typename F >
void attach (const volatile F f,)
 Attach a function object. More...
 
template<typename T , typename U >
void attach (U *obj, R(*func)(T *, A0, A1, A2, A3, A4))
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (const U *obj, R(*func)(const T *, A0, A1, A2, A3, A4))
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3, A4))
 Attach a static function with a bound pointer. More...
 
template<typename T , typename U >
void attach (const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3, A4))
 Attach a static function with a bound pointer. More...
 
Callbackoperator= (const Callback &that)
 Assign a callback. More...
 
call (A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const
 Call the attached function. More...
 
operator() (A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const
 Call the attached function. More...
 
 operator bool () const
 Test if function has been attached. More...
 

Static Public Member Functions

static R thunk (void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
 Static thunk for passing as C-style function. More...
 

Friends

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

Detailed Description

template<typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
class mbed::Callback< R(A0, A1, A2, A3, A4)>

Callback class based on template specialization.

Note
Synchronization level: Not protected

Definition at line 3213 of file Callback.h.

Constructor & Destructor Documentation

Callback ( R(*)(A0, A1, A2, A3, A4)  func = 0)

Create a Callback with a static function.

Parameters
funcStatic function to attach

Definition at line 3218 of file Callback.h.

Callback ( const Callback< R(A0, A1, A2, A3, A4)> &  func)

Attach a Callback.

Parameters
funcThe Callback to attach

Definition at line 3230 of file Callback.h.

Callback ( U *  obj,
R(T::*)(A0, A1, A2, A3, A4)  method 
)

Create a Callback with a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach

Definition at line 3244 of file Callback.h.

Callback ( const U *  obj,
R(T::*)(A0, A1, A2, A3, A4) const  method 
)

Create a Callback with a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach

Definition at line 3254 of file Callback.h.

Callback ( volatile U *  obj,
R(T::*)(A0, A1, A2, A3, A4) volatile  method 
)

Create a Callback with a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach

Definition at line 3264 of file Callback.h.

Callback ( const volatile U *  obj,
R(T::*)(A0, A1, A2, A3, A4) const volatile  method 
)

Create a Callback with a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach

Definition at line 3274 of file Callback.h.

Callback ( R(*)(T *, A0, A1, A2, A3, A4)  func,
U *  arg 
)

Create a Callback with a static function and bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function

Definition at line 3284 of file Callback.h.

Callback ( R(*)(const T *, A0, A1, A2, A3, A4)  func,
const U *  arg 
)

Create a Callback with a static function and bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function

Definition at line 3294 of file Callback.h.

Callback ( R(*)(volatile T *, A0, A1, A2, A3, A4)  func,
volatile U *  arg 
)

Create a Callback with a static function and bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function

Definition at line 3304 of file Callback.h.

Callback ( R(*)(const volatile T *, A0, A1, A2, A3, A4)  func,
const volatile U *  arg 
)

Create a Callback with a static function and bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function

Definition at line 3314 of file Callback.h.

Callback ( f)

Create a Callback with a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage

Definition at line 3324 of file Callback.h.

Callback ( const F  f)

Create a Callback with a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage

Definition at line 3334 of file Callback.h.

Callback ( volatile F  f)

Create a Callback with a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage

Definition at line 3344 of file Callback.h.

Callback ( const volatile F  f)

Create a Callback with a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage

Definition at line 3354 of file Callback.h.

Callback ( U *  obj,
R(*)(T *, A0, A1, A2, A3, A4)  func 
)

Create a Callback with a static function and bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to Callback(func, arg)

Definition at line 3368 of file Callback.h.

Callback ( const U *  obj,
R(*)(const T *, A0, A1, A2, A3, A4)  func 
)

Create a Callback with a static function and bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to Callback(func, arg)

Definition at line 3382 of file Callback.h.

Callback ( volatile U *  obj,
R(*)(volatile T *, A0, A1, A2, A3, A4)  func 
)

Create a Callback with a static function and bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to Callback(func, arg)

Definition at line 3396 of file Callback.h.

Callback ( const volatile U *  obj,
R(*)(const volatile T *, A0, A1, A2, A3, A4)  func 
)

Create a Callback with a static function and bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to Callback(func, arg)

Definition at line 3410 of file Callback.h.

~Callback ( )

Destroy a callback.

Definition at line 3417 of file Callback.h.

Member Function Documentation

void attach ( R(*)(A0, A1, A2, A3, A4)  func)

Attach a static function.

Parameters
funcStatic function to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3431 of file Callback.h.

void attach ( const Callback< R(A0, A1, A2, A3, A4)> &  func)

Attach a Callback.

Parameters
funcThe Callback to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3444 of file Callback.h.

void attach ( U *  obj,
R(T::*)(A0, A1, A2, A3, A4)  method 
)

Attach a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3459 of file Callback.h.

void attach ( const U *  obj,
R(T::*)(A0, A1, A2, A3, A4) const  method 
)

Attach a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3474 of file Callback.h.

void attach ( volatile U *  obj,
R(T::*)(A0, A1, A2, A3, A4) volatile  method 
)

Attach a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3489 of file Callback.h.

void attach ( const volatile U *  obj,
R(T::*)(A0, A1, A2, A3, A4) const volatile  method 
)

Attach a member function.

Parameters
objPointer to object to invoke member function on
methodMember function to attach
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3504 of file Callback.h.

void attach ( R(*)(T *, A0, A1, A2, A3, A4)  func,
U *  arg 
)

Attach a static function with a bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3519 of file Callback.h.

void attach ( R(*)(const T *, A0, A1, A2, A3, A4)  func,
const U *  arg 
)

Attach a static function with a bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3534 of file Callback.h.

void attach ( R(*)(volatile T *, A0, A1, A2, A3, A4)  func,
volatile U *  arg 
)

Attach a static function with a bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3549 of file Callback.h.

void attach ( R(*)(const volatile T *, A0, A1, A2, A3, A4)  func,
const volatile U *  arg 
)

Attach a static function with a bound pointer.

Parameters
funcStatic function to attach
argPointer argument to function
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3564 of file Callback.h.

void attach ( f)

Attach a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3579 of file Callback.h.

void attach ( const F  f)

Attach a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3594 of file Callback.h.

void attach ( volatile F  f)

Attach a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3609 of file Callback.h.

void attach ( const volatile F  f)

Attach a function object.

Parameters
fFunction object to attach
Note
The function object is limited to a single word of storage
Deprecated:
Replaced by simple assignment 'Callback cb = func'

Definition at line 3624 of file Callback.h.

void attach ( U *  obj,
R(*)(T *, A0, A1, A2, A3, A4)  func 
)

Attach a static function with a bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to attach(func, arg)

Definition at line 3639 of file Callback.h.

void attach ( const U *  obj,
R(*)(const T *, A0, A1, A2, A3, A4)  func 
)

Attach a static function with a bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to attach(func, arg)

Definition at line 3654 of file Callback.h.

void attach ( volatile U *  obj,
R(*)(volatile T *, A0, A1, A2, A3, A4)  func 
)

Attach a static function with a bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to attach(func, arg)

Definition at line 3669 of file Callback.h.

void attach ( const volatile U *  obj,
R(*)(const volatile T *, A0, A1, A2, A3, A4)  func 
)

Attach a static function with a bound pointer.

Parameters
objPointer to object to bind to function
funcStatic function to attach
Deprecated:
Arguments to callback have been reordered to attach(func, arg)

Definition at line 3684 of file Callback.h.

R call ( A0  a0,
A1  a1,
A2  a2,
A3  a3,
A4  a4 
) const

Call the attached function.

Definition at line 3704 of file Callback.h.

operator bool ( ) const

Test if function has been attached.

Definition at line 3719 of file Callback.h.

R operator() ( A0  a0,
A1  a1,
A2  a2,
A3  a3,
A4  a4 
) const

Call the attached function.

Definition at line 3712 of file Callback.h.

Callback& operator= ( const Callback< R(A0, A1, A2, A3, A4)> &  that)

Assign a callback.

Definition at line 3692 of file Callback.h.

static R thunk ( void *  func,
A0  a0,
A1  a1,
A2  a2,
A3  a3,
A4  a4 
)
static

Static thunk for passing as C-style function.

Parameters
funcCallback to call passed as void pointer
a0An argument to be called with function func
a1An argument to be called with function func
a2An argument to be called with function func
a3An argument to be called with function func
a4An argument to be called with function func
Returns
the value as determined by func which is of type and determined by the signature of func

Definition at line 3748 of file Callback.h.

Friends And Related Function Documentation

bool operator!= ( const Callback< R(A0, A1, A2, A3, A4)> &  l,
const Callback< R(A0, A1, A2, A3, A4)> &  r 
)
friend

Test for inequality.

Definition at line 3733 of file Callback.h.

bool operator== ( const Callback< R(A0, A1, A2, A3, A4)> &  l,
const Callback< R(A0, A1, A2, A3, A4)> &  r 
)
friend

Test for equality.

Definition at line 3726 of file Callback.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.