CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Callbackable< ParamT > Class Template Reference

#include <async.h>

Inheritance diagram for Callbackable< ParamT >:

Public Types

typedef CallbackBase< ParamT > CallbackTN
 

Static Public Member Functions

template<class DelegateT , typename ClosureDataT >
static CallbackTNMakeClosure (typename BoundClosure< ParamT, DelegateT, ClosureDataT >::CallbackMethod method, DelegateT *delegate, const ClosureDataT &closure_data)
 
template<class DelegateT >
static CallbackTNMakeCallback (typename BoundCallback< ParamT, DelegateT >::CallbackMethod method, DelegateT *delegate)
 
static CallbackTNMakeCallback (typename Callback< ParamT >::CallbackFunction function)
 

Detailed Description

template<class ParamT>
class Callbackable< ParamT >

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

Parameters
ParamTthe parameter type of the callbacks to be called

Definition at line 190 of file async.h.

Member Typedef Documentation

template<class ParamT>
typedef CallbackBase<ParamT> Callbackable< ParamT >::CallbackTN

Definition at line 192 of file async.h.

Member Function Documentation

template<class ParamT>
template<class DelegateT >
static CallbackTN* Callbackable< ParamT >::MakeCallback ( typename BoundCallback< ParamT, DelegateT >::CallbackMethod  method,
DelegateT *  delegate 
)
inlinestatic

Produces a BoundCallback object that invokes a method on a delegate object.

Parameters
methodFunction pointer to the method to be called
delegateThe delegate object on which <method> will be called

Definition at line 222 of file async.h.

Referenced by Observable< ParamT >::RegisterListener().

Here is the caller graph for this function:

template<class ParamT>
static CallbackTN* Callbackable< ParamT >::MakeCallback ( typename Callback< ParamT >::CallbackFunction  function)
inlinestatic

Produces a Callback object that invokes a static function or a globally de- fined C-like function.

Parameters
functionFunction pointer to the function to be invoked

Definition at line 234 of file async.h.

template<class ParamT>
template<class DelegateT , typename ClosureDataT >
static CallbackTN* Callbackable< ParamT >::MakeClosure ( typename BoundClosure< ParamT, DelegateT, ClosureDataT >::CallbackMethod  method,
DelegateT *  delegate,
const ClosureDataT &  closure_data 
)
inlinestatic

Produces a BoundClosure object that captures a closure value passed along to the invoked method.

Parameters
methodFunction pointer to the method to be called
delegateThe delegate object on which <method> will be called
closure_dataThe closure data to be passed along to <method>

Definition at line 204 of file async.h.

Referenced by Observable< ParamT >::RegisterListener().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: