callbacks.h Source File

| Home · All Classes · All Namespaces · Modules · Functions · Files

callbacks.h
1
23 #ifndef _TelepathyQt_callbacks_h_HEADER_GUARD_
24 #define _TelepathyQt_callbacks_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/Functors>
31 #include <TelepathyQt/Global>
32
33 namespace Tp
34 {
35
36 struct TP_QT_EXPORT AbstractFunctorCaller
37 {
38 typedef void *(*HookType)(void*);
39
40 AbstractFunctorCaller(HookType invokeMethodHook) : invokeMethodHook(invokeMethodHook) {}
41 virtual ~AbstractFunctorCaller() {}
42
43 virtual AbstractFunctorCaller *clone() const = 0;
44
45 HookType invokeMethodHook;
46
47 private:
48 AbstractFunctorCaller(const AbstractFunctorCaller &other);
49 AbstractFunctorCaller &operator=(const AbstractFunctorCaller &other);
50 };
51
52 template <class T, class Functor>
53 struct BaseFunctorCaller : public AbstractFunctorCaller
54 {
55 BaseFunctorCaller(const Functor &functor, AbstractFunctorCaller::HookType invokeMethodHook)
56 : AbstractFunctorCaller(invokeMethodHook),
57 functor(functor) {}
58 virtual ~BaseFunctorCaller() {}
59
60 virtual AbstractFunctorCaller *clone() const { return new T(functor); }
61
62 Functor functor;
63 };
64
65 struct TP_QT_EXPORT BaseCallback
66 {
67 BaseCallback() : caller(0) {}
68 /* takes ownership of caller */
69 BaseCallback(AbstractFunctorCaller *caller) : caller(caller) {}
70 BaseCallback(const BaseCallback &other) : caller(other.caller->clone()) {}
71 virtual ~BaseCallback() { delete caller; }
72
73 bool isValid() const { return caller != 0; }
74
75 BaseCallback &operator=(const BaseCallback &other)
76 {
77 if (caller == other.caller) return *this;
78 delete caller;
79 caller = other.caller->clone();
80 return *this;
81 }
82
83 protected:
84 /* may be null */
85 AbstractFunctorCaller *caller;
86 };
87
88 template <class Functor, class R >
89 struct FunctorCaller0 : public BaseFunctorCaller<FunctorCaller0<Functor, R >, Functor>
90 {
91 typedef R ResultType;
92 typedef R (*InvokeType)(AbstractFunctorCaller* );
93
94 explicit FunctorCaller0(const Functor &functor) : BaseFunctorCaller<FunctorCaller0, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller0<Functor, R >::invoke)) {}
95
96 static ResultType invoke(AbstractFunctorCaller *call )
97 {
98 typedef FunctorCaller0<Functor, R > Type;
99 Type *typed = static_cast<Type*>(call);
100 return (typed->functor)();
101 }
102 };
103
104 template <class R >
105 struct Callback0 : public BaseCallback
106 {
107 typedef R (*FunctionType)();
108 typedef R ResultType;
109
110 Callback0() {}
111 template <class Functor>
112 Callback0(const Functor &functor) : BaseCallback(new FunctorCaller0<Functor, R >(functor)) {}
113
114 ResultType operator()() const
115 {
116 if (caller) {
117 typedef R (*InvokeType)(AbstractFunctorCaller* );
118 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
119 return invokeMethod(caller );
120 }
121 return ResultType();
122 }
123 };
124
125 template <class Functor, class R , class Arg1>
126 struct FunctorCaller1 : public BaseFunctorCaller<FunctorCaller1<Functor, R , Arg1>, Functor>
127 {
128 typedef R ResultType;
129 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1);
130
131 explicit FunctorCaller1(const Functor &functor) : BaseFunctorCaller<FunctorCaller1, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller1<Functor, R , Arg1>::invoke)) {}
132
133 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1)
134 {
135 typedef FunctorCaller1<Functor, R , Arg1> Type;
136 Type *typed = static_cast<Type*>(call);
137 return (typed->functor)(a1);
138 }
139 };
140
141 template <class R , class Arg1>
142 struct Callback1 : public BaseCallback
143 {
144 typedef R (*FunctionType)(Arg1);
145 typedef R ResultType;
146
147 Callback1() {}
148 template <class Functor>
149 Callback1(const Functor &functor) : BaseCallback(new FunctorCaller1<Functor, R , Arg1>(functor)) {}
150
151 ResultType operator()(Arg1 a1) const
152 {
153 if (caller) {
154 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1);
155 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
156 return invokeMethod(caller , a1);
157 }
158 return ResultType();
159 }
160 };
161
162 template <class Functor, class R , class Arg1, class Arg2>
163 struct FunctorCaller2 : public BaseFunctorCaller<FunctorCaller2<Functor, R , Arg1, Arg2>, Functor>
164 {
165 typedef R ResultType;
166 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2);
167
168 explicit FunctorCaller2(const Functor &functor) : BaseFunctorCaller<FunctorCaller2, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller2<Functor, R , Arg1, Arg2>::invoke)) {}
169
170 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2)
171 {
172 typedef FunctorCaller2<Functor, R , Arg1, Arg2> Type;
173 Type *typed = static_cast<Type*>(call);
174 return (typed->functor)(a1, a2);
175 }
176 };
177
178 template <class R , class Arg1, class Arg2>
179 struct Callback2 : public BaseCallback
180 {
181 typedef R (*FunctionType)(Arg1, Arg2);
182 typedef R ResultType;
183
184 Callback2() {}
185 template <class Functor>
186 Callback2(const Functor &functor) : BaseCallback(new FunctorCaller2<Functor, R , Arg1, Arg2>(functor)) {}
187
188 ResultType operator()(Arg1 a1, Arg2 a2) const
189 {
190 if (caller) {
191 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2);
192 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
193 return invokeMethod(caller , a1, a2);
194 }
195 return ResultType();
196 }
197 };
198
199 template <class Functor, class R , class Arg1, class Arg2, class Arg3>
200 struct FunctorCaller3 : public BaseFunctorCaller<FunctorCaller3<Functor, R , Arg1, Arg2, Arg3>, Functor>
201 {
202 typedef R ResultType;
203 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3);
204
205 explicit FunctorCaller3(const Functor &functor) : BaseFunctorCaller<FunctorCaller3, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller3<Functor, R , Arg1, Arg2, Arg3>::invoke)) {}
206
207 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2, Arg3 a3)
208 {
209 typedef FunctorCaller3<Functor, R , Arg1, Arg2, Arg3> Type;
210 Type *typed = static_cast<Type*>(call);
211 return (typed->functor)(a1, a2, a3);
212 }
213 };
214
215 template <class R , class Arg1, class Arg2, class Arg3>
216 struct Callback3 : public BaseCallback
217 {
218 typedef R (*FunctionType)(Arg1, Arg2, Arg3);
219 typedef R ResultType;
220
221 Callback3() {}
222 template <class Functor>
223 Callback3(const Functor &functor) : BaseCallback(new FunctorCaller3<Functor, R , Arg1, Arg2, Arg3>(functor)) {}
224
225 ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3) const
226 {
227 if (caller) {
228 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3);
229 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
230 return invokeMethod(caller , a1, a2, a3);
231 }
232 return ResultType();
233 }
234 };
235
236 template <class Functor, class R , class Arg1, class Arg2, class Arg3, class Arg4>
237 struct FunctorCaller4 : public BaseFunctorCaller<FunctorCaller4<Functor, R , Arg1, Arg2, Arg3, Arg4>, Functor>
238 {
239 typedef R ResultType;
240 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4);
241
242 explicit FunctorCaller4(const Functor &functor) : BaseFunctorCaller<FunctorCaller4, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller4<Functor, R , Arg1, Arg2, Arg3, Arg4>::invoke)) {}
243
244 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4)
245 {
246 typedef FunctorCaller4<Functor, R , Arg1, Arg2, Arg3, Arg4> Type;
247 Type *typed = static_cast<Type*>(call);
248 return (typed->functor)(a1, a2, a3, a4);
249 }
250 };
251
252 template <class R , class Arg1, class Arg2, class Arg3, class Arg4>
253 struct Callback4 : public BaseCallback
254 {
255 typedef R (*FunctionType)(Arg1, Arg2, Arg3, Arg4);
256 typedef R ResultType;
257
258 Callback4() {}
259 template <class Functor>
260 Callback4(const Functor &functor) : BaseCallback(new FunctorCaller4<Functor, R , Arg1, Arg2, Arg3, Arg4>(functor)) {}
261
262 ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4) const
263 {
264 if (caller) {
265 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4);
266 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
267 return invokeMethod(caller , a1, a2, a3, a4);
268 }
269 return ResultType();
270 }
271 };
272
273 template <class Functor, class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
274 struct FunctorCaller5 : public BaseFunctorCaller<FunctorCaller5<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5>, Functor>
275 {
276 typedef R ResultType;
277 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5);
278
279 explicit FunctorCaller5(const Functor &functor) : BaseFunctorCaller<FunctorCaller5, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller5<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5>::invoke)) {}
280
281 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5)
282 {
283 typedef FunctorCaller5<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5> Type;
284 Type *typed = static_cast<Type*>(call);
285 return (typed->functor)(a1, a2, a3, a4, a5);
286 }
287 };
288
289 template <class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
290 struct Callback5 : public BaseCallback
291 {
292 typedef R (*FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5);
293 typedef R ResultType;
294
295 Callback5() {}
296 template <class Functor>
297 Callback5(const Functor &functor) : BaseCallback(new FunctorCaller5<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5>(functor)) {}
298
299 ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5) const
300 {
301 if (caller) {
302 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5);
303 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
304 return invokeMethod(caller , a1, a2, a3, a4, a5);
305 }
306 return ResultType();
307 }
308 };
309
310 template <class Functor, class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
311 struct FunctorCaller6 : public BaseFunctorCaller<FunctorCaller6<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>, Functor>
312 {
313 typedef R ResultType;
314 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
315
316 explicit FunctorCaller6(const Functor &functor) : BaseFunctorCaller<FunctorCaller6, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller6<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>::invoke)) {}
317
318 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6)
319 {
320 typedef FunctorCaller6<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6> Type;
321 Type *typed = static_cast<Type*>(call);
322 return (typed->functor)(a1, a2, a3, a4, a5, a6);
323 }
324 };
325
326 template <class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
327 struct Callback6 : public BaseCallback
328 {
329 typedef R (*FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
330 typedef R ResultType;
331
332 Callback6() {}
333 template <class Functor>
334 Callback6(const Functor &functor) : BaseCallback(new FunctorCaller6<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>(functor)) {}
335
336 ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6) const
337 {
338 if (caller) {
339 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
340 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
341 return invokeMethod(caller , a1, a2, a3, a4, a5, a6);
342 }
343 return ResultType();
344 }
345 };
346
347 template <class Functor, class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7>
348 struct FunctorCaller7 : public BaseFunctorCaller<FunctorCaller7<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>, Functor>
349 {
350 typedef R ResultType;
351 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
352
353 explicit FunctorCaller7(const Functor &functor) : BaseFunctorCaller<FunctorCaller7, Functor>(functor, reinterpret_cast<AbstractFunctorCaller::HookType>(&FunctorCaller7<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>::invoke)) {}
354
355 static ResultType invoke(AbstractFunctorCaller *call , Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6, Arg7 a7)
356 {
357 typedef FunctorCaller7<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7> Type;
358 Type *typed = static_cast<Type*>(call);
359 return (typed->functor)(a1, a2, a3, a4, a5, a6, a7);
360 }
361 };
362
363 template <class R , class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7>
364 struct Callback7 : public BaseCallback
365 {
366 typedef R (*FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
367 typedef R ResultType;
368
369 Callback7() {}
370 template <class Functor>
371 Callback7(const Functor &functor) : BaseCallback(new FunctorCaller7<Functor, R , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>(functor)) {}
372
373 ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6, Arg7 a7) const
374 {
375 if (caller) {
376 typedef R (*InvokeType)(AbstractFunctorCaller* , Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
377 InvokeType invokeMethod = reinterpret_cast<InvokeType>(caller->invokeMethodHook);
378 return invokeMethod(caller , a1, a2, a3, a4, a5, a6, a7);
379 }
380 return ResultType();
381 }
382 };
383
384 }
385
386 #endif
Tp::Callback0::ResultType
R ResultType
Definition: callbacks.h:108
Tp::Callback6::FunctionType
R(* FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
Definition: callbacks.h:329
Tp::Callback2::FunctionType
R(* FunctionType)(Arg1, Arg2)
Definition: callbacks.h:181
Tp::Callback1::Callback1
Callback1()
Definition: callbacks.h:147
Tp::Callback4::Callback4
Callback4()
Definition: callbacks.h:258
Tp::BaseCallback
Base class for all the callback classes.
Definition: callbacks.h:65
Tp::Callback1::Callback1
Callback1(const Functor &functor)
Definition: callbacks.h:149
Tp::Callback5::Callback5
Callback5()
Definition: callbacks.h:295
Tp::Callback7
Callback with 7 arguments.
Definition: callbacks.h:364
Tp::Callback4::ResultType
R ResultType
Definition: callbacks.h:256
Tp::BaseFunctorCaller::functor
Functor functor
Definition: callbacks.h:62
Tp::FunctorCaller1::FunctorCaller1
FunctorCaller1(const Functor &functor)
Definition: callbacks.h:131
Tp::FunctorCaller3::ResultType
R ResultType
Definition: callbacks.h:202
Tp::FunctorCaller5::FunctorCaller5
FunctorCaller5(const Functor &functor)
Definition: callbacks.h:279
Tp::FunctorCaller1::ResultType
R ResultType
Definition: callbacks.h:128
Tp::FunctorCaller5::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2, Arg3, Arg4, Arg5)
Definition: callbacks.h:277
Tp::FunctorCaller1::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1)
Definition: callbacks.h:133
Tp::Callback3::FunctionType
R(* FunctionType)(Arg1, Arg2, Arg3)
Definition: callbacks.h:218
Tp::Callback3::operator()
ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3) const
Definition: callbacks.h:225
Tp::FunctorCaller6::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6)
Definition: callbacks.h:318
Tp::FunctorCaller2
Definition: callbacks.h:163
Tp::Callback6::Callback6
Callback6()
Definition: callbacks.h:332
Tp::FunctorCaller7
Definition: callbacks.h:348
Tp::AbstractFunctorCaller::AbstractFunctorCaller
AbstractFunctorCaller(HookType invokeMethodHook)
Definition: callbacks.h:40
Tp::Callback3
Callback with 3 arguments.
Definition: callbacks.h:216
Tp::FunctorCaller5
Definition: callbacks.h:274
Tp::BaseFunctorCaller::clone
virtual AbstractFunctorCaller * clone() const
Definition: callbacks.h:60
Tp::FunctorCaller5::ResultType
R ResultType
Definition: callbacks.h:276
Tp::FunctorCaller2::FunctorCaller2
FunctorCaller2(const Functor &functor)
Definition: callbacks.h:168
Tp::FunctorCaller6::FunctorCaller6
FunctorCaller6(const Functor &functor)
Definition: callbacks.h:316
Tp::Callback6::Callback6
Callback6(const Functor &functor)
Definition: callbacks.h:334
Tp::FunctorCaller4::FunctorCaller4
FunctorCaller4(const Functor &functor)
Definition: callbacks.h:242
Tp::Callback7::operator()
ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6, Arg7 a7) const
Definition: callbacks.h:373
Tp::FunctorCaller0::FunctorCaller0
FunctorCaller0(const Functor &functor)
Definition: callbacks.h:94
Tp::Callback1::FunctionType
R(* FunctionType)(Arg1)
Definition: callbacks.h:144
Tp::Callback3::Callback3
Callback3()
Definition: callbacks.h:221
Tp::FunctorCaller2::ResultType
R ResultType
Definition: callbacks.h:165
Tp::Callback7::Callback7
Callback7()
Definition: callbacks.h:369
Tp::BaseCallback::BaseCallback
BaseCallback(const BaseCallback &other)
Definition: callbacks.h:70
Tp::Callback1::ResultType
R ResultType
Definition: callbacks.h:145
Tp::AbstractFunctorCaller::~AbstractFunctorCaller
virtual ~AbstractFunctorCaller()
Definition: callbacks.h:41
Tp::BaseFunctorCaller::BaseFunctorCaller
BaseFunctorCaller(const Functor &functor, AbstractFunctorCaller::HookType invokeMethodHook)
Definition: callbacks.h:55
Tp::Callback5::Callback5
Callback5(const Functor &functor)
Definition: callbacks.h:297
Tp::FunctorCaller7::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
Definition: callbacks.h:351
Tp::FunctorCaller3::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2, Arg3)
Definition: callbacks.h:203
Tp::BaseCallback::operator=
BaseCallback & operator=(const BaseCallback &other)
Definition: callbacks.h:75
Tp::BaseCallback::~BaseCallback
virtual ~BaseCallback()
Definition: callbacks.h:71
Tp::FunctorCaller5::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5)
Definition: callbacks.h:281
Tp::FunctorCaller6
Definition: callbacks.h:311
Tp::Callback6
Callback with 6 arguments.
Definition: callbacks.h:327
Tp::Callback4::operator()
ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4) const
Definition: callbacks.h:262
Tp::FunctorCaller4
Definition: callbacks.h:237
Tp::Callback3::ResultType
R ResultType
Definition: callbacks.h:219
Tp::BaseFunctorCaller
Definition: callbacks.h:53
Tp::Callback4::Callback4
Callback4(const Functor &functor)
Definition: callbacks.h:260
Tp::FunctorCaller7::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6, Arg7 a7)
Definition: callbacks.h:355
Tp::Callback0::FunctionType
R(* FunctionType)()
Definition: callbacks.h:107
Tp::Callback1::operator()
ResultType operator()(Arg1 a1) const
Definition: callbacks.h:151
Tp::FunctorCaller1
Definition: callbacks.h:126
Tp::Callback4::FunctionType
R(* FunctionType)(Arg1, Arg2, Arg3, Arg4)
Definition: callbacks.h:255
Tp::BaseFunctorCaller::~BaseFunctorCaller
virtual ~BaseFunctorCaller()
Definition: callbacks.h:58
Tp::FunctorCaller7::FunctorCaller7
FunctorCaller7(const Functor &functor)
Definition: callbacks.h:353
Tp::FunctorCaller4::ResultType
R ResultType
Definition: callbacks.h:239
Tp::Callback2
Callback with 2 arguments.
Definition: callbacks.h:179
Tp::Callback6::operator()
ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5, Arg6 a6) const
Definition: callbacks.h:336
Tp::Callback0
Callback with 0 arguments.
Definition: callbacks.h:105
Tp::BaseCallback::caller
AbstractFunctorCaller * caller
Definition: callbacks.h:85
Tp::FunctorCaller0::ResultType
R ResultType
Definition: callbacks.h:91
Tp::Callback2::Callback2
Callback2(const Functor &functor)
Definition: callbacks.h:186
Tp::Callback6::ResultType
R ResultType
Definition: callbacks.h:330
Tp::Callback0::Callback0
Callback0(const Functor &functor)
Definition: callbacks.h:112
Tp::Callback5
Callback with 5 arguments.
Definition: callbacks.h:290
Tp::AbstractFunctorCaller::clone
virtual AbstractFunctorCaller * clone() const =0
Tp::AbstractFunctorCaller::invokeMethodHook
HookType invokeMethodHook
Definition: callbacks.h:45
Tp::FunctorCaller3::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2, Arg3 a3)
Definition: callbacks.h:207
Tp::Callback3::Callback3
Callback3(const Functor &functor)
Definition: callbacks.h:223
Tp::Callback5::ResultType
R ResultType
Definition: callbacks.h:293
Tp::AbstractFunctorCaller
Definition: callbacks.h:36
Tp::FunctorCaller2::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2)
Definition: callbacks.h:170
Tp::FunctorCaller1::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1)
Definition: callbacks.h:129
Tp::FunctorCaller0
Definition: callbacks.h:89
Tp::Callback0::Callback0
Callback0()
Definition: callbacks.h:110
Tp::AbstractFunctorCaller::HookType
void *(* HookType)(void *)
Definition: callbacks.h:38
Tp::Callback0::operator()
ResultType operator()() const
Definition: callbacks.h:114
Tp::Callback1
Callback with 1 argument.
Definition: callbacks.h:142
Tp::FunctorCaller3::FunctorCaller3
FunctorCaller3(const Functor &functor)
Definition: callbacks.h:205
Tp::FunctorCaller3
Definition: callbacks.h:200
Tp::Callback5::FunctionType
R(* FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5)
Definition: callbacks.h:292
Tp::Callback7::FunctionType
R(* FunctionType)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
Definition: callbacks.h:366
Tp::FunctorCaller4::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2, Arg3, Arg4)
Definition: callbacks.h:240
Tp::Callback2::operator()
ResultType operator()(Arg1 a1, Arg2 a2) const
Definition: callbacks.h:188
Tp::FunctorCaller7::ResultType
R ResultType
Definition: callbacks.h:350
Tp::FunctorCaller0::invoke
static ResultType invoke(AbstractFunctorCaller *call)
Definition: callbacks.h:96
Tp::Callback2::ResultType
R ResultType
Definition: callbacks.h:182
Tp::BaseCallback::BaseCallback
BaseCallback(AbstractFunctorCaller *caller)
Definition: callbacks.h:69
Tp::BaseCallback::BaseCallback
BaseCallback()
Definition: callbacks.h:67
Tp::FunctorCaller6::ResultType
R ResultType
Definition: callbacks.h:313
Tp::FunctorCaller2::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2)
Definition: callbacks.h:166
Tp::Callback2::Callback2
Callback2()
Definition: callbacks.h:184
Tp::Callback5::operator()
ResultType operator()(Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4, Arg5 a5) const
Definition: callbacks.h:299
Tp::BaseCallback::isValid
bool isValid() const
Definition: callbacks.h:73
Tp::Callback7::Callback7
Callback7(const Functor &functor)
Definition: callbacks.h:371
Tp::FunctorCaller4::invoke
static ResultType invoke(AbstractFunctorCaller *call, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4)
Definition: callbacks.h:244
Tp::Callback7::ResultType
R ResultType
Definition: callbacks.h:367
Tp::FunctorCaller6::InvokeType
R(* InvokeType)(AbstractFunctorCaller *, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
Definition: callbacks.h:314
Tp::FunctorCaller0::InvokeType
R(* InvokeType)(AbstractFunctorCaller *)
Definition: callbacks.h:92
Tp::Callback4
Callback with 4 arguments.
Definition: callbacks.h:253