DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DD4hep::Callback Class Reference

Definition of the generic callback structure for member functions. More...

#include <Callback.h>

Classes

struct  mfunc_t
 Structure definition to store callback related data. More...
 
class  Wrapper
 Wrapper around a C++ member function pointer. More...
 

Public Types

typedef unsigned long(* func_t )(void *obj, const void *fun, const void *args[])
 
typedef unsigned long ulong
 

Public Member Functions

 Callback ()
 Default constructor. More...
 
 Callback (void *p)
 Constructor with object initialization. More...
 
 Callback (void *p, void *mf, func_t c)
 Initializing constructor. More...
 
 operator bool () const
 Check validity of the callback object. More...
 
unsigned long execute (const void *user_param[]) const
 Execute the callback with the required number of user parameters. More...
 
template<typename T >
const Callback_make (ulong(*fptr)(void *o, const void *f, const void *u[]), T pmf)
 Callback setup function for Callbacks with member functions taking no arguments. More...
 
template<typename R , typename T >
const Callbackmake (R(T::*pmf)())
 Callback setup function for Callbacks with member functions with explicit return type taking no arguments. More...
 
template<typename R , typename T >
const Callbackmake (R(T::*pmf)() const)
 Callback setup function for Callbacks with const member functions with explicit return type taking no arguments. More...
 
template<typename T >
const Callbackmake (void(T::*pmf)())
 Callback setup function for Callbacks with void member functions taking no arguments. More...
 
template<typename T >
const Callbackmake (void(T::*pmf)() const)
 Callback setup function for Callbacks with const void member functions taking no arguments. More...
 
template<typename R , typename T , typename A >
const Callbackmake (R(T::*pmf)(A))
 Callback setup function for Callbacks with member functions with explicit return type taking 1 argument. More...
 
template<typename R , typename T , typename A >
const Callbackmake (R(T::*pmf)(A) const)
 Callback setup function for Callbacks with const member functions with explicit return type taking 1 argument. More...
 
template<typename T , typename A >
const Callbackmake (void(T::*pmf)(A))
 Callback setup function for Callbacks with void member functions taking 1 argument. More...
 
template<typename T , typename A >
const Callbackmake (void(T::*pmf)(A) const)
 Callback setup function for Callbacks with const void member functions taking 1 argument. More...
 
template<typename R , typename T , typename A0 , typename A1 >
const Callbackmake (R(T::*pmf)(A0, A1))
 Callback setup function for Callbacks with member functions with explicit return type taking 2 arguments. More...
 
template<typename R , typename T , typename A0 , typename A1 >
const Callbackmake (R(T::*pmf)(A0, A1) const)
 Callback setup function for Callbacks with const member functions with explicit return type taking 2 arguments. More...
 
template<typename T , typename A0 , typename A1 >
const Callbackmake (void(T::*pmf)(A0, A1))
 Callback setup function for Callbacks with const void member functions taking 2 arguments. More...
 
template<typename T , typename A0 , typename A1 >
const Callbackmake (void(T::*pmf)(A0, A1) const)
 Callback setup function for Callbacks with const void member functions taking 2 arguments. More...
 
template<typename R , typename T , typename A0 , typename A1 , typename A2 >
const Callbackmake (R(T::*pmf)(A0, A1, A2))
 Callback setup function for Callbacks with member functions with explicit return type taking 3 arguments. More...
 
template<typename R , typename T , typename A0 , typename A1 , typename A2 >
const Callbackmake (R(T::*pmf)(A0, A1, A2) const)
 Callback setup function for Callbacks with const member functions with explicit return type taking 3 arguments. More...
 
template<typename T , typename A0 , typename A1 , typename A2 >
const Callbackmake (void(T::*pmf)(A0, A1, A2))
 Callback setup function for Callbacks with const void member functions taking 3 arguments. More...
 
template<typename T , typename A0 , typename A1 , typename A2 >
const Callbackmake (void(T::*pmf)(A0, A1, A2) const)
 Callback setup function for Callbacks with const void member functions taking 3 arguments. More...
 

Static Public Member Functions

template<typename T >
static Tcast (void *p)
 Template cast function used internally by the wrapper for type conversion to the object's type. More...
 
template<typename T >
static const Tc_cast (const void *p)
 Template const cast function used internally by the wrapper for type conversion to the object's type. More...
 
template<typename T >
static Callback make (void *p, T pmf)
 
