26 #define FFaDynCB0M(ownerType, ownerPt, methodName) \
27 FFaDynCB0(new FFaMethodCB0< ownerType > (ownerPt, &ownerType::methodName))
28 #define FFaDynCB1M(ownerType, ownerPt, methodName, P1Type) \
29 FFaDynCB1 < P1Type > (new FFaMethodCB1< ownerType , P1Type > (ownerPt, &ownerType::methodName))
30 #define FFaDynCB2M(ownerType, ownerPt, methodName, P1Type, P2Type) \
31 FFaDynCB2 < P1Type, P2Type > (new FFaMethodCB2< ownerType , P1Type , P2Type > (ownerPt, &ownerType::methodName))
32 #define FFaDynCB3M(ownerType, ownerPt, methodName, P1Type, P2Type, P3Type) \
33 FFaDynCB3 < P1Type, P2Type, P3Type > (new FFaMethodCB3< ownerType , P1Type , P2Type , P3Type > (ownerPt, &ownerType::methodName))
34 #define FFaDynCB4M(ownerType, ownerPt, methodName, P1Type, P2Type, P3Type, P4Type) \
35 FFaDynCB4 < P1Type, P2Type, P3Type, P4Type > (new FFaMethodCB4< ownerType , P1Type , P2Type , P3Type, P4Type > (ownerPt, &ownerType::methodName))
37 #define FFaDynCB0S(function) \
38 FFaDynCB0(new FFaStaticCB0 (function))
39 #define FFaDynCB1S(function, P1Type) \
40 FFaDynCB1 < P1Type > (new FFaStaticCB1 < P1Type > (function))
41 #define FFaDynCB2S(function, P1Type, P2Type) \
42 FFaDynCB2 < P1Type, P2Type > (new FFaStaticCB2 < P1Type , P2Type > (function))
43 #define FFaDynCB3S(function, P1Type, P2Type, P3Type) \
44 FFaDynCB3 < P1Type, P2Type, P3Type > (new FFaStaticCB3 < P1Type , P2Type , P3Type > (function))
45 #define FFaDynCB4S(function, P1Type, P2Type, P3Type, P4Type) \
46 FFaDynCB4 < P1Type, P2Type, P3Type, P4Type > (new FFaStaticCB4 < P1Type , P2Type , P3Type, P4Type > (function))
61 #define FFADYNCB_H_TEMPLATE1 template< class P1Type >
62 #define FFADYNCB_H_ADDED_TEMPLATE_ARGS1 , class P1Type
63 #define FFADYNCB_H_TYPE_LIST1 < P1Type >
64 #define FFADYNCB_H_ADDED_TYPE_LIST1 , P1Type
65 #define FFADYNCB_H_ARGUMENT_LIST1 P1Type p1
66 #define FFADYNCB_H_PARAM_LIST1 p1
71 #define FFADYNCB_H_TEMPLATE2 template< class P1Type, class P2Type >
72 #define FFADYNCB_H_ADDED_TEMPLATE_ARGS2 , class P1Type, class P2Type
73 #define FFADYNCB_H_TYPE_LIST2 < P1Type, P2Type >
74 #define FFADYNCB_H_ADDED_TYPE_LIST2 , P1Type, P2Type
75 #define FFADYNCB_H_ARGUMENT_LIST2 P1Type p1, P2Type p2
76 #define FFADYNCB_H_PARAM_LIST2 p1, p2
80 #define FFADYNCB_H_TEMPLATE3 template< class P1Type, class P2Type , class P3Type >
81 #define FFADYNCB_H_ADDED_TEMPLATE_ARGS3 , class P1Type, class P2Type, class P3Type
82 #define FFADYNCB_H_TYPE_LIST3 < P1Type, P2Type , P3Type >
83 #define FFADYNCB_H_ADDED_TYPE_LIST3 , P1Type, P2Type, P3Type
84 #define FFADYNCB_H_ARGUMENT_LIST3 P1Type p1, P2Type p2, P3Type p3
85 #define FFADYNCB_H_PARAM_LIST3 p1, p2, p3
89 #define FFADYNCB_H_TEMPLATE4 template< class P1Type, class P2Type , class P3Type, class P4Type >
90 #define FFADYNCB_H_ADDED_TEMPLATE_ARGS4 , class P1Type, class P2Type, class P3Type, class P4Type
91 #define FFADYNCB_H_TYPE_LIST4 < P1Type, P2Type , P3Type, P4Type >
92 #define FFADYNCB_H_ADDED_TYPE_LIST4 , P1Type, P2Type, P3Type, P4Type
93 #define FFADYNCB_H_ARGUMENT_LIST4 P1Type p1, P2Type p2, P3Type p3, P4Type p4
94 #define FFADYNCB_H_PARAM_LIST4 p1, p2, p3, p4
103 #define MAKE_BASE_DYNCB(nr, templateDef, argumentList) \
105 templateDef class FFaBaseDynCB##nr \
108 FFaBaseDynCB##nr () {} \
109 virtual ~FFaBaseDynCB##nr () {} \
111 virtual void invoke (argumentList) = 0; \
112 virtual FFaBaseDynCB##nr * copy () const = 0; \
123 #define MAKE_METHODCB(nr, addedTemplateArgs, argumentList, parameterList, typeList, addedTypeList) \
125 template<class T addedTemplateArgs> class FFaMethodCB##nr : public FFaBaseDynCB##nr typeList \
127 typedef void (T::*methodType) (argumentList); \
130 FFaMethodCB##nr (T* anObj, methodType aMethod) : myObject(anObj), myMethodPt(aMethod) {} \
131 virtual ~FFaMethodCB##nr () {} \
133 virtual void invoke (argumentList) { if (myObject) (myObject->*this->myMethodPt) (parameterList); } \
135 virtual FFaBaseDynCB##nr typeList * copy () const \
137 return new FFaMethodCB##nr <T addedTypeList> (myObject, myMethodPt); \
142 methodType myMethodPt; \
152 #define MAKE_STATICCB(nr, templateDef, argumentList, parameterList, typeList) \
154 templateDef class FFaStaticCB##nr : public FFaBaseDynCB##nr typeList \
156 typedef void (*functionType)(argumentList); \
159 FFaStaticCB##nr (functionType aFunction) : myFunctionPt(aFunction) {} \
160 virtual ~FFaStaticCB##nr () {} \
162 virtual void invoke (argumentList) { myFunctionPt(parameterList); } \
164 virtual FFaBaseDynCB##nr typeList * copy () const \
166 return new FFaStaticCB##nr typeList (myFunctionPt); \
170 functionType myFunctionPt; \
180 #define MAKE_DYNCB(nr, templateDef, argumentList, parameterList, typeList) \
182 templateDef class FFaDynCB##nr \
185 FFaDynCB##nr (FFaBaseDynCB##nr typeList *aBaseDynCB = 0) : myBaseDynCBPtr(aBaseDynCB) {} \
186 FFaDynCB##nr (const FFaDynCB##nr typeList &rhs) \
188 myBaseDynCBPtr = rhs.myBaseDynCBPtr ? rhs.myBaseDynCBPtr->copy() : 0; \
190 ~FFaDynCB##nr () { if (myBaseDynCBPtr) delete myBaseDynCBPtr; } \
192 void invoke(argumentList) { if (myBaseDynCBPtr) myBaseDynCBPtr->invoke(parameterList); } \
194 FFaDynCB##nr &operator= (const FFaDynCB##nr typeList &rhs) \
198 if (myBaseDynCBPtr) delete myBaseDynCBPtr; \
199 myBaseDynCBPtr = rhs.myBaseDynCBPtr ? rhs.myBaseDynCBPtr->copy() : 0; \
204 bool empty() const { return myBaseDynCBPtr == 0; } \
205 void erase() { if (myBaseDynCBPtr) delete myBaseDynCBPtr; myBaseDynCBPtr = 0; } \
206 FFaDynCB##nr* copy() const { return new FFaDynCB##nr (*this); } \
209 FFaBaseDynCB##nr typeList *myBaseDynCBPtr; \
#define FFADYNCB_H_PARAM_LIST1
Definition: FFaDynCB.H:66
#define FFADYNCB_H_ADDED_TEMPLATE_ARGS4
Definition: FFaDynCB.H:90
#define FFADYNCB_H_TYPE_LIST3
Definition: FFaDynCB.H:82
#define FFADYNCB_H_PARAM_LIST4
Definition: FFaDynCB.H:94
#define FFADYNCB_H_TYPE_LIST4
Definition: FFaDynCB.H:91
#define FFADYNCB_H_ARGUMENT_LIST4
Definition: FFaDynCB.H:93
#define MAKE_DYNCB(nr, templateDef, argumentList, parameterList, typeList)
Definition: FFaDynCB.H:180
#define FFADYNCB_H_TEMPLATE2
Definition: FFaDynCB.H:71
#define FFADYNCB_H_TEMPLATE3
Definition: FFaDynCB.H:80
#define FFADYNCB_H_TEMPLATE4
Definition: FFaDynCB.H:89
#define FFADYNCB_H_PARAM_LIST3
Definition: FFaDynCB.H:85
#define MAKE_BASE_DYNCB(nr, templateDef, argumentList)
Definition: FFaDynCB.H:103
#define FFADYNCB_H_ADDED_TYPE_LIST4
Definition: FFaDynCB.H:92
#define FFADYNCB_H_ADDED_TYPE_LIST2
Definition: FFaDynCB.H:74
#define FFADYNCB_H_ARGUMENT_LIST1
Definition: FFaDynCB.H:65
#define FFADYNCB_H_PARAM_LIST2
Definition: FFaDynCB.H:76
#define FFADYNCB_H_ADDED_TEMPLATE_ARGS1
Definition: FFaDynCB.H:62
#define FFADYNCB_H_ARGUMENT_LIST2
Definition: FFaDynCB.H:75
#define MAKE_METHODCB(nr, addedTemplateArgs, argumentList, parameterList, typeList, addedTypeList)
Definition: FFaDynCB.H:123
#define FFADYNCB_H_ADDED_TYPE_LIST1
Definition: FFaDynCB.H:64
#define FFADYNCB_H_ADDED_TEMPLATE_ARGS2
Definition: FFaDynCB.H:72
#define FFADYNCB_H_TYPE_LIST1
Definition: FFaDynCB.H:63
#define FFADYNCB_H_ADDED_TYPE_LIST3
Definition: FFaDynCB.H:83
#define FFADYNCB_H_TYPE_LIST2
Definition: FFaDynCB.H:73
#define MAKE_STATICCB(nr, templateDef, argumentList, parameterList, typeList)
Definition: FFaDynCB.H:152
#define FFADYNCB_H_ARGUMENT_LIST3
Definition: FFaDynCB.H:84
#define FFADYNCB_H_ADDED_TEMPLATE_ARGS3
Definition: FFaDynCB.H:81
#define FFADYNCB_H_TEMPLATE1
Definition: FFaDynCB.H:61