forked
Callback< R(A0, A1, A2, A3)> Class Template Reference
[Platform]
Callback class based on template specialization. More...
#include <Callback.h>
Public Member Functions | |
Callback (R(*func)(A0, A1, A2, A3)=0) | |
Create a Callback with a static function. | |
Callback (const Callback< R(A0, A1, A2, A3)> &func) | |
Attach a Callback. | |
template<typename T , typename U > | |
Callback (U *obj, R(T::*method)(A0, A1, A2, A3)) | |
Create a Callback with a member function. | |
template<typename T , typename U > | |
Callback (const U *obj, R(T::*method)(A0, A1, A2, A3) const) | |
Create a Callback with a member function. | |
template<typename T , typename U > | |
Callback (volatile U *obj, R(T::*method)(A0, A1, A2, A3) volatile) | |
Create a Callback with a member function. | |
template<typename T , typename U > | |
Callback (const volatile U *obj, R(T::*method)(A0, A1, A2, A3) const volatile) | |
Create a Callback with a member function. | |
template<typename T , typename U > | |
Callback (R(*func)(T *, A0, A1, A2, A3), U *arg) | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
Callback (R(*func)(const T *, A0, A1, A2, A3), const U *arg) | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
Callback (R(*func)(volatile T *, A0, A1, A2, A3), volatile U *arg) | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
Callback (R(*func)(const volatile T *, A0, A1, A2, A3), const volatile U *arg) | |
Create a Callback with a static function and bound pointer. | |
template<typename F > | |
Callback (F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3))) | |
Create a Callback with a function object. | |
template<typename F > | |
Callback (const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const)) | |
Create a Callback with a function object. | |
template<typename F > | |
Callback (volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) volatile)) | |
Create a Callback with a function object. | |
template<typename F > | |
Callback (const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const volatile)) | |
Create a Callback with a function object. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(U *obj | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const U *obj | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(volatile U *obj | |
Create a Callback with a static function and bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const volatile U *obj | |
Create a Callback with a static function and bound pointer. | |
~Callback () | |
Destroy a callback. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by simple assignment 'Callback cb = func") void attach(R(*func)(A0 | |
Attach a static function. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by simple assignment 'Callback cb = func") void attach(const U *obj | |
Attach a member function. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by simple assignment 'Callback cb = func") void attach(volatile U *obj | |
Attach a member function. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by simple assignment 'Callback cb = func") void attach(const volatile U *obj | |
Attach a member function. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by simple assignment 'Callback cb = func") void attach(R(*func)(T * | |
Attach a static function with a bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const U *obj | |
Attach a static function with a bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(volatile U *obj | |
Attach a static function with a bound pointer. | |
template<typename T , typename U > | |
MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const volatile U *obj | |
Attach a static function with a bound pointer. | |
Callback & | operator= (const Callback &that) |
Assign a callback. | |
R | call (A0 a0, A1 a1, A2 a2, A3 a3) const |
Call the attached function. | |
R | operator() (A0 a0, A1 a1, A2 a2, A3 a3) const |
Call the attached function. | |
operator bool () const | |
Test if function has been attached. | |
Static Public Member Functions | |
static R | thunk (void *func, A0 a0, A1 a1, A2 a2, A3 a3) |
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, typename A0, typename A1, typename A2, typename A3>
class mbed::Callback< R(A0, A1, A2, A3)>
Callback class based on template specialization.
- Note:
- Synchronization level: Not protected
Definition at line 2375 of file Callback.h.
Constructor & Destructor Documentation
Callback | ( | R(*)(A0, A1, A2, A3) | func = 0 ) |
Create a Callback with a static function.
- Parameters:
-
func Static function to attach
Definition at line 2380 of file Callback.h.
Callback | ( | const Callback< R(A0, A1, A2, A3)> & | func ) |
Attach a Callback.
- Parameters:
-
func The Callback to attach
Definition at line 2391 of file Callback.h.
Callback | ( | U * | obj, |
R(T::*)(A0, A1, A2, A3) | method | ||
) |
Create a Callback with a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
Definition at line 2403 of file Callback.h.
Callback | ( | const U * | obj, |
R(T::*)(A0, A1, A2, A3) const | method | ||
) |
Create a Callback with a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
Definition at line 2412 of file Callback.h.
Callback | ( | volatile U * | obj, |
R(T::*)(A0, A1, A2, A3) volatile | method | ||
) |
Create a Callback with a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
Definition at line 2421 of file Callback.h.
Callback | ( | const volatile U * | obj, |
R(T::*)(A0, A1, A2, A3) const volatile | method | ||
) |
Create a Callback with a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
Definition at line 2430 of file Callback.h.
Callback | ( | R(*)(T *, A0, A1, A2, A3) | func, |
U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
func Static function to attach arg Pointer argument to function
Definition at line 2439 of file Callback.h.
Callback | ( | R(*)(const T *, A0, A1, A2, A3) | func, |
const U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
func Static function to attach arg Pointer argument to function
Definition at line 2448 of file Callback.h.
Callback | ( | R(*)(volatile T *, A0, A1, A2, A3) | func, |
volatile U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
func Static function to attach arg Pointer argument to function
Definition at line 2457 of file Callback.h.
Callback | ( | R(*)(const volatile T *, A0, A1, A2, A3) | func, |
const volatile U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
func Static function to attach arg Pointer argument to function
Definition at line 2466 of file Callback.h.
Callback | ( | F | f, |
MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3)) | |||
) |
Create a Callback with a function object.
- Parameters:
-
f Function object to attach
- Note:
- The function object is limited to a single word of storage
Definition at line 2475 of file Callback.h.
Callback | ( | const F | f, |
MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const) | |||
) |
Create a Callback with a function object.
- Parameters:
-
f Function object to attach
- Note:
- The function object is limited to a single word of storage
Definition at line 2484 of file Callback.h.
Callback | ( | volatile F | f, |
MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) volatile) | |||
) |
Create a Callback with a function object.
- Parameters:
-
f Function object to attach
- Note:
- The function object is limited to a single word of storage
Definition at line 2493 of file Callback.h.
Callback | ( | const volatile F | f, |
MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const volatile) | |||
) |
Create a Callback with a function object.
- Parameters:
-
f Function object to attach
- Note:
- The function object is limited to a single word of storage
Definition at line 2502 of file Callback.h.
~Callback | ( | ) |
Destroy a callback.
Definition at line 2560 of file Callback.h.
Member Function Documentation
R call | ( | A0 | a0, |
A1 | a1, | ||
A2 | a2, | ||
A3 | a3 | ||
) | const |
Call the attached function.
Definition at line 2827 of file Callback.h.
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to Callback< R(A0, A1, A2, A3)>(func, arg)" | |||
) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to Callback< R(A0, A1, A2, A3)>(func, arg)" | |||
) | const |
Create a Callback with a static function and bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | ) | volatile |
Attach a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | ) | const volatile |
Attach a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to attach(func, arg)" | |||
) | volatile |
Attach a static function with a bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to attach(func, arg)" | |||
) | const volatile |
Attach a static function with a bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to Callback< R(A0, A1, A2, A3)>(func, arg)" | |||
) | const volatile |
Create a Callback with a static function and bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to attach(func, arg)" | |||
) | const |
Attach a static function with a bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | ) |
Attach a static function.
- Parameters:
-
func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | ) |
Attach a static function with a bound pointer.
- Parameters:
-
func Static function to attach arg Pointer argument to function
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.1" | , |
"Arguments to callback have been reordered to Callback< R(A0, A1, A2, A3)>(func, arg)" | |||
) | volatile |
Create a Callback with a static function and bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | ) | const |
Attach a member function.
- Parameters:
-
obj Pointer to object to invoke member function on method Member function to attach
operator bool | ( | ) | const |
Test if function has been attached.
Definition at line 2840 of file Callback.h.
R operator() | ( | A0 | a0, |
A1 | a1, | ||
A2 | a2, | ||
A3 | a3 | ||
) | const |
Call the attached function.
Definition at line 2834 of file Callback.h.
Callback& operator= | ( | const Callback< R(A0, A1, A2, A3)> & | that ) |
Assign a callback.
Definition at line 2816 of file Callback.h.
static R thunk | ( | void * | func, |
A0 | a0, | ||
A1 | a1, | ||
A2 | a2, | ||
A3 | a3 | ||
) | [static] |
Static thunk for passing as C-style function.
- Parameters:
-
func Callback to call passed as void pointer a0 An argument to be called with function func a1 An argument to be called with function func a2 An argument to be called with function func a3 An argument to be called with function func
- Returns:
- the value as determined by func which is of type and determined by the signiture of func
Definition at line 2865 of file Callback.h.
Friends And Related Function Documentation
bool operator!= | ( | const Callback< R(A0, A1, A2, A3)> & | l, |
const Callback< R(A0, A1, A2, A3)> & | r | ||
) | [friend] |
Test for inequality.
Definition at line 2852 of file Callback.h.
bool operator== | ( | const Callback< R(A0, A1, A2, A3)> & | l, |
const Callback< R(A0, A1, A2, A3)> & | r | ||
) | [friend] |
Test for equality.
Definition at line 2846 of file Callback.h.
Generated on Tue Jul 12 2022 16:02:35 by
![doxygen](doxygen.png)