OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
functor.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1996 by Borland International, All Rights Reserved
4// Copyright (c) 1998 by Yura Bidus, All Rights Reserved
5//
6/// \file
7/// C++ Functor template implementation
8///
9/// The templates meant for actual end use are:
10///
11/// Void return, N arguments
12/// \code
13/// TFunctorV0
14/// TFunctorV1<P1>
15/// TFunctorV2<P1,P2>
16/// TFunctorV3<P1,P2,P3>
17/// TFunctorV4<P1,P2,P3,P4>
18/// TFunctorV5<P1,P2,P3,P4,P5>
19/// \endcode
20///
21/// Return R, N arguments
22/// \code
23/// TFunctor0<R>
24/// TFunctor1<R,P1>
25/// TFunctor2<R,P1,P2>
26/// TFunctor3<R,P1,P2,P3>
27/// TFunctor4<R,P1,P2,P3,P4>
28/// TFunctor5<R,P1,P2,P3,P4,P5>
29/// \endcode
30///
31/// The Functor() template function is invoked to create a temporary translator
32/// to initialize the actual functor. Currently, the first argument to Functor()
33/// must be a dummy pointer to the desired TFunctor template. When templatized
34/// member functions are available, this arg will be eliminated.
35///
36/// Based on Functors described in
37/// Rich Hickey's 'Callbacks in C++ using template functors' Feb 95 C++ Report
38//
39//------------------------------------------------------------------------------
40
41#if !defined(BDTF_H) && !defined(OWL_FUNCTOR_H)
42#define BDTF_H
43#define OWL_FUNCTOR_H
44
45#include <owl/private/defs.h>
46#if defined(BI_HAS_PRAGMA_ONCE)
47# pragma once
48#endif
49
50#include <ctype.h> // get size_t definition
51
52#if defined(BI_NO_LVAL_CASTS)
53#define THUNKREF(th) th
54#else
55#define THUNKREF(th) const th &
56#endif
57
60
61namespace owl {
62
63#include <owl/preclass.h>
64
65//
66/// Base functor class holds all of the actual data
67//
69 public:
70 operator bool() const {return Func || Callee;}
71 typedef void (TFunctorBase::*TMemberFunc)();
72
74 : Func(nullptr),Callee(nullptr) {}
75 TFunctorBase(const void* c, const void* f, size_t sz);
76
77 union {
78 const void* Func;
79 char MemberFunc[sizeof(TMemberFunc)]; ///< ASSUMES this is always enough space
80 };
81 void* Callee;
82};
83
84//------------------------------------------------------------------------------
85/// Functor with 0 parameters, void return
86
87class TFunctorV0 : public TFunctorBase {
88 public:
90 void operator()() const {
91 Thunk(*this);
92 }
93
94 protected:
95 typedef void (*TThunk)(const TFunctorBase&);
96 TFunctorV0(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
97 : TFunctorBase(c,f,sz), Thunk(t) {}
98
99 private:
100 TThunk Thunk;
101};
102
103template <class Funct>
105 public:
107
108 static void Thunk(const TFunctorBase& ftor)
109 {
110 (Funct(ftor.Func))();
111 }
112};
113
114template <class TCallee, class TMemFunc>
116 public:
117 TMemberTranslatorV0(TCallee& c, const TMemFunc& mf)
118 : TFunctorV0(Thunk, &c, &mf, sizeof(TMemFunc)) {}
119
120 static void Thunk(const TFunctorBase& ftor)
121 {
122 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
123 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
124 (callee->*memFunc)();
125 }
126};
127
128template <class TRT>
129inline TFunctorV0
130Functor(TFunctorV0*, TRT(*f)())
131{
133}
134
135template <class TCallee, class TRT, class TCallType>
136inline TFunctorV0
137Functor(TFunctorV0*, TCallee& c, TRT(TCallType::* const& f)())
138{
139 typedef TRT (TCallType::*TMemFunc)();
141}
142
143template <class TCallee, class TRT, class TCallType>
144inline TFunctorV0
145Functor(TFunctorV0*, const TCallee& c, TRT(TCallType::* const& f)() const)
146{
147 typedef TRT (TCallType::*TMemFunc)() const;
149}
150
151//------------------------------------------------------------------------------
152/// Functor with 0 parameters, return R
153
154template <class R>
155class TFunctor0 : public TFunctorBase{
156 public:
158
159 R operator()() const {
160 return Thunk(*this);
161 }
162
163 protected:
164 typedef R (*TThunk)(const TFunctorBase&);
165 TFunctor0(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
166 : TFunctorBase(c,f,sz), Thunk(t) {}
167
168 private:
169 TThunk Thunk;
170};
171
172template <class R, class Funct>
174 public:
175 TFunctionTranslator0(Funct f) : TFunctor0<R>(Thunk,0,(void*)f,0) {}
176
177 static R Thunk(const TFunctorBase& ftor)
178 {
179 return (Funct(ftor.Func))();
180 }
181};
182
183template <class R, class TCallee, class TMemFunc>
185 public:
186 TMemberTranslator0(TCallee& c, const TMemFunc& mf)
187 : TFunctor0<R>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
188
189 static R Thunk(const TFunctorBase& ftor)
190 {
191 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
192 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
193 return (callee->*memFunc)();
194 }
195};
196
197template <class R, class TRT>
198inline TFunctor0<R>
200{
202}
203
204template <class R, class TCallee, class TRT, class TCallType>
205inline TFunctor0<R>
206Functor(TFunctor0<R>*, TCallee& c, TRT(TCallType::* const& f)())
207{
208 typedef TRT (TCallType::*TMemFunc)();
210}
211
212template <class R, class TCallee, class TRT, class TCallType>
213inline TFunctor0<R>
214Functor(TFunctor0<R>*, const TCallee& c, TRT(TCallType::* const& f)() const)
215{
216 typedef TRT (TCallType::*TMemFunc)() const;
218}
219
220//------------------------------------------------------------------------------
221/// Functor with 1 parameter, void return
222
223template <class P1>
225 public:
227
228 void operator()(P1 p1) const
229 {
230 Thunk(*this, p1);
231 }
232
233 protected:
234 typedef void (*TThunk)(const TFunctorBase&, P1);
235 TFunctorV1(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
236 : TFunctorBase(c,f,sz), Thunk(t) {}
237
238 private:
239 TThunk Thunk;
240};
241
242template <class P1, class Funct>
244 public:
245 TFunctionTranslatorV1(Funct f) : TFunctorV1<P1>(Thunk,0,(void*)f,0) {}
246
247 static void Thunk(const TFunctorBase& ftor, P1 p1)
248 {
249 (Funct(ftor.Func))(p1);
250 }
251};
252
253template <class P1, class TCallee, class TMemFunc>
255 public:
256 TMemberTranslatorV1(TCallee& c, const TMemFunc& mf)
257 : TFunctorV1<P1>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
258
259 static void Thunk(const TFunctorBase& ftor, P1 p1)
260 {
261 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
262 TMemFunc& memFunc(*reinterpret_cast<TMemFunc*>((void*)ftor.MemberFunc));
263 (callee->*memFunc)(p1);
264 }
265};
266
267template <class P1, class TRT, class TP1>
268inline TFunctorV1<P1>
269Functor(TFunctorV1<P1>*, TRT(*f)(TP1))
270{
272}
273
274template <class P1, class TCallee, class TRT, class TCallType, class TP1>
275inline TFunctorV1<P1>
276Functor(TFunctorV1<P1>*, TCallee& c, TRT (TCallType::* const& f)(TP1))
277{
278 typedef TRT (TCallType::*TMemFunc)(TP1);
280}
281
282template <class P1, class TCallee, class TRT, class TCallType, class TP1>
283inline TFunctorV1<P1>
284Functor(TFunctorV1<P1>*, const TCallee& c, TRT(TCallType::* const& f)(TP1) const)
285{
286 typedef TRT (TCallType::*TMemFunc)(TP1) const;
288}
289
290//------------------------------------------------------------------------------
291/// Functor with 1 parameter, return R
292
293template <class R, class P1>
294class TFunctor1 : public TFunctorBase{
295 public:
297
298 R operator()(P1 p1) const
299 {
300 return Thunk(*this, p1);
301 }
302
303 protected:
304 typedef R (*TThunk)(const TFunctorBase&, P1);
305 TFunctor1(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
306 : TFunctorBase(c,f,sz), Thunk(t) {}
307
308 private:
309 TThunk Thunk;
310};
311
312template <class R, class P1, class Funct>
313class TFunctionTranslator1 : public TFunctor1<R,P1>{
314 public:
315 TFunctionTranslator1(Funct f) : TFunctor1<R,P1>(Thunk,nullptr,(void*)f,0) {}
316
317 static R Thunk(const TFunctorBase& ftor, P1 p1)
318 {
319 return (Funct(ftor.Func))(p1);
320 }
321};
322
323template <class R, class P1, class TCallee, class TMemFunc>
324class TMemberTranslator1 : public TFunctor1<R,P1>{
325 public:
326 TMemberTranslator1(TCallee& c, const TMemFunc& mf)
327 : TFunctor1<R,P1>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
328
329 static R Thunk(const TFunctorBase& ftor, P1 p1)
330 {
331 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
332 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
333 return (callee->*memFunc)(p1);
334 }
335};
336
337template <class R, class P1, class TRT, class TP1>
338inline TFunctor1<R,P1>
340{
342}
343
344template <class R, class P1, class TCallee, class TRT, class TCallType, class TP1>
345inline TFunctor1<R,P1>
346Functor(TFunctor1<R,P1>*, TCallee& c, TRT(TCallType::* const& f)(TP1))
347{
348 typedef TRT (TCallType::*TMemFunc)(TP1);
350}
351
352template <class R, class P1, class TCallee, class TRT, class TCallType, class TP1>
353inline TFunctor1<R,P1>
354Functor(TFunctor1<R,P1>*, const TCallee& c, TRT(TCallType::* const& f)(TP1) const)
355{
356 typedef TRT (TCallType::*TMemFunc)(TP1) const;
358}
359
360//------------------------------------------------------------------------------
361/// Functor with 2 parameters, void return
362
363template <class P1, class P2>
365 public:
367
368 void operator()(P1 p1, P2 p2) const
369 {
370 Thunk(*this, p1, p2);
371 }
372
373 protected:
374 typedef void (*TThunk)(const TFunctorBase&, P1, P2);
375 TFunctorV2(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
376 : TFunctorBase(c,f,sz), Thunk(t) {}
377
378 private:
379 TThunk Thunk;
380};
381
382template <class P1, class P2, class Funct>
383class TFunctionTranslatorV2 : public TFunctorV2<P1,P2>{
384 public:
385 TFunctionTranslatorV2(Funct f) : TFunctorV2<P1,P2>(Thunk,0,(void*)f,0) {}
386
387 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2)
388 {
389 (Funct(ftor.Func))(p1, p2);
390 }
391};
392
393template <class P1, class P2, class TCallee, class TMemFunc>
394class TMemberTranslatorV2 : public TFunctorV2<P1,P2>{
395 public:
396 TMemberTranslatorV2(TCallee& c, const TMemFunc& mf)
397 : TFunctorV2<P1,P2>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
398
399 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2)
400 {
401 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
402 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
403 (callee->*memFunc)(p1, p2);
404 }
405};
406
407template <class P1, class P2, class TRT, class TP1, class TP2>
408inline TFunctorV2<P1,P2>
413
414template <class P1, class P2,
415 class TCallee, class TRT, class TCallType,
416 class TP1, class TP2>
417inline TFunctorV2<P1,P2>
418Functor(TFunctorV2<P1,P2>*, TCallee& c, TRT (TCallType::* const& f)(TP1,TP2))
419{
420 typedef TRT (TCallType::*TMemFunc)(TP1,TP2);
422}
423
424template <class P1, class P2,
425 class TCallee, class TRT, class TCallType,
426 class TP1, class TP2>
427inline TFunctorV2<P1,P2>
428Functor(TFunctorV2<P1,P2>*, const TCallee& c, TRT(TCallType::* const& f)(TP1,TP2) const)
429{
430 typedef TRT (TCallType::*TMemFunc)(TP1,TP2) const;
432}
433
434//------------------------------------------------------------------------------
435/// Functor with 2 parameters, return R
436
437template <class R, class P1, class P2>
438class TFunctor2 : public TFunctorBase{
439 public:
441
442 R operator()(P1 p1, P2 p2) const
443 {
444 return Thunk(*this, p1, p2);
445 }
446
447 operator bool() const {return bool();} //JJH exported for COOLEDIT
448
449 protected:
450 typedef R (*TThunk)(const TFunctorBase&, P1, P2);
451 TFunctor2(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
452 : TFunctorBase(c,f,sz), Thunk(t) {}
453
454 private:
455 TThunk Thunk;
456};
457
458template <class R, class P1, class P2, class Funct>
459class TFunctionTranslator2 : public TFunctor2<R,P1,P2>{
460 public:
461 TFunctionTranslator2(Funct f) : TFunctor2<R,P1,P2>(Thunk,0,(void*)f,0) {}
462
463 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2)
464 {
465 return (Funct(ftor.Func))(p1, p2);
466 }
467};
468
469template <class R, class P1, class P2, class TCallee, class TMemFunc>
470class TMemberTranslator2 : public TFunctor2<R,P1,P2>{
471 public:
472 TMemberTranslator2(TCallee& c, const TMemFunc& mf)
473 : TFunctor2<R,P1,P2>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
474
475 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2)
476 {
477 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
478 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
479 return (callee->*memFunc)(p1, p2);
480 }
481};
482
483template <class R, class P1, class P2, class TRT, class TP1, class TP2>
484inline TFunctor2<R,P1,P2>
489
490template <class R, class P1, class P2,
491 class TCallee, class TRT, class TCallType,
492 class TP1, class TP2>
493inline TFunctor2<R,P1,P2>
494Functor(TFunctor2<R,P1,P2>*, TCallee& c, TRT(TCallType::* const& f)(TP1,TP2))
495{
496 typedef TRT (TCallType::*TMemFunc)(TP1,TP2);
498}
499
500template <class R, class P1, class P2,
501 class TCallee, class TRT, class TCallType,
502 class TP1, class TP2>
503inline TFunctor2<R,P1,P2>
504Functor(TFunctor2<R,P1,P2>*, const TCallee& c, TRT(TCallType::* const& f)(TP1,TP2) const)
505{
506 typedef TRT (TCallType::*TMemFunc)(TP1,TP2) const;
508}
509
510//------------------------------------------------------------------------------
511/// Functor with 3 parameters, void return
512
513template <class P1, class P2, class P3>
515 public:
517
518 void operator()(P1 p1, P2 p2, P3 p3) const
519 {
520 Thunk(*this, p1, p2, p3);
521 }
522
523 protected:
524 typedef void (*TThunk)(const TFunctorBase&, P1, P2, P3);
525 TFunctorV3(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
526 : TFunctorBase(c,f,sz), Thunk(t) {}
527
528 private:
529 TThunk Thunk;
530};
531
532template <class P1, class P2, class P3, class Funct>
533class TFunctionTranslatorV3 : public TFunctorV3<P1,P2,P3>{
534 public:
535 TFunctionTranslatorV3(Funct f) : TFunctorV3<P1,P2,P3>(Thunk,0,(void*)f,0) {}
536
537 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3)
538 {
539 (Funct(ftor.Func))(p1, p2, p3);
540 }
541};
542
543template <class P1, class P2, class P3, class TCallee, class TMemFunc>
544class TMemberTranslatorV3 : public TFunctorV3<P1,P2,P3>{
545 public:
546 TMemberTranslatorV3(TCallee& c, const TMemFunc& mf)
547 : TFunctorV3<P1,P2,P3>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
548
549 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3)
550 {
551 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
552 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
553 (callee->*memFunc)(p1, p2, p3);
554 }
555};
556
557template <class P1, class P2, class P3,
558 class TRT, class TP1, class TP2, class TP3>
559inline TFunctorV3<P1,P2,P3>
564
565template <class P1, class P2, class P3,
566 class TCallee, class TRT, class CallType,
567 class TP1, class TP2, class TP3>
568inline TFunctorV3<P1,P2,P3>
569Functor(TFunctorV3<P1,P2,P3>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3))
570{
571 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3);
573}
574
575template <class P1, class P2, class P3,
576 class TCallee, class TRT, class CallType,
577 class TP1, class TP2, class TP3>
578inline TFunctorV3<P1,P2,P3>
579Functor(TFunctorV3<P1,P2,P3>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3) const)
580{
581 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3) const;
583}
584
585//------------------------------------------------------------------------------
586/// Functor with 3 parameters, return R
587
588template <class R, class P1, class P2, class P3>
589class TFunctor3 : public TFunctorBase{
590 public:
592
593 R operator()(P1 p1, P2 p2, P3 p3) const
594 {
595 return Thunk(*this, p1, p2, p3);
596 }
597
598 protected:
599 typedef R (*TThunk)(const TFunctorBase&, P1, P2, P3);
600 TFunctor3(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
601 : TFunctorBase(c,f,sz), Thunk(t) {}
602
603 private:
604 TThunk Thunk;
605};
606
607template <class R, class P1, class P2, class P3, class Funct>
608class TFunctionTranslator3 : public TFunctor3<R,P1,P2,P3>{
609 public:
610 TFunctionTranslator3(Funct f) : TFunctor3<R,P1,P2,P3>(Thunk,nullptr,(void*)f,0) {}
611
612 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3)
613 {
614 return (Funct(ftor.Func))(p1, p2, p3);
615 }
616};
617
618template <class R, class P1, class P2, class P3, class TCallee, class TMemFunc>
619class TMemberTranslator3 : public TFunctor3<R,P1,P2,P3>{
620 public:
621 TMemberTranslator3(TCallee& c, const TMemFunc& mf)
622 : TFunctor3<R,P1,P2,P3>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
623
624 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3)
625 {
626 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
627 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
628 return (callee->*memFunc)(p1, p2, p3);
629 }
630};
631
632template <class R, class P1, class P2, class P3,
633 class TRT, class TP1, class TP2, class TP3>
634inline TFunctor3<R,P1,P2,P3>
639
640template <class R, class P1, class P2, class P3,
641 class TCallee, class TRT, class CallType,
642 class TP1, class TP2, class TP3>
643inline TFunctor3<R,P1,P2,P3>
644Functor(TFunctor3<R,P1,P2,P3>*, TCallee& c, TRT (CallType::* const& f)(TP1,TP2,TP3))
645{
646 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3);
648}
649
650template <class R, class P1, class P2, class P3,
651 class TCallee, class TRT, class CallType,
652 class TP1, class TP2, class TP3>
653inline TFunctor3<R,P1,P2,P3>
654Functor(TFunctor3<R,P1,P2,P3>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3) const)
655{
656 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3) const;
658}
659
660//------------------------------------------------------------------------------
661/// Functor with 4 parameters, void return
662
663template <class P1, class P2, class P3, class P4>
665 public:
667
668 void operator()(P1 p1, P2 p2, P3 p3, P4 p4) const
669 {
670 Thunk(*this, p1, p2, p3, p4);
671 }
672
673 protected:
674 typedef void (*TThunk)(const TFunctorBase&, P1, P2, P3, P4);
675 TFunctorV4(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
676 : TFunctorBase(c,f,sz), Thunk(t) {}
677
678 private:
679 TThunk Thunk;
680};
681
682template <class P1, class P2, class P3, class P4, class Funct>
683class TFunctionTranslatorV4 : public TFunctorV4<P1,P2,P3,P4>{
684 public:
685 TFunctionTranslatorV4(Funct f) : TFunctorV4<P1,P2,P3,P4>(Thunk,0,(void*)f,0) {}
686
687 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4)
688 {
689 (Funct(ftor.Func))(p1, p2, p3, p4);
690 }
691};
692
693template <class P1, class P2, class P3, class P4, class TCallee, class TMemFunc>
694class TMemberTranslatorV4 : public TFunctorV4<P1,P2,P3,P4>{
695 public:
696 TMemberTranslatorV4(TCallee& c, const TMemFunc& mf)
697 : TFunctorV4<P1,P2,P3,P4>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
698
699 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4)
700 {
701 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
702 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
703 (callee->*memFunc)(p1, p2, p3, p4);
704 }
705};
706
707template <class P1, class P2, class P3, class P4,
708 class TRT, class TP1, class TP2, class TP3, class TP4>
709inline TFunctorV4<P1,P2,P3,P4>
714
715template <class P1, class P2, class P3, class P4, class TCallee,
716 class TRT, class CallType,
717 class TP1, class TP2, class TP3, class TP4>
718inline TFunctorV4<P1,P2,P3,P4>
719Functor(TFunctorV4<P1,P2,P3,P4>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4))
720{
721 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4);
723}
724
725template <class P1, class P2, class P3, class P4,
726 class TCallee, class TRT, class CallType,
727 class TP1, class TP2, class TP3, class TP4>
728inline TFunctorV4<P1,P2,P3,P4>
729Functor(TFunctorV4<P1,P2,P3,P4>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4) const)
730{
731 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4) const;
733}
734
735//------------------------------------------------------------------------------
736/// Functor with 4 parameters, return R
737
738template <class R, class P1, class P2, class P3, class P4>
739class TFunctor4 : public TFunctorBase{
740 public:
742
743 R operator()(P1 p1, P2 p2, P3 p3, P4 p4) const
744 {
745 return Thunk(*this, p1, p2, p3, p4);
746 }
747
748 protected:
749 typedef R (*TThunk)(const TFunctorBase&, P1, P2, P3, P4);
750 TFunctor4(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
751 : TFunctorBase(c,f,sz), Thunk(t) {}
752
753 private:
754 TThunk Thunk;
755};
756
757template <class R, class P1, class P2, class P3, class P4, class Funct>
758class TFunctionTranslator4 : public TFunctor4<R,P1,P2,P3,P4>{
759 public:
760 TFunctionTranslator4(Funct f) : TFunctor4<R,P1,P2,P3,P4>(Thunk,0,(void*)f,0) {}
761
762 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4)
763 {
764 return (Funct(ftor.Func))(p1, p2, p3, p4);
765 }
766};
767
768template <class R, class P1, class P2, class P3, class P4, class TCallee, class TMemFunc>
769class TMemberTranslator4 : public TFunctor4<R,P1,P2,P3,P4>{
770 public:
771 TMemberTranslator4(TCallee& c, const TMemFunc& mf)
772 : TFunctor4<R,P1,P2,P3,P4>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
773
774 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4)
775 {
776 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
777 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
778 return (callee->*memFunc)(p1, p2, p3, p4);
779 }
780};
781
782template <class R, class P1, class P2, class P3, class P4,
783 class TRT, class TP1, class TP2, class TP3, class TP4>
784inline TFunctor4<R,P1,P2,P3,P4>
789
790template <class R, class P1, class P2, class P3, class P4,
791 class TCallee, class TRT, class CallType,
792 class TP1, class TP2, class TP3, class TP4>
793inline TFunctor4<R,P1,P2,P3,P4>
794Functor(TFunctor4<R,P1,P2,P3,P4>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4))
795{
796 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4);
798}
799
800template <class R, class P1, class P2, class P3, class P4,
801 class TCallee, class TRT, class CallType,
802 class TP1, class TP2, class TP3, class TP4>
803inline TFunctor4<R,P1,P2,P3,P4>
804Functor(TFunctor4<R,P1,P2,P3,P4>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4) const)
805{
806 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4) const;
808}
809
810//------------------------------------------------------------------------------
811/// Functor with 5 parameters, void return
812
813template <class P1, class P2, class P3, class P4, class P5>
815 public:
817
818 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const
819 {
820 Thunk(*this, p1, p2, p3, p4, p5);
821 }
822
823 protected:
824 typedef void (*TThunk)(const TFunctorBase&, P1, P2, P3, P4, P5);
825 TFunctorV5(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
826 : TFunctorBase(c,f,sz), Thunk(t) {}
827
828 private:
829 TThunk Thunk;
830};
831
832template <class P1, class P2, class P3, class P4, class P5, class Funct>
833class TFunctionTranslatorV5 : public TFunctorV5<P1,P2,P3,P4,P5>{
834 public:
835 TFunctionTranslatorV5(Funct f) : TFunctorV5<P1,P2,P3,P4,P5>(Thunk,0,(void*)f,0) {}
836
837 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
838 {
839 (Funct(ftor.Func))(p1, p2, p3, p4, p5);
840 }
841};
842
843template <class P1, class P2, class P3, class P4, class P5, class TCallee, class TMemFunc>
844class TMemberTranslatorV5 : public TFunctorV5<P1,P2,P3,P4,P5>{
845 public:
846 TMemberTranslatorV5(TCallee& c, const TMemFunc& mf)
847 : TFunctorV5<P1,P2,P3,P4,P5>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
848
849 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
850 {
851 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
852 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
853 (callee->*memFunc)(p1, p2, p3, p4, p5);
854 }
855};
856
857template <class P1, class P2, class P3, class P4, class P5,
858 class TRT, class TP1, class TP2, class TP3, class TP4, class TP5>
859inline TFunctorV5<P1,P2,P3,P4,P5>
864
865template <class P1, class P2, class P3, class P4, class P5,
866 class TCallee, class TRT, class CallType,
867 class TP1, class TP2, class TP3, class TP4, class TP5>
868inline TFunctorV5<P1,P2,P3,P4,P5>
869Functor(TFunctorV5<P1,P2,P3,P4,P5>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5))
870{
871 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5);
873}
874
875template <class P1, class P2, class P3, class P4, class P5,
876 class TCallee, class TRT, class CallType,
877 class TP1, class TP2, class TP3, class TP4, class TP5>
878inline TFunctorV5<P1,P2,P3,P4,P5>
879Functor(TFunctorV5<P1,P2,P3,P4,P5>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5) const)
880{
881 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5) const;
883}
884
885//------------------------------------------------------------------------------
886/// Functor with 5 parameters, return R
887
888template <class R, class P1, class P2, class P3, class P4, class P5>
889class TFunctor5 : public TFunctorBase{
890 public:
892
893 R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const
894 {
895 return Thunk(*this, p1, p2, p3, p4, p5);
896 }
897
898 protected:
899 typedef R (*TThunk)(const TFunctorBase&, P1, P2, P3, P4, P5);
900 TFunctor5(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
901 : TFunctorBase(c,f,sz), Thunk(t) {}
902
903 private:
904 TThunk Thunk;
905};
906
907template <class R, class P1, class P2, class P3, class P4, class P5, class Funct>
908class TFunctionTranslator5 : public TFunctor5<R,P1,P2,P3,P4,P5>{
909 public:
910 TFunctionTranslator5(Funct f) : TFunctor5<R,P1,P2,P3,P4,P5>(Thunk,0,(void*)f,0) {}
911
912 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
913 {
914 return (Funct(ftor.Func))(p1, p2, p3, p4, p5);
915 }
916};
917
918template <class R, class P1, class P2, class P3, class P4, class P5, class TCallee, class TMemFunc>
919class TMemberTranslator5 : public TFunctor5<R,P1,P2,P3,P4,P5>{
920 public:
921 TMemberTranslator5(TCallee& c, const TMemFunc& mf)
922 : TFunctor5<R,P1,P2,P3,P4,P5>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
923
924 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
925 {
926 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
927 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
928 return (callee->*memFunc)(p1, p2, p3, p4, p5);
929 }
930};
931
932template <class R, class P1, class P2, class P3, class P4, class P5,
933 class TRT, class TP1, class TP2, class TP3, class TP4, class TP5>
934inline TFunctor5<R,P1,P2,P3,P4,P5>
939
940template <class R, class P1, class P2, class P3, class P4, class P5,
941 class TCallee, class TRT, class CallType,
942 class TP1, class TP2, class TP3, class TP4, class TP5>
943inline TFunctor5<R,P1,P2,P3,P4,P5>
944Functor(TFunctor5<R,P1,P2,P3,P4,P5>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5))
945{
946 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5);
948}
949
950template <class R, class P1, class P2, class P3, class P4, class P5,
951 class TCallee, class TRT, class CallType,
952 class TP1, class TP2, class TP3, class TP4, class TP5>
953inline TFunctor5<R,P1,P2,P3,P4,P5>
954Functor(TFunctor5<R,P1,P2,P3,P4,P5>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5) const)
955{
956 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5) const;
958}
959
960//------------------------------------------------------------------------------
961/// Functor with 6 parameters, void return
962
963template <class P1, class P2, class P3, class P4, class P5, class P6>
965 public:
967
968 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const
969 {
970 Thunk(*this, p1, p2, p3, p4, p5, p6);
971 }
972
973 protected:
974 typedef void (*TThunk)(const TFunctorBase&, P1, P2, P3, P4, P5, P6);
975 TFunctorV6(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
976 : TFunctorBase(c,f,sz), Thunk(t) {}
977
978 private:
979 TThunk Thunk;
980};
981
982template <class P1, class P2, class P3, class P4, class P5, class P6, class Funct>
983class TFunctionTranslatorV6 : public TFunctorV6<P1,P2,P3,P4,P5,P6>{
984 public:
985 TFunctionTranslatorV6(Funct f) : TFunctorV6<P1,P2,P3,P4,P5,P6>(Thunk,0,(void*)f,0) {}
986
987 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
988 {
989 (Funct(ftor.Func))(p1, p2, p3, p4, p5, p6);
990 }
991};
992
993template <class P1, class P2, class P3, class P4, class P5, class P6, class TCallee, class TMemFunc>
994class TMemberTranslatorV6 : public TFunctorV6<P1,P2,P3,P4,P5,P6>{
995 public:
996 TMemberTranslatorV6(TCallee& c, const TMemFunc& mf)
997 : TFunctorV6<P1,P2,P3,P4,P5,P6>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
998
999 static void Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1000 {
1001 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
1002 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
1003 (callee->*memFunc)(p1, p2, p3, p4, p5, p6);
1004 }
1005};
1006
1007template <class P1, class P2, class P3, class P4, class P5, class P6,
1008 class TRT, class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1009inline TFunctorV6<P1,P2,P3,P4,P5,P6>
1014
1015template <class P1, class P2, class P3, class P4, class P5, class P6,
1016 class TCallee, class TRT, class CallType,
1017 class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1018inline TFunctorV6<P1,P2,P3,P4,P5,P6>
1019Functor(TFunctorV6<P1,P2,P3,P4,P5,P6>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5,TP6))
1020{
1021 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5,TP6);
1023}
1024
1025template <class P1, class P2, class P3, class P4, class P5, class P6,
1026 class TCallee, class TRT, class CallType,
1027 class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1028inline TFunctorV6<P1,P2,P3,P4,P5,P6>
1029Functor(TFunctorV6<P1,P2,P3,P4,P5,P6>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5,TP6) const)
1030{
1031 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5,TP6) const;
1033}
1034
1035//------------------------------------------------------------------------------
1036/// Functor with 6 parameters, return R
1037
1038template <class R, class P1, class P2, class P3, class P4, class P5, class P6>
1040 public:
1042
1043 R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const
1044 {
1045 return Thunk(*this, p1, p2, p3, p4, p5, p6);
1046 }
1047
1048 protected:
1049 typedef R (*TThunk)(const TFunctorBase&, P1, P2, P3, P4, P5, P6);
1050 TFunctor6(THUNKREF(TThunk) t, const void* c, const void* f, size_t sz)
1051 : TFunctorBase(c,f,sz), Thunk(t) {}
1052
1053 private:
1054 TThunk Thunk;
1055};
1056
1057template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class Funct>
1058class TFunctionTranslator6 : public TFunctor6<R,P1,P2,P3,P4,P5,P6>{
1059 public:
1060 TFunctionTranslator6(Funct f) : TFunctor6<R,P1,P2,P3,P4,P5,P6>(Thunk,0,(void*)f,0) {}
1061
1062 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1063 {
1064 return (Funct(ftor.Func))(p1, p2, p3, p4, p5, p6);
1065 }
1066};
1067
1068template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class TCallee, class TMemFunc>
1069class TMemberTranslator6 : public TFunctor6<R,P1,P2,P3,P4,P5,P6>{
1070 public:
1071 TMemberTranslator6(TCallee& c, const TMemFunc& mf)
1072 : TFunctor6<R,P1,P2,P3,P4,P5,P6>(Thunk, &c, &mf, sizeof(TMemFunc)) {}
1073
1074 static R Thunk(const TFunctorBase& ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1075 {
1076 TCallee* callee = reinterpret_cast<TCallee*>(ftor.Callee);
1077 TMemFunc& memFunc(*(TMemFunc*)(void*)ftor.MemberFunc);
1078 return (callee->*memFunc)(p1, p2, p3, p4, p5, p6);
1079 }
1080};
1081
1082template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
1083 class TRT, class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1084inline TFunctor6<R,P1,P2,P3,P4,P5,P6>
1089
1090template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
1091 class TCallee, class TRT, class CallType,
1092 class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1093inline TFunctor6<R,P1,P2,P3,P4,P5,P6>
1094Functor(TFunctor6<R,P1,P2,P3,P4,P5,P6>*, TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5,TP6))
1095{
1096 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5,TP6);
1098}
1099
1100template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
1101 class TCallee, class TRT, class CallType,
1102 class TP1, class TP2, class TP3, class TP4, class TP5, class TP6>
1103inline TFunctor6<R,P1,P2,P3,P4,P5,P6>
1104Functor(TFunctor6<R,P1,P2,P3,P4,P5,P6>*, const TCallee& c, TRT(CallType::* const& f)(TP1,TP2,TP3,TP4,TP5,TP6) const)
1105{
1106 typedef TRT (CallType::*TMemFunc)(TP1,TP2,TP3,TP4,TP5,TP6) const;
1108}
1109
1110#include <owl/posclass.h>
1111
1112} // OWL namespace
1113
1115
1116#endif // BDTF_H
static R Thunk(const TFunctorBase &ftor)
Definition functor.h:177
TFunctionTranslator0(Funct f)
Definition functor.h:175
TFunctionTranslator1(Funct f)
Definition functor.h:315
static R Thunk(const TFunctorBase &ftor, P1 p1)
Definition functor.h:317
TFunctionTranslator2(Funct f)
Definition functor.h:461
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2)
Definition functor.h:463
TFunctionTranslator3(Funct f)
Definition functor.h:610
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3)
Definition functor.h:612
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4)
Definition functor.h:762
TFunctionTranslator4(Funct f)
Definition functor.h:760
TFunctionTranslator5(Funct f)
Definition functor.h:910
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
Definition functor.h:912
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
Definition functor.h:1062
static void Thunk(const TFunctorBase &ftor)
Definition functor.h:108
static void Thunk(const TFunctorBase &ftor, P1 p1)
Definition functor.h:247
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2)
Definition functor.h:387
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3)
Definition functor.h:537
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4)
Definition functor.h:687
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
Definition functor.h:837
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
Definition functor.h:987
Functor with 0 parameters, return R.
Definition functor.h:155
R(*) TThunk(const TFunctorBase &)
Definition functor.h:164
R operator()() const
Definition functor.h:159
TFunctor0(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:165
Functor with 1 parameter, return R.
Definition functor.h:294
TGadgetWindow *(*) TThunk(const TFunctorBase &, TWindow *)
Definition functor.h:304
R operator()(P1 p1) const
Definition functor.h:298
TFunctor1(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:305
Functor with 2 parameters, return R.
Definition functor.h:438
R(*) TThunk(const TFunctorBase &, P1, P2)
Definition functor.h:450
TFunctor2(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:451
R operator()(P1 p1, P2 p2) const
Definition functor.h:442
Functor with 3 parameters, return R.
Definition functor.h:589
R operator()(P1 p1, P2 p2, P3 p3) const
Definition functor.h:593
TFunctor3(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:600
TGadget *(*) TThunk(const TFunctorBase &, int, int, bool &)
Definition functor.h:599
Functor with 4 parameters, return R.
Definition functor.h:739
R operator()(P1 p1, P2 p2, P3 p3, P4 p4) const
Definition functor.h:743
R(*) TThunk(const TFunctorBase &, P1, P2, P3, P4)
Definition functor.h:749
TFunctor4(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:750
Functor with 5 parameters, return R.
Definition functor.h:889
R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const
Definition functor.h:893
TFunctor5(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:900
R(*) TThunk(const TFunctorBase &, P1, P2, P3, P4, P5)
Definition functor.h:899
Functor with 6 parameters, return R.
Definition functor.h:1039
R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const
Definition functor.h:1043
TFunctor6(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:1050
R(*) TThunk(const TFunctorBase &, P1, P2, P3, P4, P5, P6)
Definition functor.h:1049
Base functor class holds all of the actual data.
Definition functor.h:68
void(TFunctorBase::*) TMemberFunc()
Definition functor.h:71
Functor with 0 parameters, void return.
Definition functor.h:87
void operator()() const
Definition functor.h:90
void(*) TThunk(const TFunctorBase &)
Definition functor.h:95
TFunctorV0(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:96
Functor with 1 parameter, void return.
Definition functor.h:224
TFunctorV1(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:235
void(*) TThunk(const TFunctorBase &, P1)
Definition functor.h:234
void operator()(P1 p1) const
Definition functor.h:228
Functor with 2 parameters, void return.
Definition functor.h:364
TFunctorV2(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:375
void(*) TThunk(const TFunctorBase &, P1, P2)
Definition functor.h:374
void operator()(P1 p1, P2 p2) const
Definition functor.h:368
Functor with 3 parameters, void return.
Definition functor.h:514
void(*) TThunk(const TFunctorBase &, P1, P2, P3)
Definition functor.h:524
void operator()(P1 p1, P2 p2, P3 p3) const
Definition functor.h:518
TFunctorV3(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:525
Functor with 4 parameters, void return.
Definition functor.h:664
void(*) TThunk(const TFunctorBase &, P1, P2, P3, P4)
Definition functor.h:674
void operator()(P1 p1, P2 p2, P3 p3, P4 p4) const
Definition functor.h:668
TFunctorV4(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:675
Functor with 5 parameters, void return.
Definition functor.h:814
void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) const
Definition functor.h:818
TFunctorV5(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:825
void(*) TThunk(const TFunctorBase &, P1, P2, P3, P4, P5)
Definition functor.h:824
Functor with 6 parameters, void return.
Definition functor.h:964
void(*) TThunk(const TFunctorBase &, P1, P2, P3, P4, P5, P6)
Definition functor.h:974
TFunctorV6(THUNKREF(TThunk) t, const void *c, const void *f, size_t sz)
Definition functor.h:975
void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) const
Definition functor.h:968
static R Thunk(const TFunctorBase &ftor)
Definition functor.h:189
TMemberTranslator0(TCallee &c, const TMemFunc &mf)
Definition functor.h:186
static R Thunk(const TFunctorBase &ftor, P1 p1)
Definition functor.h:329
TMemberTranslator1(TCallee &c, const TMemFunc &mf)
Definition functor.h:326
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2)
Definition functor.h:475
TMemberTranslator2(TCallee &c, const TMemFunc &mf)
Definition functor.h:472
TMemberTranslator3(TCallee &c, const TMemFunc &mf)
Definition functor.h:621
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3)
Definition functor.h:624
TMemberTranslator4(TCallee &c, const TMemFunc &mf)
Definition functor.h:771
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4)
Definition functor.h:774
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
Definition functor.h:924
TMemberTranslator5(TCallee &c, const TMemFunc &mf)
Definition functor.h:921
static R Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
Definition functor.h:1074
TMemberTranslator6(TCallee &c, const TMemFunc &mf)
Definition functor.h:1071
TMemberTranslatorV0(TCallee &c, const TMemFunc &mf)
Definition functor.h:117
static void Thunk(const TFunctorBase &ftor)
Definition functor.h:120
static void Thunk(const TFunctorBase &ftor, P1 p1)
Definition functor.h:259
TMemberTranslatorV1(TCallee &c, const TMemFunc &mf)
Definition functor.h:256
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2)
Definition functor.h:399
TMemberTranslatorV2(TCallee &c, const TMemFunc &mf)
Definition functor.h:396
TMemberTranslatorV3(TCallee &c, const TMemFunc &mf)
Definition functor.h:546
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3)
Definition functor.h:549
TMemberTranslatorV4(TCallee &c, const TMemFunc &mf)
Definition functor.h:696
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4)
Definition functor.h:699
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
Definition functor.h:849
TMemberTranslatorV5(TCallee &c, const TMemFunc &mf)
Definition functor.h:846
TMemberTranslatorV6(TCallee &c, const TMemFunc &mf)
Definition functor.h:996
static void Thunk(const TFunctorBase &ftor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
Definition functor.h:999
#define THUNKREF(th)
Definition functor.h:55
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
TFunctorV0 Functor(TFunctorV0 *, TRT(*f)())
Definition functor.h:130
#define OWL_DISABLE_WARNING_POP
Definition defs.h:156
#define _OWLCLASS
Definition defs.h:338
#define OWL_DISABLE_WARNING_PUSH
Definition defs.h:155
#define OWL_DISABLE_WARNING_OLD_STYLE_CAST
Definition defs.h:161
char MemberFunc[sizeof(TMemberFunc)]
ASSUMES this is always enough space.