mbed source development branch

Fork of mbed-dev by mbed official

Embed: (wiki syntax)

« Back to documentation index

Callback< R(A0, A1, A2, A3)> Class Template Reference

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 >
 Callback (T *obj, R(T::*method)(A0, A1, A2, A3))
 Create a Callback with a member function.
template<typename T >
 Callback (const T *obj, R(T::*method)(A0, A1, A2, A3) const)
 Create a Callback with a member function.
template<typename T >
 Callback (volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile)
 Create a Callback with a member function.
template<typename T >
 Callback (const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile)
 Create a Callback with a member function.
 Callback (R(*func)(void *, A0, A1, A2, A3), void *arg)
 Create a Callback with a static function and bound pointer.
 Callback (R(*func)(const void *, A0, A1, A2, A3), const void *arg)
 Create a Callback with a static function and bound pointer.
 Callback (R(*func)(volatile void *, A0, A1, A2, A3), volatile void *arg)
 Create a Callback with a static function and bound pointer.
 Callback (R(*func)(const volatile void *, A0, A1, A2, A3), const volatile void *arg)
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (R(*func)(T *, A0, A1, A2, A3), T *arg)
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (R(*func)(const T *, A0, A1, A2, A3), const T *arg)
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (R(*func)(volatile T *, A0, A1, A2, A3), volatile T *arg)
 Create a Callback with a static function and bound pointer.
template<typename T >
 Callback (R(*func)(const volatile T *, A0, A1, A2, A3), const volatile T *arg)
 Create a Callback with a static function and bound pointer.
template<typename F >
 Callback (F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3),&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Create a Callback with a function object.
template<typename F >
 Callback (const F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) const,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Create a Callback with a function object.
template<typename F >
 Callback (volatile F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) volatile,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Create a Callback with a function object.
template<typename F >
 Callback (const volatile F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) const volatile,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Create a Callback with a function object.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(void *obj
 Create a Callback with a static function and bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const void *obj
 Create a Callback with a static function and bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(volatile void *obj
 Create a Callback with a static function and bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const volatile void *obj
 Create a Callback with a static function and bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(T *obj
 Create a Callback with a static function and bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const T *obj
 Create a Callback with a static function and bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(volatile T *obj
 Create a Callback with a static function and bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to Callback(func, arg)") Callback(const volatile T *obj
 Create a Callback with a static function and bound pointer.
 ~Callback ()
 Destroy a callback.
void attach (R(*func)(A0, A1, A2, A3))
 Attach a static function.
void attach (const Callback< R(A0, A1, A2, A3)> &func)
 Attach a Callback.
template<typename T >
void attach (T *obj, R(T::*method)(A0, A1, A2, A3))
 Attach a member function.
template<typename T >
void attach (const T *obj, R(T::*method)(A0, A1, A2, A3) const)
 Attach a member function.
template<typename T >
void attach (volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile)
 Attach a member function.
template<typename T >
void attach (const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile)
 Attach a member function.
void attach (R(*func)(void *, A0, A1, A2, A3), void *arg)
 Attach a static function with a bound pointer.
void attach (R(*func)(const void *, A0, A1, A2, A3), const void *arg)
 Attach a static function with a bound pointer.
void attach (R(*func)(volatile void *, A0, A1, A2, A3), volatile void *arg)
 Attach a static function with a bound pointer.
void attach (R(*func)(const volatile void *, A0, A1, A2, A3), const volatile void *arg)
 Attach a static function with a bound pointer.
template<typename T >
void attach (R(*func)(T *, A0, A1, A2, A3), T *arg)
 Attach a static function with a bound pointer.
template<typename T >
void attach (R(*func)(const T *, A0, A1, A2, A3), const T *arg)
 Attach a static function with a bound pointer.
template<typename T >
void attach (R(*func)(volatile T *, A0, A1, A2, A3), volatile T *arg)
 Attach a static function with a bound pointer.
template<typename T >
void attach (R(*func)(const volatile T *, A0, A1, A2, A3), const volatile T *arg)
 Attach a static function with a bound pointer.
template<typename F >
void attach (F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3),&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Attach a function object.
template<typename F >
void attach (const F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) const,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Attach a function object.
template<typename F >
void attach (volatile F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) volatile,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Attach a function object.
template<typename F >
void attach (const volatile F f, typename detail::enable_if< detail::is_type< R(F::*)(A0, A1, A2, A3) const volatile,&F::operator()>::value &&sizeof(F)<=sizeof(uintptr_t) >::type=detail::nil())
 Attach a function object.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(void *obj
 Attach a static function with a bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const void *obj
 Attach a static function with a bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(volatile void *obj
 Attach a static function with a bound pointer.
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const volatile void *obj
 Attach a static function with a bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(T *obj
 Attach a static function with a bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const T *obj
 Attach a static function with a bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(volatile T *obj
 Attach a static function with a bound pointer.
template<typename T >
 MBED_DEPRECATED_SINCE ("mbed-os-5.1","Arguments to callback have been reordered to attach(func, arg)") void attach(const volatile T *obj
 Attach a static function with a bound pointer.
Callback & operator= (const Callback &that)
 Assign a callback.
call (A0 a0, A1 a1, A2 a2, A3 a3) const
 Call the attached function.
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.

Synchronization level: Not protected

Definition at line 2890 of file Callback.h.


Constructor & Destructor Documentation

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

Create a Callback with a static function.

Parameters:
funcStatic function to attach

Definition at line 2895 of file Callback.h.

Callback ( const F  f )

Create a Callback with a function object.

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

Definition at line 3034 of file Callback.h.

Callback ( volatile F  f )

Create a Callback with a function object.

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

Definition at line 3046 of file Callback.h.

Callback ( const volatile F  f )

Create a Callback with a function object.

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

Definition at line 3058 of file Callback.h.


Member Function Documentation

void attach ( const F  f )

Attach a function object.

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

Definition at line 3323 of file Callback.h.

void attach ( volatile F  f )

Attach a function object.

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

Definition at line 3336 of file Callback.h.

void attach ( const volatile F  f )

Attach a function object.

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

Definition at line 3349 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:
objPointer to object to bind to function
funcStatic 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:
objPointer to object to bind to function
funcStatic 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:
objPointer to object to bind to function
funcStatic 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)"   
) volatile

Create a Callback with a static function and bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic function to attach
MBED_DEPRECATED_SINCE ( "mbed-os-5.1"  ,
"Arguments to callback have been reordered to attach(func, arg)"   
)

Attach a static function with a bound pointer.

Parameters:
objPointer to object to bind to function
funcStatic 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:
objPointer to object to bind to function
funcStatic 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:
objPointer to object to bind to function
funcStatic 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:
objPointer to object to bind to function
funcStatic function to attach