template<typename P , typename R , typename T >
static Tdyn_cast (P *p, R(T::*)())
 
template<typename P , typename R , typename T >
static const Tdyn_cast (const P *p, R(T::*)() const)
 
template<typename P , typename R , typename T , typename A >
static Tdyn_cast (P *p, R(T::*)(A))
 
template<typename P , typename R , typename T , typename A >
static const Tdyn_cast (const P *p, R(T::*)(A) const)
 

Public Attributes

void * par
 
func_t call
 
mfunc_t func
 

Detailed Description

Definition of the generic callback structure for member functions.

The callback structure allows to wrap any member function with up to 3 arguments into an abstract objects, which could later be called using the argument list. The pointer to the hosting objects is stored in the callback object. The callback objects in this sense behaves very similar to a static function.

Author
M.Frank
Date
01/03/2013
Version
1.0

Definition at line 38 of file Callback.h.

Member Typedef Documentation

typedef unsigned long(* DD4hep::Callback::func_t)(void *obj, const void *fun, const void *args[])

Definition at line 40 of file Callback.h.

typedef unsigned long DD4hep::Callback::ulong

Definition at line 45 of file Callback.h.

Constructor & Destructor Documentation

DD4hep::Callback::Callback ( )
inline

Default constructor.

Definition at line 52 of file Callback.h.

References DD4hep::Callback::mfunc_t::first, func, and DD4hep::Callback::mfunc_t::second.

Referenced by make().

DD4hep::Callback::Callback ( void *  p)
inline

Constructor with object initialization.

Definition at line 57 of file Callback.h.

References DD4hep::Callback::mfunc_t::first, func, and DD4hep::Callback::mfunc_t::second.

DD4hep::Callback::Callback ( void *  p,
void *  mf,
func_t  c 
)
inline

Initializing constructor.

Definition at line 62 of file Callback.h.

References func.

Member Function Documentation

template<typename T >
const Callback& DD4hep::Callback::_make ( ulong(*)(void *o, const void *f, const void *u[])  fptr,
T  pmf 
)
inline

Callback setup function for Callbacks with member functions taking no arguments.

Callback setup with no arguments

Definition at line 114 of file Callback.h.

Referenced by make().

template<typename T >
static const T* DD4hep::Callback::c_cast ( const void *  p)
inlinestatic

Template const cast function used internally by the wrapper for type conversion to the object's type.

Definition at line 79 of file Callback.h.

template<typename T >
static T* DD4hep::Callback::cast ( void *  p)
inlinestatic

Template cast function used internally by the wrapper for type conversion to the object's type.

Definition at line 75 of file Callback.h.

template<typename P , typename R , typename T >
static T* DD4hep::Callback::dyn_cast ( P *  p,
R(T::*)()   
)
inlinestatic

Definition at line 309 of file Callback.h.

template<typename P , typename R , typename T >
static const T* DD4hep::Callback::dyn_cast ( const P *  p,
R(T::*)()  const 
)
inlinestatic

Definition at line 312 of file Callback.h.

template<typename P , typename R , typename T , typename A >
static T* DD4hep::Callback::dyn_cast ( P *  p,
R(T::*)(A)   
)
inlinestatic

Definition at line 316 of file Callback.h.

template<typename P , typename R , typename T , typename A >
static const T* DD4hep::Callback::dyn_cast ( const P *  p,
R(T::*)(A)  const 
)
inlinestatic

Definition at line 319 of file Callback.h.

unsigned long DD4hep::Callback::execute ( const void *  user_param[]) const
inline

Execute the callback with the required number of user parameters.

Definition at line 71 of file Callback.h.

References call, func, and par.

template<typename R , typename T >
const Callback& DD4hep::Callback::make ( R(T::*)()  pmf)
inline

Callback setup function for Callbacks with member functions with explicit return type taking no arguments.

Definition at line 121 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

Referenced by DD4hep::Simulation::Geant4PhaseAction::callback(), and DD4hep::Simulation::Geant4ActionPhase::remove().

template<typename R , typename T >
const Callback& DD4hep::Callback::make ( R(T::*)() const  pmf)
inline

Callback setup function for Callbacks with const member functions with explicit return type taking no arguments.

Definition at line 131 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename T >
const Callback& DD4hep::Callback::make ( void(T::*)()  pmf)
inline

