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
Callback.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DD4HEP_DDCORE_CALLBACK_H
14 #define DD4HEP_DDCORE_CALLBACK_H
15 
16 // C/C++ include files
17 #include <algorithm>
18 #include <typeinfo>
19 #include <vector>
20 
22 namespace DD4hep {
23 
24 
26 
38  class Callback {
39  public:
40  typedef unsigned long (*func_t)(void* obj, const void* fun, const void* args[]);
42  typedef struct {
43  void *first, *second;
44  } mfunc_t;
45  typedef unsigned long ulong;
46 
47  void* par;
50 
53  : par(0), call(0) {
54  func.first = func.second = 0;
55  }
57  Callback(void* p)
58  : par(p), call(0) {
59  func.first = func.second = 0;
60  }
62  Callback(void* p, void* mf, func_t c)
63  : par(p), call(c) {
64  func = *(mfunc_t*) mf;
65  }
67  operator bool() const {
68  return (call && par && func.first);
69  }
71  unsigned long execute(const void* user_param[]) const {
72  return (*this) ? call(par, &func, user_param) : 0;
73  }
75  template <typename T> static T* cast(void* p) {
76  return (T*) p;
77  }
79  template <typename T> static const T* c_cast(const void* p) {
80  return (const T*) p;
81  }
82 
84 
92  template <typename T> class Wrapper {
93  public:
94  typedef T pmf_t;
96  union Functor {
99  Functor(const void* f) {
100  ptr = *(mfunc_t*) f;
101  }
103  pmf = f;
104  }
105  };
106  static mfunc_t pmf(pmf_t f) {
107  const Functor func(f);
108  return func.ptr;
109  }
110  };
111 
113  template <typename T> const Callback& _make(ulong (*fptr)(void* o, const void* f, const void* u[]), T pmf) {
115  typename Wrapper<T>::Functor f(pmf);
116  func = f.ptr;
117  call = fptr;
118  return *this;
119  }
121  template <typename R, typename T> const Callback& make(R (T::*pmf)()) {
122  typedef R (T::*pfunc_t)();
123  struct _Wrapper : public Wrapper<pfunc_t> {
124  static ulong call(void* o, const void* f, const void*[]) {
125  return (ulong) (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))();
126  }
127  };
128  return _make(_Wrapper::call, pmf);
129  }
131  template <typename R, typename T> const Callback& make(R (T::*pmf)() const) {
132  typedef R (T::*pfunc_t)() const;
133  struct _Wrapper : public Wrapper<pfunc_t> {
134  static ulong call(void* o, const void* f, const void*[]) {
135  return (ulong) (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))();
136  }
137  };
138  return _make(_Wrapper::call, pmf);
139  }
141  template <typename T> const Callback& make(void (T::*pmf)()) {
142  typedef void (T::*pfunc_t)() const;
143  struct _Wrapper : public Wrapper<pfunc_t> {
144  static ulong call(void* o, const void* f, const void*[]) {
145  (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))();
146  return 1;
147  }
148  };
149  return _make(_Wrapper::call, pmf);
150  }
152  template <typename T> const Callback& make(void (T::*pmf)() const) {
153  typedef void (T::*pfunc_t)() const;
154  struct _Wrapper : public Wrapper<pfunc_t> {
155  static ulong call(void* o, const void* f, const void*[]) {
156  (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))();
157  return 1;
158  }
159  };
160  return _make(_Wrapper::call, pmf);
161  }
162 
164  template <typename R, typename T, typename A> const Callback& make(R (T::*pmf)(A)) {
166  typedef R (T::*pfunc_t)(A);
167  struct _Wrapper : public Wrapper<pfunc_t> {
168  static ulong call(void* o, const void* f, const void* u[]) {
169  return (ulong) (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))((A) u[0]);
170  }
171  };
172  return _make(_Wrapper::call, pmf);
173  }
175  template <typename R, typename T, typename A> const Callback& make(R (T::*pmf)(A) const) {
176  typedef R (T::*pfunc_t)(A) const;
177  struct _Wrapper : public Wrapper<pfunc_t> {
178  static ulong call(void* o, const void* f, const void* u[]) {
179  return (ulong) (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))((A) u[0]);
180  }
181  };
182  return _make(_Wrapper::call, pmf);
183  }
185  template <typename T, typename A> const Callback& make(void (T::*pmf)(A)) {
186  typedef void (T::*pfunc_t)(const A);
187  struct _Wrapper : public Wrapper<pfunc_t> {
188  static ulong call(void* o, const void* f, const void* u[]) {
189  (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))((A) u[0]);
190  return 1;
191  }
192  };
193  return _make(_Wrapper::call, pmf);
194  }
196  template <typename T, typename A> const Callback& make(void (T::*pmf)(A) const) {
197  typedef void (T::*pfunc_t)(const A) const;
198  struct _Wrapper : public Wrapper<pfunc_t> {
199  static ulong call(void* o, const void* f, const void* u[]) {
200  (cast<T>(o)->*(typename Wrapper<pfunc_t>::Functor(f).pmf))((A) u[0]);
201  return 1;
202  }
203  };
204  return _make(_Wrapper::call, pmf);
205  }
206 
209  template <typename R, typename T, typename A0, typename A1> const Callback& make(R (T::*pmf)(A0, A1)) {
211  typedef R (T::*pfunc_t)(A0, A1);
212  typedef Wrapper<pfunc_t> _W;
213  struct _Wrapper : public _W {
214  static ulong call(void* o, const void* f, const void* u[]) {
215  return (ulong) (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1]);
216  }
217  };
218  return _make(_Wrapper::call, pmf);
219  }
221  template <typename R, typename T, typename A0, typename A1> const Callback& make(R (T::*pmf)(A0, A1) const) {
222  typedef R (T::*pfunc_t)(A0, A1);
223  typedef Wrapper<pfunc_t> _W;
224  struct _Wrapper : public _W {
225  static ulong call(void* o, const void* f, const void* u[]) {
226  return (ulong) (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1]);
227  }
228  };
229  return _make(_Wrapper::call, pmf);
230  }
232  template <typename T, typename A0, typename A1> const Callback& make(void (T::*pmf)(A0, A1)) {
233  typedef void (T::*pfunc_t)(A0, A1);
234  typedef Wrapper<pfunc_t> _W;
235  struct _Wrapper : public _W {
236  static ulong call(void* o, const void* f, const void* u[]) {
237  (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1]);
238  return 1;
239  }
240  };
241  return _make(_Wrapper::call, pmf);
242  }
244  template <typename T, typename A0, typename A1> const Callback& make(void (T::*pmf)(A0, A1) const) {
245  typedef void (T::*pfunc_t)(A0, A1);
246  typedef Wrapper<pfunc_t> _W;
247  struct _Wrapper : public _W {
248  static ulong call(void* o, const void* f, const void* u[]) {
249  (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1]);
250  return 1;
251  }
252  };
253  return _make(_Wrapper::call, pmf);
254  }
255 
258  template <typename R, typename T, typename A0, typename A1, typename A2> const Callback& make(R (T::*pmf)(A0, A1, A2)) {
260  typedef R (T::*pfunc_t)(A0, A1, A2);
261  typedef Wrapper<pfunc_t> _W;
262  struct _Wrapper : public _W {
263  static ulong call(void* o, const void* f, const void* u[]) {
264  return (ulong) (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1], (A2) u[2]);
265  }
266  };
267  return _make(_Wrapper::call, pmf);
268  }
270  template <typename R, typename T, typename A0, typename A1, typename A2> const Callback& make(R (T::*pmf)(A0, A1, A2) const) {
271  typedef R (T::*pfunc_t)(A0, A1, A2);
272  typedef Wrapper<pfunc_t> _W;
273  struct _Wrapper : public _W {
274  static ulong call(void* o, const void* f, const void* u[]) {
275  return (ulong) (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1], (A2) u[2]);
276  }
277  };
278  return _make(_Wrapper::call, pmf);
279  }
281  template <typename T, typename A0, typename A1, typename A2> const Callback& make(void (T::*pmf)(A0, A1, A2)) {
282  typedef void (T::*pfunc_t)(A0, A1, A2);
283  typedef Wrapper<pfunc_t> _W;
284  struct _Wrapper : public _W {
285  static ulong call(void* o, const void* f, const void* u[]) {
286  (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1], (A2) u[2]);
287  return 1;
288  }
289  };
290  return _make(_Wrapper::call, pmf);
291  }
293  template <typename T, typename A0, typename A1, typename A2> const Callback& make(void (T::*pmf)(A0, A1, A2) const) {
294  typedef void (T::*pfunc_t)(A0, A1, A2);
295  typedef Wrapper<pfunc_t> _W;
296  struct _Wrapper : public _W {
297  static ulong call(void* o, const void* f, const void* u[]) {
298  (cast<T>(o)->*(typename _W::Functor(f).pmf))((A0) u[0], (A1) u[1], (A2) u[2]);
299  return 1;
300  }
301  };
302  return _make(_Wrapper::call, pmf);
303  }
304 
305  template <typename T> static Callback make(void* p, T pmf) {
306  return Callback(p).make(pmf);
307  }
308 
309  template <typename P, typename R, typename T> static T* dyn_cast(P* p, R (T::*)()) {
310  return dynamic_cast<T*>(p);
311  }
312  template <typename P, typename R, typename T> static const T* dyn_cast(const P* p, R (T::*)() const) {
313  return dynamic_cast<const T*>(p);
314  }
315 
316  template <typename P, typename R, typename T, typename A> static T* dyn_cast(P* p, R (T::*)(A)) {
317  return dynamic_cast<T*>(p);
318  }
319  template <typename P, typename R, typename T, typename A> static const T* dyn_cast(const P* p, R (T::*)(A) const) {
320  return dynamic_cast<const T*>(p);
321  }
322  };
323 
325 
335  typedef std::vector<Callback> Callbacks;
336  enum Location { FRONT, END };
340  }
343  : callbacks(c.callbacks) {
344  }
347  if ( this != & c ) callbacks = c.callbacks;
348  return *this;
349  }
350 
351  //template <typename TYPE, typename R, typename OBJECT>
352  // CallbackSequence(const std::vector<TYPE*>& objects, R (TYPE::value_type::*pmf)()) {
353  //}
354  bool empty() const {
355  return callbacks.empty();
356  }
358  void clear() {
359  callbacks.clear();
360  }
362  void add(const Callback& cb,Location where) {
363  if ( where == CallbackSequence::FRONT )
364  callbacks.insert(callbacks.begin(),cb);
365  else
366  callbacks.insert(callbacks.end(),cb);
367  }
369  void operator()() const;
371  template <typename A0> void operator()(A0 a0) const;
373  template <typename A0, typename A1> void operator()(A0 a0, A1 a1) const;
375  template <typename A0, typename A1, typename A2> void operator()(A0 a0, A1 a1, A2 a2) const;
377  static void checkTypes(const std::type_info& typ1, const std::type_info& typ2, void* test);
378 
380  template <typename TYPE, typename R, typename OBJECT>
382  void add(TYPE* pointer, R (OBJECT::*pmf)(),Location where=CallbackSequence::END) {
383  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
384  add(Callback(pointer).make(pmf),where);
385  }
387  template <typename TYPE, typename R, typename OBJECT>
388  void add(TYPE* pointer, R (OBJECT::*pmf)() const,Location where=CallbackSequence::END) {
389  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
390  add(Callback(pointer).make(pmf),where);
391  }
393  template <typename TYPE, typename OBJECT>
394  void add(TYPE* pointer, void (OBJECT::*pmf)(),Location where=CallbackSequence::END) {
395  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
396  add(Callback(pointer).make(pmf),where);
397  }
399  template <typename TYPE, typename OBJECT>
400  void add(TYPE* pointer, void (OBJECT::*pmf)() const,Location where=CallbackSequence::END) {
401  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
402  add(Callback(pointer).make(pmf),where);
403  }
404 
406  template <typename TYPE, typename R, typename OBJECT, typename A>
408  void add(TYPE* pointer, R (OBJECT::*pmf)(A),Location where=CallbackSequence::END) {
409  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
410  add(Callback(pointer).make(pmf),where);
411  }
413  template <typename TYPE, typename OBJECT, typename A>
414  void add(TYPE* pointer, void (OBJECT::*pmf)(A),Location where=CallbackSequence::END) {
415  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
416  add(Callback(pointer).make(pmf),where);
417  }
419  template <typename TYPE, typename R, typename OBJECT, typename A>
420  void add(TYPE* pointer, R (OBJECT::*pmf)(A) const,Location where=CallbackSequence::END) {
421  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
422  add(Callback(pointer).make(pmf),where);
423  }
425  template <typename TYPE, typename OBJECT, typename A>
426  void add(TYPE* pointer, void (OBJECT::*pmf)(A) const,Location where=CallbackSequence::END) {
427  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
428  add(Callback(pointer).make(pmf),where);
429  }
430 
431 
433  template <typename TYPE, typename R, typename OBJECT, typename A1, typename A2>
435  void add(TYPE* pointer, R (OBJECT::*pmf)(A1, A2),Location where=CallbackSequence::END) {
436  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
437  add(Callback(pointer).make(pmf),where);
438  }
440  template <typename TYPE, typename R, typename OBJECT, typename A1, typename A2>
441  void add(TYPE* pointer, R (OBJECT::*pmf)(A1, A2) const,Location where=CallbackSequence::END) {
442  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
443  add(Callback(pointer).make(pmf),where);
444  }
446  template <typename TYPE, typename OBJECT, typename A1, typename A2>
447  void add(TYPE* pointer, void (OBJECT::*pmf)(A1, A2),Location where=CallbackSequence::END) {
448  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
449  add(Callback(pointer).make(pmf),where);
450  }
452  template <typename TYPE, typename OBJECT, typename A1, typename A2>
453  void add(TYPE* pointer, void (OBJECT::*pmf)(A1, A2) const,Location where=CallbackSequence::END) {
454  checkTypes(typeid(TYPE), typeid(OBJECT), dynamic_cast<OBJECT*>(pointer));
455  add(Callback(pointer).make(pmf),where);
456  }
457  };
458 
460  inline void CallbackSequence::operator()() const {
461  if (!callbacks.empty()) {
462  const void* args[1] = { 0 };
463  for (Callbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i)
464  (*i).execute(args);
465  }
466  }
468  template <typename A0> inline
469  void CallbackSequence::operator()(A0 a0) const {
470  if (!callbacks.empty()) {
471  const void* args[1] = { a0 };
472  for (Callbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i)
473  (*i).execute(args);
474  }
475  }
477  template <typename A0, typename A1> inline
478  void CallbackSequence::operator()(A0 a0, A1 a1) const {
479  if (!callbacks.empty()) {
480  const void* args[2] = { a0, a1 };
481  for (Callbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i)
482  (*i).execute(args);
483  }
484  }
486  template <typename A0, typename A1, typename A2> inline
487  void CallbackSequence::operator()(A0 a0, A1 a1, A2 a2) const {
488  if (!callbacks.empty()) {
489  const void* args[3] = { a0, a1, a2 };
490  for (Callbacks::const_iterator i = callbacks.begin(); i != callbacks.end(); ++i)
491  (*i).execute(args);
492  }
493  }
494 
495 } // End namespace DD4hep
496 #endif // DD4HEP_DDCORE_CALLBACK_H
const Callback & make(void(T::*pmf)(A0, A1, A2))
Callback setup function for Callbacks with const void member functions taking 3 arguments.
Definition: Callback.h:281
void operator()() const
Execution overload for callbacks with no arguments.
Definition: Callback.h:460
unsigned long(* func_t)(void *obj, const void *fun, const void *args[])
Definition: Callback.h:40
const Callback & make(void(T::*pmf)())
Callback setup function for Callbacks with void member functions taking no arguments.
Definition: Callback.h:141
const Callback & make(R(T::*pmf)(A0, A1) const)
Callback setup function for Callbacks with const member functions with explicit return type taking 2 ...
Definition: Callback.h:221
mfunc_t func
Definition: Callback.h:49
const Callback & make(void(T::*pmf)(A))
Callback setup function for Callbacks with void member functions taking 1 argument.
Definition: Callback.h:185
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...
Definition: Callback.h:79
const Callback & make(R(T::*pmf)(A0, A1, A2) const)
Callback setup function for Callbacks with const member functions with explicit return type taking 3 ...
Definition: Callback.h:270
void add(TYPE *pointer, R(OBJECT::*pmf)(A), Location where=CallbackSequence::END)
Add a new callback to a member function with explicit return type and 1 argument. ...
Definition: Callback.h:408
void add(TYPE *pointer, R(OBJECT::*pmf)(A) const, Location where=CallbackSequence::END)
Add a new callback to a const member function with explicit return type and 1 argument.
Definition: Callback.h:420
const Callback & make(void(T::*pmf)(A0, A1) const)
Callback setup function for Callbacks with const void member functions taking 2 arguments.
Definition: Callback.h:244
Callback(void *p)
Constructor with object initialization.
Definition: Callback.h:57
Structure definition to store callback related data.
Definition: Callback.h:42
void add(TYPE *pointer, void(OBJECT::*pmf)(A1, A2) const, Location where=CallbackSequence::END)
Add a new callback to a const void member function with 2 arguments.
Definition: Callback.h:453
void add(TYPE *pointer, R(OBJECT::*pmf)(), Location where=CallbackSequence::END)
Add a new callback to a member function with explicit return type and no arguments.
Definition: Callback.h:382
const Callback & make(void(T::*pmf)(A0, A1))
Callback setup function for Callbacks with const void member functions taking 2 arguments.
Definition: Callback.h:232
unsigned long execute(const void *user_param[]) const
Execute the callback with the required number of user parameters.
Definition: Callback.h:71
void add(const Callback &cb, Location where)
Generically Add a new callback to the sequence depending on the location arguments.
Definition: Callback.h:362
CallbackSequence(const CallbackSequence &c)
Copy constructor.
Definition: Callback.h:342
Definition of an actor on sequences of callbacks.
Definition: Callback.h:334
unsigned long ulong
Definition: Callback.h:45
Callback(void *p, void *mf, func_t c)
Initializing constructor.
Definition: Callback.h:62
const Callback & make(void(T::*pmf)() const)
Callback setup function for Callbacks with const void member functions taking no arguments.
Definition: Callback.h:152
void add(TYPE *pointer, void(OBJECT::*pmf)(A) const, Location where=CallbackSequence::END)
Add a new callback to a const void member function and 1 argument.
Definition: Callback.h:426
Wrapper around a C++ member function pointer.
Definition: Callback.h:92
const Callback & make(void(T::*pmf)(A0, A1, A2) const)
Callback setup function for Callbacks with const void member functions taking 3 arguments.
Definition: Callback.h:293
void add(TYPE *pointer, R(OBJECT::*pmf)(A1, A2), Location where=CallbackSequence::END)
Add a new callback to a member function with explicit return type and 2 arguments.
Definition: Callback.h:435
const Callback & make(void(T::*pmf)(A) const)
Callback setup function for Callbacks with const void member functions taking 1 argument.
Definition: Callback.h:196
static void checkTypes(const std::type_info &typ1, const std::type_info &typ2, void *test)
Check the compatibility of two typed objects. The test is the result of a dynamic_cast.
Definition: Callback.cpp:22
CallbackSequence & operator=(const CallbackSequence &c)
Assignment operator.
Definition: Callback.h:346
void clear()
Clear the sequence and remove all callbacks.
Definition: Callback.h:358
void add(TYPE *pointer, void(OBJECT::*pmf)() const, Location where=CallbackSequence::END)
Add a new callback to a const void member function and no arguments.
Definition: Callback.h:400
const Callback & make(R(T::*pmf)())
Callback setup function for Callbacks with member functions with explicit return type taking no argum...
Definition: Callback.h:121
Definition of the generic callback structure for member functions.
Definition: Callback.h:38
void add(TYPE *pointer, void(OBJECT::*pmf)(A1, A2), Location where=CallbackSequence::END)
Add a new callback to a void member function with 2 arguments.
Definition: Callback.h:447
static Callback make(void *p, T pmf)
Definition: Callback.h:305
Callback()
Default constructor.
Definition: Callback.h:52
bool empty() const
Definition: Callback.h:354
void add(TYPE *pointer, R(OBJECT::*pmf)() const, Location where=CallbackSequence::END)
Add a new callback to a const member function with explicit return type and no arguments.
Definition: Callback.h:388
std::vector< Callback > Callbacks
Definition: Callback.h:335
static T * dyn_cast(P *p, R(T::*)(A))
Definition: Callback.h:316
void add(TYPE *pointer, void(OBJECT::*pmf)(A), Location where=CallbackSequence::END)
Add a new callback to a void member function and 1 argument.
Definition: Callback.h:414
const Callback & make(R(T::*pmf)() const)
Callback setup function for Callbacks with const member functions with explicit return type taking no...
Definition: Callback.h:131
static const T * dyn_cast(const P *p, R(T::*)(A) const)
Definition: Callback.h:319
static mfunc_t pmf(pmf_t f)
Definition: Callback.h:106
const Callback & make(R(T::*pmf)(A) const)
Callback setup function for Callbacks with const member functions with explicit return type taking 1 ...
Definition: Callback.h:175
void add(TYPE *pointer, R(OBJECT::*pmf)(A1, A2) const, Location where=CallbackSequence::END)
Add a new callback to a const member function with explicit return type and 2 arguments.
Definition: Callback.h:441
static const T * dyn_cast(const P *p, R(T::*)() const)
Definition: Callback.h:312
void add(TYPE *pointer, void(OBJECT::*pmf)(), Location where=CallbackSequence::END)
Add a new callback to a void member function with no arguments.
Definition: Callback.h:394
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.
Definition: Callback.h:114
static T * dyn_cast(P *p, R(T::*)())
Definition: Callback.h:309
Union to store pointers to member functions in callback objects.
Definition: Callback.h:96
CallbackSequence()
Default constructor.
Definition: Callback.h:339
static T * cast(void *p)
Template cast function used internally by the wrapper for type conversion to the object's type...
Definition: Callback.h:75