CernVM-FS
2.12.0
|
#include <async.h>
Public Types | |
typedef CallbackBase< ParamT > | CallbackTN |
Static Public Member Functions | |
template<class DelegateT , typename ClosureDataT > | |
static CallbackTN * | MakeClosure (typename BoundClosure< ParamT, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, const ClosureDataT &closure_data) |
template<class DelegateT > | |
static CallbackTN * | MakeCallback (typename BoundCallback< ParamT, DelegateT >::CallbackMethod method, DelegateT *delegate) |
static CallbackTN * | MakeCallback (typename Callback< ParamT >::CallbackFunction function) |
This template contains convenience functions to be inherited by classes pro- viding callback functionality. You can use this as a base class providing the callback parameter your class is going to process. Users of your class can profit from the static MakeCallback resp. MakeClosure methods to generated Callback objects. Later they can easily be passed back to your class.
Note: the convenience methods return a pointer to a callback object. The user is responsible to clean up those pointers in some way. If it is a one- time callback, it makes sense to delete it inside the inheriting class once it was invoked.
TODO: C++11 - Replace this functionality by lambdas
ParamT | the parameter type of the callbacks to be called |
typedef CallbackBase<ParamT> Callbackable< ParamT >::CallbackTN |
|
inlinestatic |
Produces a BoundCallback object that invokes a method on a delegate object.
method | Function pointer to the method to be called |
delegate | The delegate object on which <method> will be called |
Definition at line 222 of file async.h.
Referenced by Observable< ParamT >::RegisterListener().
|
inlinestatic |
|
inlinestatic |
Produces a BoundClosure object that captures a closure value passed along to the invoked method.
method | Function pointer to the method to be called |
delegate | The delegate object on which <method> will be called |
closure_data | The closure data to be passed along to <method> |
Definition at line 204 of file async.h.
Referenced by Observable< ParamT >::RegisterListener().