DD4hep  1.31.0
Detector Description Toolkit for High Energy Physics
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 (const 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 T * cast (void *p)
 Template cast function used internally by the wrapper for type conversion to the object's type. More...
 
template<typename T >
static const T * c_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 T * dyn_cast (P *p, R(T::*)())
 
template<typename P , typename R , typename T >
static const T * dyn_cast (const P *p, R(T::*)() const)
 
template<typename P , typename R , typename T , typename A >
static T * dyn_cast (P *p, R(T::*)(A))
 
template<typename P , typename R , typename T , typename A >
static const T * dyn_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 37 of file Callback.h.

Member Typedef Documentation

◆ func_t

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

Definition at line 39 of file Callback.h.

◆ ulong

typedef unsigned long dd4hep::Callback::ulong

Definition at line 44 of file Callback.h.

Constructor & Destructor Documentation

◆ Callback() [1/4]

dd4hep::Callback::Callback ( )
inline

Default constructor.

Definition at line 51 of file Callback.h.

◆ Callback() [2/4]

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

Constructor with object initialization.

Definition at line 56 of file Callback.h.

◆ Callback() [3/4]

dd4hep::Callback::Callback ( const void *  p)
inline

Constructor with object initialization.

Definition at line 61 of file Callback.h.

◆ Callback() [4/4]

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

Initializing constructor.

Definition at line 66 of file Callback.h.

Member Function Documentation

◆ _make()

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

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

Callback setup with no arguments

Definition at line 118 of file Callback.h.

◆ c_cast()

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 83 of file Callback.h.

◆ cast()

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 79 of file Callback.h.

◆ dyn_cast() [1/4]

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

Definition at line 316 of file Callback.h.

◆ dyn_cast() [2/4]

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 323 of file Callback.h.

◆ dyn_cast() [3/4]

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

Definition at line 313 of file Callback.h.

◆ dyn_cast() [4/4]

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

Definition at line 320 of file Callback.h.

◆ execute()

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

Execute the callback with the required number of user parameters.

Definition at line 75 of file Callback.h.

◆ make() [1/17]

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 135 of file Callback.h.

◆ make() [2/17]

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 125 of file Callback.h.

◆ make() [3/17]

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 179 of file Callback.h.

◆ make() [4/17]

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 169 of file Callback.h.

◆ make() [5/17]

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 225 of file Callback.h.

◆ make() [6/17]

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 214 of file Callback.h.

◆ make() [7/17]

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 274 of file Callback.h.

◆ make() [8/17]

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 263 of file Callback.h.

◆ make() [9/17]

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

Definition at line 309 of file Callback.h.

◆ make() [10/17]

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 156 of file Callback.h.

◆ make() [11/17]

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 145 of file Callback.h.

◆ make() [12/17]

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 200 of file Callback.h.

◆ make() [13/17]

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 189 of file Callback.h.

◆ make() [14/17]

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 248 of file Callback.h.

◆ make() [15/17]

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 236 of file Callback.h.

◆ make() [16/17]

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 297 of file Callback.h.

◆ make() [17/17]

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 285 of file Callback.h.

◆ operator bool()

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

Check validity of the callback object.

Definition at line 71 of file Callback.h.

Member Data Documentation

◆ call

func_t dd4hep::Callback::call

Definition at line 47 of file Callback.h.

◆ func

mfunc_t dd4hep::Callback::func

Definition at line 48 of file Callback.h.

◆ par

void* dd4hep::Callback::par

Definition at line 46 of file Callback.h.


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