Callback class based on template specialization. More...
#include <Callback.h>
Public Member Functions | |
Callback (R(*func)(ArgTs...)=0) | |
Create a Callback with a static function. More... | |
Callback (const Callback< R(ArgTs...)> &func) | |
Attach a Callback. More... | |
template<typename T , typename U > | |
Callback (U *obj, R(T::*method)(ArgTs...)) | |
Create a Callback with a member function. More... | |
template<typename T , typename U > | |
Callback (const U *obj, R(T::*method)(ArgTs...) const) | |
Create a Callback with a member function. More... | |
template<typename T , typename U > | |
Callback (volatile U *obj, R(T::*method)(ArgTs...) volatile) | |
Create a Callback with a member function. More... | |
template<typename T , typename U > | |
Callback (const volatile U *obj, R(T::*method)(ArgTs...) const volatile) | |
Create a Callback with a member function. More... | |
template<typename T , typename U > | |
Callback (R(*func)(T *, ArgTs...), U *arg) | |
Create a Callback with a static function and bound pointer. More... | |
template<typename T , typename U > | |
Callback (R(*func)(const T *, ArgTs...), const U *arg) | |
Create a Callback with a static function and bound pointer. More... | |
template<typename T , typename U > | |
Callback (R(*func)(volatile T *, ArgTs...), 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 *, ArgTs...), 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 *, ArgTs...)) | |
Create a Callback with a static function and bound pointer. More... | |
template<typename T , typename U > | |
Callback (const U *obj, R(*func)(const T *, ArgTs...)) | |
Create a Callback with a static function and bound pointer. More... | |
template<typename T , typename U > | |
Callback (volatile U *obj, R(*func)(volatile T *, ArgTs...)) | |
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 *, ArgTs...)) | |
Create a Callback with a static function and bound pointer. More... | |
~Callback () | |
Destroy a callback. More... | |
void | attach (R(*func)(ArgTs...)) |
Attach a static function. More... | |
void | attach (const Callback< R(ArgTs...)> &func) |
Attach a Callback. More... | |
template<typename T , typename U > | |
void | attach (U *obj, R(T::*method)(ArgTs...)) |
Attach a member function. More... | |
template<typename T , typename U > | |
void | attach (const U *obj, R(T::*method)(ArgTs...) const) |
Attach a member function. More... | |
template<typename T , typename U > | |
void | attach (volatile U *obj, R(T::*method)(ArgTs...) volatile) |
Attach a member function. More... | |
template<typename T , typename U > | |
void | attach (const volatile U *obj, R(T::*method)(ArgTs...) const volatile) |
Attach a member function. More... | |
template<typename T , typename U > | |
void | attach (R(*func)(T *, ArgTs...), U *arg) |
Attach a static function with a bound pointer. More... | |
template<typename T , typename U > | |
void | attach (R(*func)(const T *, ArgTs...), const U *arg) |
Attach a static function with a bound pointer. More... | |
template<typename T , typename U > | |
void | attach (R(*func)(volatile T *, ArgTs...), volatile U *arg) |
Attach a static function with a bound pointer. More... | |
template<typename T , typename U > | |
void | attach (R(*func)(const volatile T *, ArgTs...), 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 *, ArgTs...)) |
Attach a static function with a bound pointer. More... | |
template<typename T , typename U > | |
void | attach (const U *obj, R(*func)(const T *, ArgTs...)) |
Attach a static function with a bound pointer. More... | |
template<typename T , typename U > | |
void | attach (volatile U *obj, R(*func)(volatile T *, ArgTs...)) |
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 *, ArgTs...)) |
Attach a static function with a bound pointer. More... | |
Callback & | operator= (const Callback &that) |
Assign a callback. More... | |
R | call (ArgTs...args) const |
Call the attached function. More... | |
R | operator() (ArgTs...args) 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, ArgTs...args) |
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... | |
Callback class based on template specialization.
Definition at line 78 of file Callback.h.
Callback | ( | R(*)(ArgTs...) | func = 0 | ) |
Create a Callback with a static function.
func | Static function to attach |
Definition at line 83 of file Callback.h.
Callback | ( | U * | obj, |
R(T::*)(ArgTs...) | method | ||
) |
Create a Callback with a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 109 of file Callback.h.
Callback | ( | const U * | obj, |
R(T::*)(ArgTs...) const | method | ||
) |
Create a Callback with a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 119 of file Callback.h.
Callback | ( | volatile U * | obj, |
R(T::*)(ArgTs...) volatile | method | ||
) |
Create a Callback with a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 129 of file Callback.h.
Callback | ( | const volatile U * | obj, |
R(T::*)(ArgTs...) const volatile | method | ||
) |
Create a Callback with a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 139 of file Callback.h.
Callback | ( | R(*)(T *, ArgTs...) | func, |
U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 149 of file Callback.h.
Callback | ( | R(*)(const T *, ArgTs...) | func, |
const U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 159 of file Callback.h.
Callback | ( | R(*)(volatile T *, ArgTs...) | func, |
volatile U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 169 of file Callback.h.
Callback | ( | R(*)(const volatile T *, ArgTs...) | func, |
const volatile U * | arg | ||
) |
Create a Callback with a static function and bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 179 of file Callback.h.
Callback | ( | F | f | ) |
Create a Callback with a function object.
f | Function object to attach |
Definition at line 189 of file Callback.h.
Callback | ( | const F | f | ) |
Create a Callback with a function object.
f | Function object to attach |
Definition at line 199 of file Callback.h.
Callback | ( | volatile F | f | ) |
Create a Callback with a function object.
f | Function object to attach |
Definition at line 209 of file Callback.h.
Callback | ( | const volatile F | f | ) |
Create a Callback with a function object.
f | Function object to attach |
Definition at line 219 of file Callback.h.
Callback | ( | U * | obj, |
R(*)(T *, ArgTs...) | func | ||
) |
Create a Callback with a static function and bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 233 of file Callback.h.
Callback | ( | const U * | obj, |
R(*)(const T *, ArgTs...) | func | ||
) |
Create a Callback with a static function and bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 247 of file Callback.h.
Callback | ( | volatile U * | obj, |
R(*)(volatile T *, ArgTs...) | func | ||
) |
Create a Callback with a static function and bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 261 of file Callback.h.
Callback | ( | const volatile U * | obj, |
R(*)(const volatile T *, ArgTs...) | func | ||
) |
Create a Callback with a static function and bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 275 of file Callback.h.
~Callback | ( | ) |
Destroy a callback.
Definition at line 282 of file Callback.h.
void attach | ( | R(*)(ArgTs...) | func | ) |
Attach a static function.
func | Static function to attach |
Definition at line 296 of file Callback.h.
void attach | ( | const Callback< R(ArgTs...)> & | func | ) |
Attach a Callback.
func | The Callback to attach |
Definition at line 309 of file Callback.h.
void attach | ( | U * | obj, |
R(T::*)(ArgTs...) | method | ||
) |
Attach a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 324 of file Callback.h.
void attach | ( | const U * | obj, |
R(T::*)(ArgTs...) const | method | ||
) |
Attach a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 339 of file Callback.h.
void attach | ( | volatile U * | obj, |
R(T::*)(ArgTs...) volatile | method | ||
) |
Attach a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 354 of file Callback.h.
void attach | ( | const volatile U * | obj, |
R(T::*)(ArgTs...) const volatile | method | ||
) |
Attach a member function.
obj | Pointer to object to invoke member function on |
method | Member function to attach |
Definition at line 369 of file Callback.h.
void attach | ( | R(*)(T *, ArgTs...) | func, |
U * | arg | ||
) |
Attach a static function with a bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 384 of file Callback.h.
void attach | ( | R(*)(const T *, ArgTs...) | func, |
const U * | arg | ||
) |
Attach a static function with a bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 399 of file Callback.h.
void attach | ( | R(*)(volatile T *, ArgTs...) | func, |
volatile U * | arg | ||
) |
Attach a static function with a bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 414 of file Callback.h.
void attach | ( | R(*)(const volatile T *, ArgTs...) | func, |
const volatile U * | arg | ||
) |
Attach a static function with a bound pointer.
func | Static function to attach |
arg | Pointer argument to function |
Definition at line 429 of file Callback.h.
void attach | ( | F | f | ) |
Attach a function object.
f | Function object to attach |
Definition at line 444 of file Callback.h.
void attach | ( | const F | f | ) |
Attach a function object.
f | Function object to attach |
Definition at line 459 of file Callback.h.
void attach | ( | volatile F | f | ) |
Attach a function object.
f | Function object to attach |
Definition at line 474 of file Callback.h.
void attach | ( | const volatile F | f | ) |
Attach a function object.
f | Function object to attach |
Definition at line 489 of file Callback.h.
void attach | ( | U * | obj, |
R(*)(T *, ArgTs...) | func | ||
) |
Attach a static function with a bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 504 of file Callback.h.
void attach | ( | const U * | obj, |
R(*)(const T *, ArgTs...) | func | ||
) |
Attach a static function with a bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 519 of file Callback.h.
void attach | ( | volatile U * | obj, |
R(*)(volatile T *, ArgTs...) | func | ||
) |
Attach a static function with a bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 534 of file Callback.h.
void attach | ( | const volatile U * | obj, |
R(*)(const volatile T *, ArgTs...) | func | ||
) |
Attach a static function with a bound pointer.
obj | Pointer to object to bind to function |
func | Static function to attach |
Definition at line 549 of file Callback.h.
R call | ( | ArgTs... | args | ) | const |
Call the attached function.
Definition at line 569 of file Callback.h.
operator bool | ( | ) | const |
Test if function has been attached.
Definition at line 584 of file Callback.h.
R operator() | ( | ArgTs... | args | ) | const |
Call the attached function.
Definition at line 577 of file Callback.h.
Assign a callback.
Definition at line 557 of file Callback.h.
|
static |
Static thunk for passing as C-style function.
func | Callback to call passed as void pointer |
args | Arguments to be called with function func |
Definition at line 609 of file Callback.h.
Test for inequality.
Definition at line 598 of file Callback.h.
Test for equality.
Definition at line 591 of file Callback.h.