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

#include <async.h>

Inheritance diagram for BoundClosure< ParamT, DelegateT, ClosureDataT >:
Collaboration diagram for BoundClosure< ParamT, DelegateT, ClosureDataT >:

Public Types

typedef void(DelegateT::* CallbackMethod )(const ParamT &value, const ClosureDataT closure_data)
 

Public Member Functions

 BoundClosure (CallbackMethod method, DelegateT *delegate, ClosureDataT data)
 
void operator() (const ParamT &value) const
 
- Public Member Functions inherited from CallbackBase< ParamT >
virtual ~CallbackBase ()
 

Private Attributes

DelegateT * delegate_
 
CallbackMethod method_
 
const ClosureDataT closure_data_
 

Detailed Description

template<typename ParamT, class DelegateT, typename ClosureDataT>
class BoundClosure< ParamT, DelegateT, ClosureDataT >

A BoundClosure works exactly the same as a BoundCallback (see above) but, allows for an opaque enclosure of an arbitrary chunk of user data on creation. When the closure is invoked the provided user data chunk is passed as a second argument to the specified callback method.

Note: delegate must be still around when the closure is invoked!

Parameters
ParamTthe type of the parameter to be passed to the callback
DelegateTthe <class name>=""> of the object the member <member name>=""> should be invoked in
ClosureDataTthe type of the user data chunk to be passed on invoke

Definition at line 129 of file async.h.

Member Typedef Documentation

template<typename ParamT, class DelegateT, typename ClosureDataT>
typedef void(DelegateT::* BoundClosure< ParamT, DelegateT, ClosureDataT >::CallbackMethod)(const ParamT &value, const ClosureDataT closure_data)

Definition at line 131 of file async.h.

Constructor & Destructor Documentation

template<typename ParamT, class DelegateT, typename ClosureDataT>
BoundClosure< ParamT, DelegateT, ClosureDataT >::BoundClosure ( CallbackMethod  method,
DelegateT *  delegate,
ClosureDataT  data 
)
inline

Definition at line 135 of file async.h.

Member Function Documentation

template<typename ParamT, class DelegateT, typename ClosureDataT>
void BoundClosure< ParamT, DelegateT, ClosureDataT >::operator() ( const ParamT &  value) const
inlinevirtual

Implements CallbackBase< ParamT >.

Definition at line 142 of file async.h.

Member Data Documentation

template<typename ParamT, class DelegateT, typename ClosureDataT>
const ClosureDataT BoundClosure< ParamT, DelegateT, ClosureDataT >::closure_data_
private

Definition at line 149 of file async.h.

template<typename ParamT, class DelegateT, typename ClosureDataT>
DelegateT* BoundClosure< ParamT, DelegateT, ClosureDataT >::delegate_
private

Definition at line 147 of file async.h.

template<typename ParamT, class DelegateT, typename ClosureDataT>
CallbackMethod BoundClosure< ParamT, DelegateT, ClosureDataT >::method_
private

Definition at line 148 of file async.h.


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