Callback setup function for Callbacks with void member functions taking no arguments.

Definition at line 141 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename T >
const Callback& DD4hep::Callback::make ( void(T::*)() const  pmf)
inline

Callback setup function for Callbacks with const void member functions taking no arguments.

Definition at line 152 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename R , typename T , typename A >
const Callback& DD4hep::Callback::make ( R(T::*)(A)  pmf)
inline

Callback setup function for Callbacks with member functions with explicit return type taking 1 argument.

Callbacks with 1 argument

Definition at line 165 of file Callback.h.

template<typename R , typename T , typename A >
const Callback& DD4hep::Callback::make ( R(T::*)(A) const  pmf)
inline

Callback setup function for Callbacks with const member functions with explicit return type taking 1 argument.

Definition at line 175 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename T , typename A >
const Callback& DD4hep::Callback::make ( void(T::*)(A)  pmf)
inline

Callback setup function for Callbacks with void member functions taking 1 argument.

Definition at line 185 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename T , typename A >
const Callback& DD4hep::Callback::make ( void(T::*)(A) const  pmf)
inline

Callback setup function for Callbacks with const void member functions taking 1 argument.

Definition at line 196 of file Callback.h.

References _make(), call, and DD4hep::Callback::Wrapper< T >::Functor::pmf.

template<typename R , typename T , typename A0 , typename A1 >
const Callback& DD4hep::Callback::make ( R(T::*)(A0, A1)  pmf)
inline

Callback setup function for Callbacks with member functions with explicit return type taking 2 arguments.

Callback with 2 arguments

Definition at line 210 of file Callback.h.

template<typename R , typename T , typename A0 , typename A1 >
const Callback& DD4hep::Callback::make ( R(T::*)(A0, A1) const  pmf)
inline

Callback setup function for Callbacks with const member functions with explicit return type taking 2 arguments.

Definition at line 221 of file Callback.h.

References _make(), and call.

template<typename T , typename A0 , typename A1 >
const Callback& DD4hep::Callback::make ( void(T::*)(A0, A1)  pmf)
inline

Callback setup function for Callbacks with const void member functions taking 2 arguments.

Definition at line 232 of file Callback.h.

References _make(), and call.

template<typename T , typename A0 , typename A1 >
const Callback& DD4hep::Callback::make ( void(T::*)(A0, A1) const  pmf)
inline

Callback setup function for Callbacks with const void member functions taking 2 arguments.

Definition at line 244 of file Callback.h.

References _make(), and call.

template<typename R , typename T , typename A0 , typename A1 , typename A2 >
const Callback& DD4hep::Callback::make ( R(T::*)(A0, A1, A2)  pmf)
inline

Callback setup function for Callbacks with member functions with explicit return type taking 3 arguments.

Callback setup for callbacks with 3 arguments

Definition at line 259 of file Callback.h.

template<typename R , typename T , typename A0 , typename A1 , typename A2 >
const Callback& DD4hep::Callback::make ( R(T::*)(A0, A1, A2) const  pmf)
inline

Callback setup function for Callbacks with const member functions with explicit return type taking 3 arguments.

Definition at line 270 of file Callback.h.

References _make(), and call.

template<typename T , typename A0 , typename A1 , typename A2 >
const Callback& DD4hep::Callback::make ( void(T::*)(A0, A1, A2)  pmf)
inline

Callback setup function for Callbacks with const void member functions taking 3 arguments.

Definition at line 281 of file Callback.h.

References _make(), and call.

template<typename T , typename A0 , typename A1 , typename A2 >
const Callback& DD4hep::Callback::make ( void(T::*)(A0, A1, A2) const  pmf)
inline

Callback setup function for Callbacks with const void member functions taking 3 arguments.

Definition at line 293 of file Callback.h.

References _make(), and call.

template<typename T >
static Callback DD4hep::Callback::make ( void *  p,
T  pmf 
)
inlinestatic

Definition at line 305 of file Callback.h.

References Callback().

DD4hep::Callback::operator bool ( ) const
inline

Check validity of the callback object.

Definition at line 67 of file Callback.h.

References call, DD4hep::Callback::mfunc_t::first, func, and par.

Member Data Documentation

func_t DD4hep::Callback::call

Definition at line 48 of file Callback.h.

Referenced by execute(), make(), and operator bool().

mfunc_t DD4hep::Callback::func
void* DD4hep::Callback::par

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