HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ReturnType operator()() const override
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  ReturnType operator()(Parm1Type parm1) const override
153  { return myFunctor(parm1); }
154 
155  int64 getMemoryUsage(bool inclusive) const override
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  ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const override
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  ReturnType operator()() const override
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  ReturnType operator()(Parm1Type parm1) const override
240  { return ((*myPointerToObj).*myPointerToMemFn)(parm1); }
241 
242  int64 getMemoryUsage(bool inclusive) const override
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  ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const override
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:
292  typedef R ReturnType;
293 
295 
296  // The functor takes ownership of the functor implementation.
297  explicit UT_Functor(UT_FunctorImpl<ReturnType> *functor_implementation)
298  : myFunctorImpl(functor_implementation)
299  {}
300 
302  {
303  myFunctorImpl.myFunctorImpl = src.myFunctorImpl.myFunctorImpl
304  ? src.myFunctorImpl.myFunctorImpl->clone() : nullptr;
305  }
306 
307  // This constructor lets us avoid using UT_FunctorHandler directly.
308  // This lets us do nice things like declare functors that take
309  // function pointers. The method template type does not need to
310  // be explicitly specified. When the constructor sees a UT_Functor
311  // created from a function pointer, it has no choice but to try the
312  // templated constructor.
313  template <typename FunctorType>
314  UT_Functor(FunctorType functor)
315  : myFunctorImpl(new UT_FunctorHandler<UT_Functor, FunctorType>(functor))
316  {}
317 
318  // Like the contructor that creates a UT_FunctorHandler, you don't
319  // need to explicitly specify the template parameters for this
320  // constuctor. The complier will figure it out.
321  template <typename PointerToObj, typename PointerToMemFn>
322  UT_Functor(const PointerToObj &pointer, PointerToMemFn method)
323  : myFunctorImpl(new UT_MemFunHandler<UT_Functor, PointerToObj,
324  PointerToMemFn>(pointer, method))
325  {}
326 
327  // The functor always owns the implementation.
329  {
330  delete myFunctorImpl.myFunctorImpl;
331  myFunctorImpl.myFunctorImpl = 0;
332  }
333 
334  // Clone the other functor's implementation on assignment.
335  UT_Functor &operator=(const UT_Functor &functor)
336  {
337  if (&functor != this)
338  {
339  delete myFunctorImpl.myFunctorImpl;
340  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
341  ? functor.myFunctorImpl.myFunctorImpl->clone() : 0;
342  }
343  return *this;
344  }
345 
346  // Because we don't know what to return if the functor implementation
347  // hasn't been set, it's an error to evaluate the functor without
348  // an implementation. void return types are specialized in
349  // UT_Functor.C, though.
351  {
352  UT_ASSERT(myFunctorImpl.myFunctorImpl);
353  return (*myFunctorImpl.myFunctorImpl)();
354  }
355 
356  explicit operator bool() const noexcept { return isSet(); }
357 
358  // This method is useful to tell if a callback has ever been set.
359  bool isSet() const
360  { return myFunctorImpl.myFunctorImpl != 0; }
361 
362 private:
363  // This class is to work around a bug in MSVC where you can't
364  // override the copy constructor because of the templated constructor.
365  // This workaround is copied from the Loki port to MSVC.
366  class Helper
367  {
368  public:
369  Helper() : myFunctorImpl(0) {}
370 
371  // Clone the other functor's implementation in the copy constructor.
372  Helper(const Helper &helper)
373  { myFunctorImpl = helper.myFunctorImpl
374  ? helper.myFunctorImpl->clone() : 0; }
375 
376  explicit Helper(UT_FunctorImpl<ReturnType> *functor_implementation)
377  : myFunctorImpl(functor_implementation) {}
378 
379  template<typename U>
380  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
381 
382  UT_FunctorImpl<ReturnType> *myFunctorImpl;
383  };
384 
385  Helper myFunctorImpl;
386 };
387 
388 // ---------------------------------------------------------------------------
389 
390 template <typename R, typename P1>
392 {
393 public:
395  typedef R ReturnType;
396  typedef P1 Parm1Type;
397 
399 
400  explicit UT_Functor1(
401  UT_FunctorImpl1<ReturnType, Parm1Type> *functor_implementation)
402  : myFunctorImpl(functor_implementation)
403  {}
404 
405  template <typename FunctorType>
406  UT_Functor1(FunctorType functor)
407  : myFunctorImpl(new UT_FunctorHandler1<UT_Functor1, FunctorType>(functor))
408  {}
409 
410  template <typename PointerToObj, typename PointerToMemFn>
411  UT_Functor1(const PointerToObj &pointer, PointerToMemFn method)
412  : myFunctorImpl(new UT_MemFunHandler1<UT_Functor1, PointerToObj,
413  PointerToMemFn>(pointer, method))
414  {}
415 
417  {
418  myFunctorImpl.myFunctorImpl = src.myFunctorImpl.myFunctorImpl
419  ? src.myFunctorImpl.myFunctorImpl->clone() : nullptr;
420  }
421 
423  {
424  delete myFunctorImpl.myFunctorImpl;
425  myFunctorImpl.myFunctorImpl = 0;
426  }
427 
429  {
430  if (&functor != this)
431  {
432  delete myFunctorImpl.myFunctorImpl;
433  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
434  ? functor.myFunctorImpl.myFunctorImpl->clone() : 0;
435  }
436  return *this;
437  }
438 
440  {
441  UT_ASSERT(myFunctorImpl.myFunctorImpl);
442  return (*myFunctorImpl.myFunctorImpl)(parm1);
443  }
444 
445  explicit operator bool() const noexcept {return isSet(); }
446 
447  bool isSet() const
448  { return myFunctorImpl.myFunctorImpl != 0; }
449 
450  int64 getMemoryUsage(bool inclusive) const
451  {
452  int64 mem = inclusive ? sizeof(*this) : 0;
453  if (myFunctorImpl.myFunctorImpl)
454  mem += myFunctorImpl.myFunctorImpl->getMemoryUsage(true);
455  return mem;
456  }
457 
458 private:
459  class Helper
460  {
461  public:
462  Helper() : myFunctorImpl(0) {}
463 
464  // Clone the other functor's implementation in the copy constructor.
465  Helper(const Helper &helper)
466  { myFunctorImpl = helper.myFunctorImpl
467  ? helper.myFunctorImpl->clone() : 0; }
468 
469  explicit Helper(
470  UT_FunctorImpl1<ReturnType, Parm1Type> *functor_implementation)
471  : myFunctorImpl(functor_implementation) {}
472 
473  template<typename U>
474  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
475 
477  };
478 
479  Helper myFunctorImpl;
480 };
481 
482 // ---------------------------------------------------------------------------
483 
484 template <typename R, typename P1, typename P2>
486 {
487 public:
489  typedef R ReturnType;
490  typedef P1 Parm1Type;
491  typedef P2 Parm2Type;
492 
494  explicit UT_Functor2(
496  : myFunctorImpl(functor_impl)
497  {}
498 
500  {
501  myFunctorImpl.myFunctorImpl = src.myFunctorImpl.myFunctorImpl
502  ? src.myFunctorImpl.myFunctorImpl->clone() : nullptr;
503  }
504 
505  template <typename FunctorType>
506  UT_Functor2(FunctorType functor)
507  : myFunctorImpl(new UT_FunctorHandler2<UT_Functor2, FunctorType>(functor))
508  {}
509 
510  template <typename PointerToObj, typename PointerToMemFn>
511  UT_Functor2(const PointerToObj &pointer, PointerToMemFn method)
512  : myFunctorImpl(new UT_MemFunHandler2<UT_Functor2, PointerToObj,
513  PointerToMemFn>(pointer, method))
514  {}
515 
517  {
518  delete myFunctorImpl.myFunctorImpl;
519  myFunctorImpl.myFunctorImpl = 0;
520  }
521 
523  {
524  if (&functor != this)
525  {
526  delete myFunctorImpl.myFunctorImpl;
527  myFunctorImpl.myFunctorImpl = functor.myFunctorImpl.myFunctorImpl
528  ? functor.myFunctorImpl.myFunctorImpl->clone() : nullptr;
529  }
530  return *this;
531  }
532 
534  {
535  UT_ASSERT(myFunctorImpl.myFunctorImpl);
536  return (*myFunctorImpl.myFunctorImpl)(parm1, parm2);
537  }
538 
539  explicit operator bool() const noexcept { return isSet(); }
540 
541  bool isSet() const
542  { return myFunctorImpl.myFunctorImpl != 0; }
543 
544 private:
545  class Helper
546  {
547  public:
548  Helper() : myFunctorImpl(0) {}
549 
550  // Clone the other functor's implementation in the copy constructor.
551  Helper(const Helper &helper)
552  { myFunctorImpl = helper.myFunctorImpl
553  ? helper.myFunctorImpl->clone() : 0; }
554 
555  explicit Helper(
557  : myFunctorImpl(functor_impl) {}
558 
559  template<typename U>
560  explicit Helper(U *ptr) : myFunctorImpl(ptr) {}
561 
563  };
564 
565  Helper myFunctorImpl;
566 };
567 
568 // ===========================================================================
569 
570 // This is a functor implementation class that stores an argument that
571 // passes that argument to a different functor.
572 template <typename Incoming>
573 class UT_BindFirstImpl : public UT_FunctorImpl<typename Incoming::ReturnType>
574 {
575 public:
576  typedef typename Incoming::ReturnType ReturnType;
577  typedef typename Incoming::Parm1Type BoundType;
578 
579  UT_BindFirstImpl(const Incoming &functor, BoundType bound_argument)
580  : myFunctor(functor), myBoundArgument(bound_argument)
581  {}
582 
584  { return new UT_BindFirstImpl(*this); }
585 
586  ReturnType operator()() const override
587  { return myFunctor(myBoundArgument); }
588 
589 private:
590  Incoming myFunctor;
591  BoundType myBoundArgument;
592 };
593 
594 // This function is used to convert one functor to another by binding
595 // the first argument to a fixed value.
596 template <typename Functor>
598 UT_BindFirst(const Functor &functor, typename Functor::Parm1Type bound_argument)
599 {
600  // For some reason, g++ wants to call the wrong UT_Functor constructor
601  // if we don't explicitly cast to the UT_FunctorImpl base class pointer.
604  new UT_BindFirstImpl<Functor>(functor, bound_argument));
605 }
606 
607 // ---------------------------------------------------------------------------
608 
609 template <typename Incoming>
610 class UT_BindFirstImpl1 : public UT_FunctorImpl1<typename Incoming::ReturnType,
611  typename Incoming::Parm2Type>
612 {
613 public:
614  typedef typename Incoming::ReturnType ReturnType;
615  typedef typename Incoming::Parm2Type Parm1Type;
616  typedef typename Incoming::Parm1Type BoundType;
617 
618  UT_BindFirstImpl1(const Incoming &functor, BoundType bound_argument)
619  : myFunctor(functor), myBoundArgument(bound_argument)
620  {}
621 
623  { return new UT_BindFirstImpl1(*this); }
624 
625  ReturnType operator()(Parm1Type parm1) const override
626  { return myFunctor(myBoundArgument, parm1); }
627 
628  int64 getMemoryUsage(bool inclusive) const override
629  {
630  int64 mem = inclusive ? sizeof(*this) : 0;
631  return mem;
632  }
633 
634 private:
635  Incoming myFunctor;
636  BoundType myBoundArgument;
637 };
638 
639 template <typename Functor>
641 UT_BindFirst1(const Functor &functor,
642  typename Functor::Parm1Type bound_argument)
643 {
644  typedef typename Functor::ReturnType ReturnType;
645  typedef typename Functor::Parm2Type Parm1Type;
646 
647  // For some reason, g++ wants to call the wrong UT_Functor constructor
648  // if we don't explicitly cast to the UT_FunctorImpl base class pointer.
651  new UT_BindFirstImpl1<Functor>(functor, bound_argument));
652 }
653 
654 // We need to include UT_Functor.C. Otherwise, it
655 // doesn't find the template specializations.
656 #if defined(WIN32) || defined(LINUX) || defined(MBSD)
657  #include "UT_Functor.C"
658 #endif
659 
660 #endif
Incoming::Parm1Type BoundType
Definition: UT_Functor.h:616
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:598
virtual ReturnType operator()(Parm1Type parm1) const =0
UT_FunctorHandler(const FunctorType &functor)
Definition: UT_Functor.h:119
virtual ReturnType operator()() const =0
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:227
UT_Functor(const this_type &src)
Definition: UT_Functor.h:301
UT_FunctorImpl< ReturnType > * clone() const override
Definition: UT_Functor.h:126
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:145
UT_Functor(FunctorType functor)
Definition: UT_Functor.h:314
UT_FunctorHandler1(const FunctorType &functor)
Definition: UT_Functor.h:146
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:264
UT_Functor(UT_FunctorImpl< ReturnType > *functor_implementation)
Definition: UT_Functor.h:297
GLenum src
Definition: glcorearb.h:1793
UT_FunctorHandler2(const FunctorType &functor)
Definition: UT_Functor.h:177
UT_Functor(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:322
Incoming::Parm1Type BoundType
Definition: UT_Functor.h:577
int64 getMemoryUsage(bool inclusive) const override
Definition: UT_Functor.h:242
Incoming::ReturnType ReturnType
Definition: UT_Functor.h:576
ReturnType operator()(Parm1Type parm1) const override
Definition: UT_Functor.h:239
UT_Functor1(FunctorType functor)
Definition: UT_Functor.h:406
virtual ~UT_FunctorImpl1()
Definition: UT_Functor.h:90
UT_FunctorImpl< ReturnType > * clone() const override
Definition: UT_Functor.h:206
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:641
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:117
UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const override
Definition: UT_Functor.h:235
ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const
Definition: UT_Functor.h:533
UT_Functor1(UT_FunctorImpl1< ReturnType, Parm1Type > *functor_implementation)
Definition: UT_Functor.h:400
ReturnType operator()(Parm1Type parm1) const override
Definition: UT_Functor.h:625
int64 getMemoryUsage(bool inclusive) const override
Definition: UT_Functor.h:628
int64 getMemoryUsage(bool inclusive) const
Definition: UT_Functor.h:450
UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > * clone() const override
Definition: UT_Functor.h:180
UT_MemFunHandler(const PointerToObj &pointer_to_obj, const PointerToMemFn pointer_to_mem_fn)
Definition: UT_Functor.h:201
ReturnType operator()() const override
Definition: UT_Functor.h:210
UT_Functor1(const this_type &src)
Definition: UT_Functor.h:416
ReturnType operator()(Parm1Type parm1) const override
Definition: UT_Functor.h:152
UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > * clone() const override
Definition: UT_Functor.h:272
long long int64
Definition: SYS_Types.h:116
UT_Functor2(UT_FunctorImpl2< ReturnType, Parm1Type, Parm2Type > *functor_impl)
Definition: UT_Functor.h:494
ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const override
Definition: UT_Functor.h:276
virtual int64 getMemoryUsage(bool inclusive) const =0
bool isSet() const
Definition: UT_Functor.h:359
Incoming::ReturnType ReturnType
Definition: UT_Functor.h:614
ReturnType operator()(Parm1Type parm1) const
Definition: UT_Functor.h:439
UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const override
Definition: UT_Functor.h:622
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:228
UT_Functor1(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:411
bool isSet() const
Definition: UT_Functor.h:541
Incoming::Parm2Type Parm1Type
Definition: UT_Functor.h:615
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:618
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:174
UT_Functor2(FunctorType functor)
Definition: UT_Functor.h:506
virtual UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const =0
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:263
int64 getMemoryUsage(bool inclusive) const override
Definition: UT_Functor.h:155
ReturnType operator()(Parm1Type parm1, Parm2Type parm2) const override
Definition: UT_Functor.h:183
UT_Functor2 & operator=(const UT_Functor2 &functor)
Definition: UT_Functor.h:522
auto ptr(T p) -> const void *
Definition: format.h:2448
UT_Functor2(const this_type &src)
Definition: UT_Functor.h:499
virtual ~UT_FunctorImpl()
Definition: UT_Functor.h:76
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:153
#define const
Definition: zconf.h:214
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:335
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:144
UT_FunctorImpl< ReturnType > * clone() const override
Definition: UT_Functor.h:583
UT_Functor2(const PointerToObj &pointer, PointerToMemFn method)
Definition: UT_Functor.h:511
virtual ~UT_FunctorImpl2()
Definition: UT_Functor.h:104
UT_BindFirstImpl(const Incoming &functor, BoundType bound_argument)
Definition: UT_Functor.h:579
GLenum void ** pointer
Definition: glcorearb.h:810
bool isSet() const
Definition: UT_Functor.h:447
ReturnType operator()() const override
Definition: UT_Functor.h:586
virtual UT_FunctorImpl< ReturnType > * clone() const =0
ParentFunctor::ReturnType ReturnType
Definition: UT_Functor.h:199
ReturnType operator()() const override
Definition: UT_Functor.h:129
ReturnType operator()() const
Definition: UT_Functor.h:350
UT_Functor1 & operator=(const UT_Functor1 &functor)
Definition: UT_Functor.h:428
ParentFunctor::Parm1Type Parm1Type
Definition: UT_Functor.h:175
UT_FunctorImpl1< ReturnType, Parm1Type > * clone() const override
Definition: UT_Functor.h:149