HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Functor.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_Functor.h
7  *
8  * COMMENTS:
9  * This functor implementation is adapted from "Modern C++ Design"
10  * by Andrei Alexandrescu. You needn't be concerned with how it
11  * works if you just want to use it.
12  *
13  * Note that these functors use value semantics. So, you can safely
14  * assign from one functor to another and it is safe to pass
15  * functors (without a reference or pointer) to a function.
16  *
17  * Using functors with functions:
18  * int function();
19  * UT_Functor<int> functor1(function);
20  * result = functor1();
21  *
22  * Using functors with methods:
23  * class TestClass has method getValue() that returns an int.
24  * TestClass object;
25  * UT_Functor<int> functor2(&object, &TestClass::getValue);
26  * result = functor2();
27  *
28  * Using functors with other functors:
29  * UT_Functor<int> functor3;
30  * functor3 = functor1;
31  * result = functor3();
32  *
33  * Using functors with arguments:
34  * int function2(int);
35  * UT_Functor1<int, int> functor4(function);
36  * result = functor4(5);
37  *
38  * Using functors as callbacks;
39  * UT_Functor<int, int> myCallback;
40  * void setCallback(UT_Functor<int, int> functor)
41  * { myCallback = functor; }
42  * void executeCallback()
43  * {
44  * if (myCallback.isset())
45  * result = myCallback(myValue);
46  * }
47  *
48  * Encapsulating data in functors by binding values to arguments:
49  * UT_Functor<int, int> functor5(function2);
50  * UT_Functor<int> functor6;
51  * functor6 = UT_BindFirst(functor5, 7);
52  * result = functor6();
53  */
54 
55 #ifndef __UT_Functor_h__
56 #define __UT_Functor_h__
57 
58 #include "UT_Assert.h"
59 #include <SYS/SYS_Types.h>
60 
61 // These are pure virtual interfaces for the classes that do the real work
62 // for the UT_Functor wrapper class. There are different classes for
63 // functors that take different number of parameters.
64 template <typename R>
66 {
67 public:
68  typedef R ReturnType;
69  virtual ReturnType operator()() const = 0;
70 
71  // Return a copy of this functor implementation.
72  virtual UT_FunctorImpl<ReturnType> *clone() const = 0;
73 
74  // We need to make the destructor virtual in this base class, even
75  // though it doesn't need to do anything here.
76  virtual ~UT_FunctorImpl() {}
77 };
78 
79 // ---------------------------------------------------------------------------
80 
81 template <typename R, typename P1>
83 {
84 public:
85  typedef R ReturnType;
86  typedef P1 Parm1Type;
87  virtual ReturnType operator()(Parm1Type parm1) const = 0;
88  virtual UT_FunctorImpl1<ReturnType, Parm1Type> *clone() const = 0;
89  virtual int64 getMemoryUsage(bool inclusive) const = 0;
90  virtual ~UT_FunctorImpl1() {}
91 };
92 
93 // ---------------------------------------------------------------------------
94 
95 template <typename R, typename P1, typename P2>
97 {
98 public:
99  typedef R ReturnType;
100  typedef P1 Parm1Type;
101  typedef P2 Parm2Type;
102  virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const = 0;
104  virtual ~UT_FunctorImpl2() {}
105 };
106 
107 // ===========================================================================
108 
109 // UT_FunctorHandlers are UT_FunctorImpl's that can automatically handle
110 // function pointers and other functors, thanks to the nature of template
111 // instantiation.
112 template <typename ParentFunctor, typename FunctorType>
114  : public UT_FunctorImpl<typename ParentFunctor::ReturnType>
115 {
116 public:
117  typedef typename ParentFunctor::ReturnType ReturnType;
118 
119  UT_FunctorHandler(const FunctorType &functor)
120  : myFunctor(functor)
121  {}
122 
123  // Our default copy constructor will call the copy constructor of our
124  // member variables. So, if our member variable is a UT_Functor, it
125  // will properly duplicate its UT_FunctorImpl.
127  { return new UT_FunctorHandler<ParentFunctor, FunctorType>(*this); }
128 
129  virtual ReturnType operator()() const
130  { return myFunctor(); }
131 
132 private:
133  FunctorType myFunctor;
134 };
135 
136 // ---------------------------------------------------------------------------
137 
138 template <typename ParentFunctor, typename FunctorType>
140  : public UT_FunctorImpl1<typename ParentFunctor::ReturnType,
141  typename ParentFunctor::Parm1Type>
142 {
143 public:
144  typedef typename ParentFunctor::ReturnType ReturnType;
145  typedef typename ParentFunctor::Parm1Type Parm1Type;
146  UT_FunctorHandler1(const FunctorType &functor)
147  : myFunctor(functor) {}
148 
151 
152  virtual ReturnType operator()(Parm1Type parm1) const
153  { return myFunctor(parm1); }
154 
155  virtual int64 getMemoryUsage(bool inclusive) const
156  {
157  int64 mem = inclusive ? sizeof(*this) : 0;
158  return mem;
159  }
160 
161 private:
162  FunctorType myFunctor;
163 };
164 
165 // ---------------------------------------------------------------------------
166 
167 template <typename ParentFunctor, typename FunctorType>
169  : public UT_FunctorImpl2<typename ParentFunctor::ReturnType,
170  typename ParentFunctor::Parm1Type,
171  typename ParentFunctor::Parm2Type>
172 {
173 public:
174  typedef typename ParentFunctor::ReturnType ReturnType;
175  typedef typename ParentFunctor::Parm1Type Parm1Type;
176  typedef typename ParentFunctor::Parm2Type Parm2Type;
177  UT_FunctorHandler2(const FunctorType &functor)
178  : myFunctor(functor) {}
179 
182 
183  virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
184  { return myFunctor(parm1, parm2); }
185 
186 private:
187  FunctorType myFunctor;
188 };
189 
190 // ===========================================================================
191 
192 // These classes handle member function functors.
193 template <typename ParentFunctor, typename PointerToObj,
194  typename PointerToMemFn>
196  : public UT_FunctorImpl<typename ParentFunctor::ReturnType>
197 {
198 public:
199  typedef typename ParentFunctor::ReturnType ReturnType;
200 
201  UT_MemFunHandler(const PointerToObj &pointer_to_obj,
202  const PointerToMemFn pointer_to_mem_fn)
203  : myPointerToObj(pointer_to_obj), myPointerToMemFn(pointer_to_mem_fn)
204  {}
205 
207  { return new UT_MemFunHandler<ParentFunctor, PointerToObj,
208  PointerToMemFn>(*this); }
209 
210  virtual ReturnType operator()() const
211  { return ((*myPointerToObj).*myPointerToMemFn)(); }
212 
213 private:
214  PointerToObj myPointerToObj;
215  PointerToMemFn myPointerToMemFn;
216 };
217 
218 // ---------------------------------------------------------------------------
219 
220 template <typename ParentFunctor, typename PointerToObj,
221  typename PointerToMemFn>
223  : public UT_FunctorImpl1<typename ParentFunctor::ReturnType,
224  typename ParentFunctor::Parm1Type>
225 {
226 public:
227  typedef typename ParentFunctor::ReturnType ReturnType;
228  typedef typename ParentFunctor::Parm1Type Parm1Type;
229 
230  UT_MemFunHandler1(const PointerToObj &pointer_to_obj,
231  const PointerToMemFn pointer_to_mem_fn)
232  : myPointerToObj(pointer_to_obj), myPointerToMemFn(pointer_to_mem_fn)
233  {}
234 
236  { return new UT_MemFunHandler1<ParentFunctor, PointerToObj,
237  PointerToMemFn>(*this); }
238 
239  virtual ReturnType operator()(Parm1Type parm1) const
240  { return ((*myPointerToObj).*myPointerToMemFn)(parm1); }
241 
242  virtual int64 getMemoryUsage(bool inclusive) const
243  {
244  int64 mem = inclusive ? sizeof(*this) : 0;
245  return mem;
246  }
247 
248 private:
249  PointerToObj myPointerToObj;
250  PointerToMemFn myPointerToMemFn;
251 };
252 
253 // ---------------------------------------------------------------------------
254 
255 template <typename ParentFunctor, typename PointerToObj,
256  typename PointerToMemFn>
258  : public UT_FunctorImpl2<typename ParentFunctor::ReturnType,
259  typename ParentFunctor::Parm1Type,
260  typename ParentFunctor::Parm2Type>
261 {
262 public:
263  typedef typename ParentFunctor::ReturnType ReturnType;
264  typedef typename ParentFunctor::Parm1Type Parm1Type;
265  typedef typename ParentFunctor::Parm2Type Parm2Type;
266 
267  UT_MemFunHandler2(const PointerToObj &pointer_to_obj,
268  const PointerToMemFn pointer_to_mem_fn)
269  : myPointerToObj(pointer_to_obj), myPointerToMemFn(pointer_to_mem_fn)
270  {}
271 
273  { return new UT_MemFunHandler2<ParentFunctor, PointerToObj,
274  PointerToMemFn>(*this); }
275 
276  virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
277  { return ((*myPointerToObj).*myPointerToMemFn)(parm1, parm2); }
278 
279 private:
280  PointerToObj myPointerToObj;
281  PointerToMemFn myPointerToMemFn;
282 };
283 
284 // ===========================================================================
285 
286 // These classes are the ones you actually use directly.
287 template <typename R>
289 {
290 public:
291  typedef R ReturnType;
292 
294 
295  // The functor takes ownership of the functor implementation.
296  explicit UT_Functor(UT_FunctorImpl<ReturnType> *functor_implementation)
297  : myFunctorImpl(functor_implementation)
298  {}
299 
300  // This constructor lets us avoid using UT_FunctorHandler directly.
301  // This lets us do nice things like declare functors that take
302  // function pointers. The method template type does not need to
303  // be explicitly specified. When the constructor sees a UT_Functor
304  // created from a function pointer, it has no choice but to try the
305  // templated constructor.
306  template <typename FunctorType>
307  UT_Functor(FunctorType functor)
308  : myFunctorImpl(new UT_FunctorHandler<UT_Functor, FunctorType>(functor))
309  {}
310 
311  // Like the contructor that creates a UT_FunctorHandler, you don't
312  // need to explicitly specify the template parameters for this
313  // constuctor. The complier will figure it out.
314  template <typename PointerToObj, typename PointerToMemFn>
315  UT_Functor(const PointerToObj &pointer, PointerToMemFn method)
316  : myFunctorImpl(new UT_MemFunHandler<UT_Functor, PointerToObj,
317  PointerToMemFn>(pointer, method))
318  {}
319 
320  // The functor always owns the implementation.
322  {
323  delete myFunctorImpl.myFunctorImpl;
324  myFunctorImpl.myFunctorImpl = 0;
325  }
326 
327  // Clone the other functor's implementation on assignment.
328  UT_Functor &operator=(const UT_Functor &functor)
329  {
330  if (&functor != this)
331  {
332  delete myFunctorImpl.myFunctorImpl;
333  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
334  ? functor.myFunctorImpl.myFunctorImpl->clone() : 0;
335  }
336  return *this;
337  }
338 
339  // Because we don't know what to return if the functor implementation
340  // hasn't been set, it's an error to evaluate the functor without
341  // an implementation. void return types are specialized in
342  // UT_Functor.C, though.
344  {
345  UT_ASSERT(myFunctorImpl.myFunctorImpl);
346  return (*myFunctorImpl.myFunctorImpl)();
347  }
348 
349  // This method is useful to tell if a callback has ever been set.
350  bool isSet() const
351  { return myFunctorImpl.myFunctorImpl != 0; }
352 
353 private:
354  // This class is to work around a bug in MSVC where you can't
355  // override the copy constructor because of the templated constructor.
356  // This workaround is copied from the Loki port to MSVC.
357  class Helper
358  {
359  public:
360  Helper() : myFunctorImpl(0) {}
361 
362  // Clone the other functor's implementation in the copy constructor.
363  Helper(const Helper &helper)
364  { myFunctorImpl = helper.myFunctorImpl
365  ? helper.myFunctorImpl->clone() : 0; }
366 
367  explicit Helper(UT_FunctorImpl<ReturnType> *functor_implementation)
368  : myFunctorImpl(functor_implementation) {}
369 
370  template<typename U>
371  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
372 
373  UT_FunctorImpl<ReturnType> *myFunctorImpl;
374  };
375 
376  Helper myFunctorImpl;
377 };
378 
379 // ---------------------------------------------------------------------------
380 
381 template <typename R, typename P1>
383 {
384 public:
385  typedef R ReturnType;
386  typedef P1 Parm1Type;
387 
389 
390  explicit UT_Functor1(
391  UT_FunctorImpl1<ReturnType, Parm1Type> *functor_implementation)
392  : myFunctorImpl(functor_implementation)
393  {}
394 
395  template <typename FunctorType>
396  UT_Functor1(FunctorType functor)
397  : myFunctorImpl(new UT_FunctorHandler1<UT_Functor1, FunctorType>(functor))
398  {}
399 
400  template <typename PointerToObj, typename PointerToMemFn>
401  UT_Functor1(const PointerToObj &pointer, PointerToMemFn method)
402  : myFunctorImpl(new UT_MemFunHandler1<UT_Functor1, PointerToObj,
403  PointerToMemFn>(pointer, method))
404  {}
405 
407  {
408  delete myFunctorImpl.myFunctorImpl;
409  myFunctorImpl.myFunctorImpl = 0;
410  }
411 
413  {
414  if (&functor != this)
415  {
416  delete myFunctorImpl.myFunctorImpl;
417  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
418  ? functor.myFunctorImpl.myFunctorImpl->clone() : 0;
419  }
420  return *this;
421  }
422 
424  {
425  UT_ASSERT(myFunctorImpl.myFunctorImpl);
426  return (*myFunctorImpl.myFunctorImpl)(parm1);
427  }
428 
429  bool isSet() const
430  { return myFunctorImpl.myFunctorImpl != 0; }
431 
432  int64 getMemoryUsage(bool inclusive) const
433  {
434  int64 mem = inclusive ? sizeof(*this) : 0;
435  if (myFunctorImpl.myFunctorImpl)
436  mem += myFunctorImpl.myFunctorImpl->getMemoryUsage(true);
437  return mem;
438  }
439 
440 private:
441  class Helper
442  {
443  public:
444  Helper() : myFunctorImpl(0) {}
445 
446  // Clone the other functor's implementation in the copy constructor.
447  Helper(const Helper &helper)
448  { myFunctorImpl = helper.myFunctorImpl
449  ? helper.myFunctorImpl->clone() : 0; }
450 
451  explicit Helper(
452  UT_FunctorImpl1<ReturnType, Parm1Type> *functor_implementation)
453  : myFunctorImpl(functor_implementation) {}
454 
455  template<typename U>
456  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
457 
459  };
460 
461  Helper myFunctorImpl;
462 };
463 
464 // ---------------------------------------------------------------------------
465 
466 template <typename R, typename P1, typename P2>
468 {
469 public:
470  typedef R ReturnType;
471  typedef P1 Parm1Type;
472  typedef P2 Parm2Type;
473 
475 
476  explicit UT_Functor2(
478  : myFunctorImpl(functor_impl)
479  {}
480 
481  template <typename FunctorType>
482  UT_Functor2(FunctorType functor)
483  : myFunctorImpl(new UT_FunctorHandler2<UT_Functor2, FunctorType>(functor))
484  {}
485 
486  template <typename PointerToObj, typename PointerToMemFn>
487  UT_Functor2(const PointerToObj &pointer, PointerToMemFn method)
488  : myFunctorImpl(new UT_MemFunHandler2<UT_Functor2, PointerToObj,
489  PointerToMemFn>(pointer, method))
490  {}
491 
493  {
494  delete myFunctorImpl.myFunctorImpl;
495  myFunctorImpl.myFunctorImpl = 0;
496  }
497 
499  {
500  if (&functor != this)
501  {
502  delete myFunctorImpl.myFunctorImpl;
503  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
504  ? functor.myFunctorImpl.myFunctorImpl->clone() : 0;
505  }
506  return *this;
507  }
508 
510  {
511  UT_ASSERT(myFunctorImpl.myFunctorImpl);
512  return (*myFunctorImpl.myFunctorImpl)(parm1, parm2);
513  }
514 
515  bool isSet() const
516  { return myFunctorImpl.myFunctorImpl != 0; }
517 
518 private:
519  class Helper
520  {
521  public:
522  Helper() : myFunctorImpl(0) {}
523 
524  // Clone the other functor's implementation in the copy constructor.
525  Helper(const Helper &helper)
526  { myFunctorImpl = helper.myFunctorImpl
527  ? helper.myFunctorImpl->clone() : 0; }
528 
529  explicit Helper(
531  : myFunctorImpl(functor_impl) {}
532 
533  template<typename U>
534  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
535 
537  };
538 
539  Helper myFunctorImpl;
540 };
541 
542 // ===========================================================================
543 
544 // This is a functor implementation class that stores an argument that
545 // passes that argument to a different functor.
546 template <typename Incoming>
547 class UT_BindFirstImpl : public UT_FunctorImpl<typename Incoming::ReturnType>
548 {
549 public:
550  typedef typename Incoming::ReturnType ReturnType;
551  typedef typename Incoming::Parm1Type BoundType;
552 
553  UT_BindFirstImpl(const Incoming &functor, BoundType bound_argument)
554  : myFunctor(functor), myBoundArgument(bound_argument)
555  {}
556 
558  { return new UT_BindFirstImpl(*this); }
559 
561  { return myFunctor(myBoundArgument); }
562 
563 private:
564  Incoming myFunctor;
565  BoundType myBoundArgument;
566 };
567 
568 // This function is used to convert one functor to another by binding
569 // the first argument to a fixed value.
570 template <typename Functor>
572 UT_BindFirst(const Functor &functor, typename Functor::Parm1Type bound_argument)
573 {
574  // For some reason, g++ wants to call the wrong UT_Functor constructor
575  // if we don't explicitly cast to the UT_FunctorImpl base class pointer.
578  new UT_BindFirstImpl<Functor>(functor, bound_argument));
579 }
580 
581 // ---------------------------------------------------------------------------
582 
583 template <typename Incoming>
584 class UT_BindFirstImpl1 : public UT_FunctorImpl1<typename Incoming::ReturnType,
585  typename Incoming::Parm2Type>
586 {
587 public:
588  typedef typename Incoming::ReturnType ReturnType;
589  typedef typename Incoming::Parm2Type Parm1Type;
590  typedef typename Incoming::Parm1Type BoundType;
591 
592  UT_BindFirstImpl1(const Incoming &functor, BoundType bound_argument)
593  : myFunctor(functor), myBoundArgument(bound_argument)
594  {}
595 
597  { return new UT_BindFirstImpl1(*this); }
598 
600  { return myFunctor(myBoundArgument, parm1); }
601 
602  virtual int64 getMemoryUsage(bool inclusive) const
603  {
604  int64 mem = inclusive ? sizeof(*this) : 0;
605  return mem;
606  }
607 
608 private:
609  Incoming myFunctor;
610  BoundType myBoundArgument;
611 };
612 
613 template <typename Functor>
615 UT_BindFirst1(const Functor &functor,
616  typename Functor::Parm1Type bound_argument)
617 {
618  typedef typename Functor::ReturnType ReturnType;
619  typedef typename Functor::Parm2Type Parm1Type;
620 
621  // For some reason, g++ wants to call the wrong UT_Functor constructor
622  // if we don't explicitly cast to the UT_FunctorImpl base class pointer.
625  new UT_BindFirstImpl1<Functor>(functor, bound_argument));
626 }
627 
628 // We need to include UT_Functor.C on Irix for some reason. Otherwise, it
629 // doesn't find the template specializations.
630 #if defined(WIN32) || defined(LINUX) || defined(MBSD) \
631  || defined(IRIX6) || defined(GAMEOS)
632  #include "UT_Functor.C"
633 #endif
634 
635 #endif
Incoming::Parm1Type BoundType
Definition: UT_Functor.h:590
virtual UT_FunctorImpl< ReturnType > * clone() const
Definition: UT_Functor.h:206
UT_MemFunHandler1(const PointerToObj &pointer_to_obj, const PointerToMemFn pointer_to_mem_fn)
Definition: UT_Functor.h:230
ParentFunctor::Parm2Type Parm2Type
Definition: UT_Functor.h:176
UT_Functor< typename Functor::ReturnType > UT_BindFirst(const Functor &functor, typename Functor::Parm1Type bound_argument)
Definition: UT_Functor.h:572
virtual ReturnType operator()(Parm1Type parm1) const =0
UT_FunctorHandler(const FunctorType &functor)
Definition: UT_Functor.h:119
virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
Definition: UT_Functor.h:276
ReturnType operator()() const
Definition: UT_Functor.h:560
virtual ReturnType operator()() const =0
virtual UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const
Definition: UT_Functor.h:149
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:227
png_voidp ptr
Definition: png.h:2145
ReturnType operator()(Parm1Type parm1) const
Definition: UT_Functor.h:599
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:145
UT_Functor(FunctorType functor)
Definition: UT_Functor.h:307
UT_FunctorHandler1(const FunctorType &functor)
Definition: UT_Functor.h:146
virtual int64 getMemoryUsage(bool inclusive) const
Definition: UT_Functor.h:242
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:264
UT_Functor(UT_FunctorImpl< ReturnType > *functor_implementation)
Definition: UT_Functor.h:296
virtual ReturnType operator()(Parm1Type parm1) const
Definition: UT_Functor.h:239
UT_FunctorHandler2(const FunctorType &functor)
Definition: UT_Functor.h:177
UT_Functor(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:315
virtual ReturnType operator()() const
Definition: UT_Functor.h:129
Incoming::Parm1Type BoundType
Definition: UT_Functor.h:551
Incoming::ReturnType ReturnType
Definition: UT_Functor.h:550
UT_Functor1(FunctorType functor)
Definition: UT_Functor.h:396
virtual ~UT_FunctorImpl1()
Definition: UT_Functor.h:90
virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const =0
UT_Functor1< typename Functor::ReturnType, typename Functor::Parm2Type > UT_BindFirst1(const Functor &functor, typename Functor::Parm1Type bound_argument)
Definition: UT_Functor.h:615
long long int64
Definition: SYS_Types.h:100
UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const
Definition: UT_Functor.h:596
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:117
ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
Definition: UT_Functor.h:509
UT_Functor1(UT_FunctorImpl1< ReturnType, Parm1Type > *functor_implementation)
Definition: UT_Functor.h:390
virtual ReturnType operator()() const
Definition: UT_Functor.h:210
virtual ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
Definition: UT_Functor.h:183
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
int64 getMemoryUsage(bool inclusive) const
Definition: UT_Functor.h:432
int method
Definition: png.h:1924
UT_MemFunHandler(const PointerToObj &pointer_to_obj, const PointerToMemFn pointer_to_mem_fn)
Definition: UT_Functor.h:201
virtual int64 getMemoryUsage(bool inclusive) const
Definition: UT_Functor.h:602
UT_Functor2(UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > *functor_impl)
Definition: UT_Functor.h:476
virtual int64 getMemoryUsage(bool inclusive) const =0
bool isSet() const
Definition: UT_Functor.h:350
Incoming::ReturnType ReturnType
Definition: UT_Functor.h:588
ReturnType operator()(Parm1Type parm1) const
Definition: UT_Functor.h:423
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:228
UT_Functor1(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:401
bool isSet() const
Definition: UT_Functor.h:515
Incoming::Parm2Type Parm1Type
Definition: UT_Functor.h:589
virtual UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > * clone() const =0
ParentFunctor::Parm2Type Parm2Type
Definition: UT_Functor.h:265
UT_BindFirstImpl1(const Incoming &functor, BoundType bound_argument)
Definition: UT_Functor.h:592
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:174
GLenum void ** pointer
Definition: glcorearb.h:809
UT_Functor2(FunctorType functor)
Definition: UT_Functor.h:482
virtual UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const =0
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:263
UT_Functor2 & operator=(const UT_Functor2 &functor)
Definition: UT_Functor.h:498
UT_FunctorImpl< ReturnType > * clone() const
Definition: UT_Functor.h:557
virtual ~UT_FunctorImpl()
Definition: UT_Functor.h:76
virtual ReturnType operator()(Parm1Type parm1) const
Definition: UT_Functor.h:152
virtual UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const
Definition: UT_Functor.h:235
UT_MemFunHandler2(const PointerToObj &pointer_to_obj, const PointerToMemFn pointer_to_mem_fn)
Definition: UT_Functor.h:267
UT_Functor & operator=(const UT_Functor &functor)
Definition: UT_Functor.h:328
virtual UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > * clone() const
Definition: UT_Functor.h:180
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:144
virtual int64 getMemoryUsage(bool inclusive) const
Definition: UT_Functor.h:155
virtual UT_FunctorImpl< ReturnType > * clone() const
Definition: UT_Functor.h:126
UT_Functor2(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:487
virtual ~UT_FunctorImpl2()
Definition: UT_Functor.h:104
UT_BindFirstImpl(const Incoming &functor, BoundType bound_argument)
Definition: UT_Functor.h:553
bool isSet() const
Definition: UT_Functor.h:429
virtual UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > * clone() const
Definition: UT_Functor.h:272
virtual UT_FunctorImpl< ReturnType > * clone() const =0
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:199
ReturnType operator()() const
Definition: UT_Functor.h:343
UT_Functor1 & operator=(const UT_Functor1 &functor)
Definition: UT_Functor.h:412
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:175