MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TFunctor.hxx
Go to the documentation of this file.
1 #ifndef _TFUNCTOR_
2 #define _TFUNCTOR_
3 using namespace std;
4 
10 
18 class TFunctor
19 {
20  public:
21  virtual void operator()()=0;
22  virtual void Call()=0;
23  virtual ~TFunctor(){};
24 };
25 
27 
34 template <class T> class TSpecificFunctor : public TFunctor
35 {
36  public:
37  TSpecificFunctor(T* _pt2Object, void(T::*_fpt)()){pt2Object = _pt2Object; fpt=_fpt; }
38  virtual void operator()(){(*pt2Object.*fpt)();}
39  virtual void Call(){(*pt2Object.*fpt)();}
40  virtual void SetObj(T* obj){pt2Object = obj;}
41 
42  private:
43  void (T::*fpt)();
44  T* pt2Object;
45 };
46 #endif
Template class to assign a method of class T as argument.
Definition: TFunctor.hxx:34
virtual ~TFunctor()
Definition: TFunctor.hxx:23
virtual void SetObj(T *obj)
Set the object to the pointer.
Definition: TFunctor.hxx:40
TSpecificFunctor(T *_pt2Object, void(T::*_fpt)())
Normal Constructor.
Definition: TFunctor.hxx:37
T * pt2Object
pointer to object
Definition: TFunctor.hxx:44
virtual void Call()
override function &quot;Call&quot;
Definition: TFunctor.hxx:39
virtual void operator()()
override operator &quot;()&quot;
Definition: TFunctor.hxx:38
Abstract class to define Functor (function of function).
Definition: TFunctor.hxx:18

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014