Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Callback< R()> Class Template Reference
Templated function class. More...
#include <Callback.h>
Inherited by FunctionPointerArg1< R, void >.
Public Member Functions | |
| Callback (R(*func)()=0) | |
| Create a Callback with a static function. | |
| template<typename T > | |
| Callback (T *obj, R(*func)(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. | |
| Callback (const Callback< R()> &func) | |
| Create a Callback with another Callback. | |
| void | attach (R(*func)()) |
| Attach a static function. | |
| template<typename T > | |
| void | attach (T *obj, R(*func)(T *)) |
| Attach a static function with a bound pointer. | |
| template<typename T > | |
| void | attach (T *obj, R(T::*func)()) |
| Attach a member function. | |
| void | attach (const Callback< R()> &func) |
| Attach a Callback. | |
| R | call () |
| Call the attached function. | |
| R | operator() () |
| 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. | |
Detailed Description
template<typename R>
class mbed::Callback< R()>
Templated function class.
Definition at line 740 of file Callback.h.
Constructor & Destructor Documentation
| Callback | ( | R(*)() | func = 0 ) |
Create a Callback with a static function.
- Parameters:
-
func Static function to attach
Definition at line 745 of file Callback.h.
| Callback | ( | T * | obj, |
| R(*)(T *) | func | ||
| ) |
Create a Callback with a static function and bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
Definition at line 754 of file Callback.h.
| Callback | ( | T * | obj, |
| R(T::*)() | func | ||
| ) |
Create a Callback with a member function.
- Parameters:
-
obj Pointer to object to invoke member function on func Member function to attach
Definition at line 763 of file Callback.h.
| Callback | ( | const Callback< R()> & | func ) |
Create a Callback with another Callback.
- Parameters:
-
func Callback to attach
Definition at line 770 of file Callback.h.
Member Function Documentation
| void attach | ( | R(*)() | func ) |
Attach a static function.
- Parameters:
-
func Static function to attach
Definition at line 777 of file Callback.h.
| void attach | ( | T * | obj, |
| R(*)(T *) | func | ||
| ) |
Attach a static function with a bound pointer.
- Parameters:
-
obj Pointer to object to bind to function func Static function to attach
Definition at line 787 of file Callback.h.
| void attach | ( | const Callback< R()> & | func ) |
Attach a Callback.
- Parameters:
-
func The Callback to attach
Definition at line 807 of file Callback.h.
| void attach | ( | T * | obj, |
| R(T::*)() | func | ||
| ) |
Attach a member function.
- Parameters:
-
obj Pointer to object to invoke member function on func Member function to attach
Definition at line 798 of file Callback.h.
| R call | ( | ) |
Call the attached function.
Definition at line 815 of file Callback.h.
| operator bool | ( | ) | const |
Test if function has been attached.
Definition at line 830 of file Callback.h.
| R operator() | ( | ) |
Call the attached function.
Definition at line 824 of file Callback.h.
| static R thunk | ( | void * | func ) | [static] |
Static thunk for passing as C-style function.
- Parameters:
-
func Callback to call passed as void pointer
Definition at line 837 of file Callback.h.
Generated on Tue Jul 12 2022 19:20:57 by
1.7.2
