function_objects.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_UTILITIES_FUNCTION_OBJECTS_HPP_
13 #define ECL_UTILITIES_FUNCTION_OBJECTS_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
20 #include "../utilities/references.hpp"
21 
22 /*****************************************************************************
23 ** Namespaces
24 *****************************************************************************/
25 
26 namespace ecl {
27 
28 /*****************************************************************************
29 ** Using
30 *****************************************************************************/
31 
32 /*****************************************************************************
33 ** Interface [NullaryFunction]
34 *****************************************************************************/
45 template <typename R = void>
46 class NullaryFunction {
47 public:
48  typedef R result_type;
49  virtual result_type operator()() = 0;
50  virtual ~NullaryFunction() {};
51 };
52 
53 /*****************************************************************************
54 ** Interface [UnaryFunction]
55 *****************************************************************************/
56 
68 template <typename A, typename R = void>
69 class UnaryFunction {
70 public:
71  typedef R result_type;
72  typedef A argument_type;
77  virtual result_type operator()(argument_type arg) = 0;
78  virtual ~UnaryFunction() {};
79 };
80 
81 /*****************************************************************************
82 ** Interface [BinaryFunction]
83 *****************************************************************************/
96 template <typename A1, typename A2, typename R = void>
97 class BinaryFunction {
98 public:
99  typedef R result_type;
100  typedef A1 first_argument_type;
101  typedef A2 second_argument_type;
110  virtual ~BinaryFunction() {};
111 };
112 
113 /*****************************************************************************
114 ** Interface [FreeFunctions]
115 *****************************************************************************/
125 template <typename R = void>
126 class NullaryFreeFunction : public NullaryFunction<R>
127 {
128 public:
136  NullaryFreeFunction( R (*function)() ) : free_function(function) {}
137  virtual ~NullaryFreeFunction() {};
146  R operator()() { return free_function(); }
147 
148 private:
149  R (*free_function)();
150 };
151 
159 template <>
160 class NullaryFreeFunction<void> : public NullaryFunction<void>
161 {
162 public:
170  NullaryFreeFunction( void (*function)() ) : free_function(function) {}
171 
172  virtual ~NullaryFreeFunction() {};
181  void operator()() { free_function(); }
182 
183 private:
184  void (*free_function)();
185 };
186 
199 template <typename A, typename R = void>
200 class UnaryFreeFunction : public UnaryFunction<A,R>
201 {
202 public:
211  UnaryFreeFunction( R (*function)(A) ) : free_function(function) {}
212 
213  virtual ~UnaryFreeFunction() {};
222  R operator()(A a) { return free_function(a); }
223 
224 private:
225  R (*free_function)(A);
226 };
227 
237 template <typename A>
238 class UnaryFreeFunction<A,void> : public UnaryFunction<A,void>
239 {
240 public:
249  UnaryFreeFunction( void (*function)(A) ) : free_function(function) {}
250 
251  virtual ~UnaryFreeFunction() {};
259  void operator()(A a) { free_function(a); }
260 
261 private:
262  void (*free_function)(A);
263 };
264 
265 /*****************************************************************************
266 ** Interface [BoundFreeFunctions]
267 *****************************************************************************/
291 template <typename A, typename R = void>
292 class BoundUnaryFreeFunction : public NullaryFunction<R>
293 {
294 public:
303  BoundUnaryFreeFunction( R (*function)(A), A a ) : free_function(function), argument(a) {}
304  virtual ~BoundUnaryFreeFunction() {};
313 
314 private:
315  R (*free_function)(A);
316  A argument;
317 };
318 
328 template <typename A>
329 class BoundUnaryFreeFunction<A,void> : public NullaryFunction<void>
330 {
331 public:
340  BoundUnaryFreeFunction( void (*function)(A), A a ) : free_function(function), argument(a) {}
341  virtual ~BoundUnaryFreeFunction() {};
349  void operator()() { free_function(argument); }
350 
351 private:
352  void (*free_function)(A);
353  A argument;
354 };
355 
356 /*****************************************************************************
357  * Interface [MemberFunctions]
358  *****************************************************************************
359  * Could make copies+refs here, just like mem_fun and mem_fun_ref but I can't
360  * see the need for copy style setups.
361  ****************************************************************************/
362 
390 template <typename C, typename R = void>
391 class NullaryMemberFunction : public UnaryFunction<C&,R> {
392 public:
401  NullaryMemberFunction( R (C::*function)()) : member_function(function) {}
402  virtual ~NullaryMemberFunction() {};
414  R operator()(C &class_object) {
415  return (class_object.*member_function)();
416  }
417 private:
418  R (C::*member_function)();
419 };
420 
431 template <typename C>
432 class NullaryMemberFunction<C,void> : public UnaryFunction<C&,void> {
433 public:
442  NullaryMemberFunction( void (C::*function)()) : member_function(function) {}
443  virtual ~NullaryMemberFunction() {};
453  void operator()(C &class_object) {
454  (class_object.*member_function)();
455  }
456 private:
457  void (C::*member_function)();
458 };
459 
486 template <typename C, typename A, typename R = void>
487 class UnaryMemberFunction : public BinaryFunction<C&,A,R> {
488 public:
497  UnaryMemberFunction( R (C::*function)(A)) : member_function(function) {}
498  virtual ~UnaryMemberFunction() {};
509  R operator()(C &class_object, A a) {
510  return (class_object.*member_function)(a);
511  }
512 private:
513  R (C::*member_function)(A);
514 };
515 
526 template <typename C, typename A>
527 class UnaryMemberFunction<C,A,void> : public BinaryFunction<C&,A,void> {
528 public:
537  UnaryMemberFunction( void (C::*function)(A)) : member_function(function) {}
538  virtual ~UnaryMemberFunction() {};
549  void operator()(C &class_object, A a) {
550  (class_object.*member_function)(a);
551  }
552 private:
553  void (C::*member_function)(A);
554 };
555 
556 /*****************************************************************************
557 ** Interface [BoundMemberFunctions]
558 *****************************************************************************/
559 
585 template <typename C, typename R = void>
587 public:
596  BoundNullaryMemberFunction( R (C::*function)(), C &class_object) :
597  member_class(class_object),
598  member_function(function)
599  {}
600  virtual ~BoundNullaryMemberFunction() {};
609  R operator()() { return (member_class.*member_function)(); }
610 
611 private:
612  C &member_class;
613  R (C::*member_function)();
614 };
615 
627 template <typename C>
628 class BoundNullaryMemberFunction<C,void> : public NullaryFunction<void> {
629 public:
638  BoundNullaryMemberFunction( void (C::*function)(), C &class_object) :
639  member_class(class_object),
640  member_function(function)
641  {}
642 
643  virtual ~BoundNullaryMemberFunction() {};
650 
651 private:
652  C &member_class;
653  void (C::*member_function)();
654 };
655 
684 template <typename C, typename A, typename R = void>
686 public:
695  PartiallyBoundUnaryMemberFunction( R (C::*function)(A), C &class_object) :
696  member_class(class_object),
697  member_function(function)
698  {}
708  R operator()(A a) {
709  return (member_class.*member_function)(a);
710  }
711 private:
712  C &member_class;
713  void (C::*member_function)(A);
714 };
743 template <typename C, typename A, typename R = void>
744 class BoundUnaryMemberFunction : public NullaryFunction<R> {
745 public:
755  BoundUnaryMemberFunction( R (C::*function)(A), C &class_object, A a) :
756  member_class(class_object),
757  member_function(function),
758  argument(a)
759  {}
760  virtual ~BoundUnaryMemberFunction() {};
768  R operator()() {
770  }
771 private:
772  C &member_class;
773  void (C::*member_function)(A);
775 };
776 
806 template <typename C, typename A, typename B, typename R = void>
808 public:
817  PartiallyBoundBinaryMemberFunction( R (C::*function)(A, B), C &class_object) :
818  member_class(class_object),
819  member_function(function)
820  {}
831  R operator()(A a, B b) {
832  return (member_class.*member_function)(a, b);
833  }
834 private:
835  C &member_class;
836  void (C::*member_function)(A, B);
837 };
838 /*****************************************************************************
839 ** Function Object Wrappers
840 *****************************************************************************/
854 template <typename FunctionObject, typename Result = void>
855 class NullaryFunctionCopy : public NullaryFunction<Result>
856 {
857 public:
866  NullaryFunctionCopy(const FunctionObject &f_o ) : function_object(f_o) {
868  }
869  virtual ~NullaryFunctionCopy() {};
878  Result operator()() { return function_object(); }
879 
880 private:
881  FunctionObject function_object;
882 };
883 
893 template <typename FunctionObject>
894 class NullaryFunctionCopy<FunctionObject,void> : public NullaryFunction<void>
895 {
896 public:
905  explicit NullaryFunctionCopy( const FunctionObject &f_o ) : function_object(f_o) {
906  ecl_compile_time_concept_check(NullaryFunction<FunctionObject>);
907  }
908  virtual ~NullaryFunctionCopy() {};
915  void operator()() { function_object(); }
916 
917 private:
918  FunctionObject function_object;
919 };
920 
934 template <typename FunctionObject, typename Result = void>
935 class NullaryFunctionReference : public NullaryFunction<Result>
936 {
937 public:
945  explicit NullaryFunctionReference( const ReferenceWrapper<FunctionObject> &wrapper ) : function_object(wrapper.reference()) {
946  ecl_compile_time_concept_check(NullaryFunction<FunctionObject>);
947  }
948  virtual ~NullaryFunctionReference() {};
957  Result operator()() { return function_object(); }
958 
959 private:
960  FunctionObject &function_object;
961 };
962 
974 template <typename FunctionObject>
975 class NullaryFunctionReference< FunctionObject, void > : public NullaryFunction<void>
976 {
977 public:
985  explicit NullaryFunctionReference( const ReferenceWrapper<FunctionObject> &wrapper ) : function_object(wrapper.reference()) {
986  ecl_compile_time_concept_check(NullaryFunction<FunctionObject>);
987  }
988  virtual ~NullaryFunctionReference() {};
995  void operator()() { function_object(); }
996 
997 private:
998  FunctionObject &function_object;
999 };
1000 
1015 template <typename FunctionObject, typename T, typename Result = void>
1016 class UnaryFunctionCopy : public UnaryFunction<T, Result>
1017 {
1018 public:
1027  UnaryFunctionCopy(const FunctionObject &f_o ) : function_object(f_o) {
1028 // ecl_compile_time_concept_check(UnaryFunction<FunctionObject>);
1029  }
1030  virtual ~UnaryFunctionCopy() {};
1039  Result operator()(T t) { return function_object(t); }
1040 
1041 private:
1042  FunctionObject function_object;
1043 };
1044 
1054 template <typename FunctionObject, typename T>
1055 class UnaryFunctionCopy<FunctionObject,T,void> : public UnaryFunction<T, void>
1056 {
1057 public:
1066  explicit UnaryFunctionCopy( const FunctionObject &f_o ) : function_object(f_o) {
1067 // ecl_compile_time_concept_check(UnaryFunction<FunctionObject>);
1068  }
1069  virtual ~UnaryFunctionCopy() {};
1076  void operator()(T t) { function_object(t); }
1077 
1078 private:
1079  FunctionObject function_object;
1080 };
1081 
1095 template <typename FunctionObject, typename T, typename Result = void>
1096 class UnaryFunctionReference : public UnaryFunction<T, Result>
1097 {
1098 public:
1106  explicit UnaryFunctionReference( const ReferenceWrapper<FunctionObject> &wrapper ) : function_object(wrapper.reference()) {
1107 // ecl_compile_time_concept_check(UnaryFunction<FunctionObject>);
1108  }
1109 
1110  virtual ~UnaryFunctionReference() {};
1118  Result operator()(T t) { return function_object(t); }
1119 
1120 private:
1121  FunctionObject &function_object;
1122 };
1123 
1135 template <typename ReferenceWrapper, typename T>
1136 class UnaryFunctionReference< ReferenceWrapper, T, void > : public UnaryFunction<T,void>
1137 {
1138 public:
1139  typedef typename ReferenceWrapper::type FunctionObject;
1147  explicit UnaryFunctionReference( const ReferenceWrapper &wrapper ) : function_object(wrapper.reference()) {
1148 // ecl_compile_time_concept_check(UnaryFunction<FunctionObject>);
1149  }
1150  virtual ~UnaryFunctionReference() {};
1157  void operator()(T t) { function_object(t); }
1158 
1159 private:
1160  FunctionObject &function_object;
1161 };
1162 
1163 /*****************************************************************************
1164 ** Nullary Function Generators
1165 *****************************************************************************/
1179 template <typename R>
1181  return NullaryFreeFunction<R>( function );
1182 }
1183 
1197 template <typename A, typename R>
1198 UnaryFreeFunction<A,R> generateFunctionObject( R (*function)(A) ) {
1199  return UnaryFreeFunction<A,R>( function );
1200 }
1201 
1217 template <typename A, typename R, typename I>
1218 BoundUnaryFreeFunction<A,R> generateFunctionObject( R (*function)(A), I& a ) {
1219  return BoundUnaryFreeFunction<A,R>( function, a );
1220 }
1221 
1238 template <typename A, typename R, typename I>
1239 BoundUnaryFreeFunction<A,R> generateFunctionObject( R (*function)(A), const I& a ) {
1240  return BoundUnaryFreeFunction<A,R>( function, a );
1241 }
1242 
1256 template <typename C, typename R>
1257 NullaryMemberFunction<C,R> generateFunctionObject( R (C::*function)() ) {
1258  return NullaryMemberFunction<C,R>( function );
1259 }
1260 
1275 template <typename C, typename R>
1276 BoundNullaryMemberFunction<C,R> generateFunctionObject( R (C::*function)(), C &c ) {
1277  return BoundNullaryMemberFunction<C,R>( function, c );
1278 }
1279 
1294 template <typename C, typename A, typename R>
1295 UnaryMemberFunction<C,A,R> generateFunctionObject( R (C::*function)(A) ) {
1296  return UnaryMemberFunction<C,A,R>( function );
1297 }
1298 
1316 template <typename C, typename A, typename R>
1317 PartiallyBoundUnaryMemberFunction<C,A,R> generateFunctionObject( R (C::*function)(A), C& c) {
1318  return PartiallyBoundUnaryMemberFunction<C,A,R>( function, c);
1319 }
1320 
1338 template <typename C, typename A, typename R, typename I>
1339 BoundUnaryMemberFunction<C,A,R> generateFunctionObject( R (C::*function)(A), C& c, I& a ) {
1340  // The I here is a bit of a trick...if you use A in the constructor above instead of I
1341  // then it gets confused trying to deduce A as often the function arg and the input value
1342  // are different types (e.g. const int& as opposed to int). So fix A in the template
1343  // direction first, then pass it a type I which can be converted on the fly where needed.
1344  return BoundUnaryMemberFunction<C,A,R>( function, c, a );
1346 
1365 template <typename C, typename A, typename R, typename I>
1366 BoundUnaryMemberFunction<C,A,R> generateFunctionObject( R (C::*function)(A), C& c, const I& a ) {
1367  // This one differs from the previous due to the const reference - this allows things like
1368  // temporaries to pass through unscathed to a function with an argument like const int&.
1369  return BoundUnaryMemberFunction<C,A,R>( function, c, a );
1370 }
1371 
1372 }; // namespace ecl
1373 
1374 #endif /* ECL_UTILITIES_FUNCTION_OBJECTS_HPP_ */
ecl::NullaryFreeFunction::NullaryFreeFunction
NullaryFreeFunction(R(*function)())
Nullary function object constructor for global/static functions with no args.
Definition: function_objects.hpp:144
ecl::BoundUnaryFreeFunction
Nullary function object for bound unary global/static functions.
Definition: function_objects.hpp:298
ecl::UnaryFunctionCopy::UnaryFunctionCopy
UnaryFunctionCopy(const FunctionObject &f_o)
UnaryFunction child constructor for unary function objects.
Definition: function_objects.hpp:1033
ecl::PartiallyBoundBinaryMemberFunction::member_function
void(C::* member_function)(A, B)
Definition: function_objects.hpp:842
ecl_compile_time_concept_check
#define ecl_compile_time_concept_check(Model)
ecl::BoundUnaryMemberFunction::member_function
void(C::* member_function)(A)
Definition: function_objects.hpp:779
ecl::BoundUnaryMemberFunction::~BoundUnaryMemberFunction
virtual ~BoundUnaryMemberFunction()
Definition: function_objects.hpp:766
ecl::BoundUnaryFreeFunction::operator()
R operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:320
ecl::UnaryFreeFunction
Unary function object for global/static functions.
Definition: function_objects.hpp:206
ecl::NullaryFreeFunction::operator()
R operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:154
ecl::BoundNullaryMemberFunction::~BoundNullaryMemberFunction
virtual ~BoundNullaryMemberFunction()
Definition: function_objects.hpp:608
ecl::BoundUnaryMemberFunction::BoundUnaryMemberFunction
BoundUnaryMemberFunction(R(C::*function)(A), C &class_object, A a)
Binds a unary member function and creates a nullary function object.
Definition: function_objects.hpp:761
ecl::UnaryFunctionCopy::function_object
FunctionObject function_object
Definition: function_objects.hpp:1048
ecl::PartiallyBoundBinaryMemberFunction::~PartiallyBoundBinaryMemberFunction
virtual ~PartiallyBoundBinaryMemberFunction()
Definition: function_objects.hpp:827
ecl::UnaryMemberFunction::UnaryMemberFunction
UnaryMemberFunction(R(C::*function)(A))
Binary function object constructor for unary member functions.
Definition: function_objects.hpp:503
ecl::BoundUnaryMemberFunction::member_class
C & member_class
Definition: function_objects.hpp:778
ecl::PartiallyBoundBinaryMemberFunction::PartiallyBoundBinaryMemberFunction
PartiallyBoundBinaryMemberFunction(R(C::*function)(A, B), C &class_object)
Binds a binary member function and creates a binary function object.
Definition: function_objects.hpp:823
ecl::UnaryFunction
Virtual interface definition for unary function objects.
Definition: function_objects.hpp:75
ecl::PartiallyBoundUnaryMemberFunction::member_class
C & member_class
Definition: function_objects.hpp:718
ecl::NullaryFunction::~NullaryFunction
virtual ~NullaryFunction()
Definition: function_objects.hpp:66
ecl::NullaryFunctionReference::function_object
FunctionObject & function_object
Definition: function_objects.hpp:966
ecl::UnaryMemberFunction::member_function
R(C::* member_function)(A)
Definition: function_objects.hpp:519
ecl::ReferenceWrapper::type
T type
Definition: references.hpp:94
ecl::NullaryFreeFunction
Nullary function object for void global/static functions.
Definition: function_objects.hpp:132
ecl::UnaryFunctionReference::UnaryFunctionReference
UnaryFunctionReference(const ReferenceWrapper< FunctionObject > &wrapper)
Creates a UnaryFunction descendant from a reference wrapper.
Definition: function_objects.hpp:1112
ecl::UnaryMemberFunction
Binary function object for unary member functions.
Definition: function_objects.hpp:493
ecl::UnaryFunctionReference::function_object
FunctionObject & function_object
Definition: function_objects.hpp:1127
ecl::UnaryFunctionCopy::operator()
Result operator()(T t)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:1045
ecl::NullaryFunctionReference::~NullaryFunctionReference
virtual ~NullaryFunctionReference()
Definition: function_objects.hpp:954
ecl::NullaryMemberFunction::NullaryMemberFunction
NullaryMemberFunction(R(C::*function)())
Unary function object constructor for member functions without arguments.
Definition: function_objects.hpp:412
ecl::UnaryFunction::~UnaryFunction
virtual ~UnaryFunction()
Definition: function_objects.hpp:86
ecl::UnaryFunctionCopy::~UnaryFunctionCopy
virtual ~UnaryFunctionCopy()
Definition: function_objects.hpp:1036
ecl::BoundUnaryFreeFunction::BoundUnaryFreeFunction
BoundUnaryFreeFunction(R(*function)(A), A a)
Binds a unary function and creates a nullary function object.
Definition: function_objects.hpp:311
ecl::NullaryFunction::result_type
R result_type
The result type.
Definition: function_objects.hpp:64
ecl::NullaryFunctionCopy::function_object
FunctionObject function_object
Definition: function_objects.hpp:889
ecl::NullaryFunction
Virtual interface definition for nullary function objects.
Definition: function_objects.hpp:52
ecl::UnaryFreeFunction::UnaryFreeFunction
UnaryFreeFunction(R(*function)(A))
Unary function object constructor for global/static functions.
Definition: function_objects.hpp:217
ecl::BoundUnaryFreeFunction::~BoundUnaryFreeFunction
virtual ~BoundUnaryFreeFunction()
Definition: function_objects.hpp:312
ecl::BinaryFunction
Virtual interface definition for binary function objects.
Definition: function_objects.hpp:103
ecl::NullaryFreeFunction::free_function
R(* free_function)()
Definition: function_objects.hpp:157
ecl::NullaryFunctionReference::NullaryFunctionReference
NullaryFunctionReference(const ReferenceWrapper< FunctionObject > &wrapper)
Creates a NullaryFunction descendant from a reference wrapper.
Definition: function_objects.hpp:951
ecl::BoundNullaryMemberFunction::member_function
R(C::* member_function)()
Definition: function_objects.hpp:621
ecl::NullaryFunctionCopy::operator()
Result operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:886
ecl::BoundNullaryMemberFunction
Nullary function object for bound nullary member functions.
Definition: function_objects.hpp:592
ecl::BoundNullaryMemberFunction::BoundNullaryMemberFunction
BoundNullaryMemberFunction(R(C::*function)(), C &class_object)
Binds a unary member function and creates a nullary function object.
Definition: function_objects.hpp:604
ecl::NullaryFunctionCopy::~NullaryFunctionCopy
virtual ~NullaryFunctionCopy()
Definition: function_objects.hpp:877
ecl::BoundUnaryMemberFunction::argument
A argument
Definition: function_objects.hpp:780
ecl::BoundNullaryMemberFunction::member_class
C & member_class
Definition: function_objects.hpp:620
ecl::UnaryFunction::argument_type
A argument_type
The first argument type.
Definition: function_objects.hpp:80
ecl::PartiallyBoundBinaryMemberFunction::operator()
R operator()(A a, B b)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:837
ecl::NullaryMemberFunction::operator()
R operator()(C &class_object)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:425
ecl::BoundUnaryFreeFunction::argument
A argument
Definition: function_objects.hpp:324
ecl::UnaryMemberFunction::operator()
R operator()(C &class_object, A a)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:515
ecl::PartiallyBoundUnaryMemberFunction::member_function
void(C::* member_function)(A)
Definition: function_objects.hpp:719
ecl::BoundNullaryMemberFunction::operator()
R operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:617
ecl::BinaryFunction::result_type
R result_type
The result type.
Definition: function_objects.hpp:107
ecl::UnaryFreeFunction::operator()
R operator()(A a)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:228
ecl::NullaryFreeFunction::~NullaryFreeFunction
virtual ~NullaryFreeFunction()
Definition: function_objects.hpp:145
ecl::PartiallyBoundUnaryMemberFunction::~PartiallyBoundUnaryMemberFunction
virtual ~PartiallyBoundUnaryMemberFunction()
Definition: function_objects.hpp:705
ecl::UnaryFunction::operator()
virtual result_type operator()(argument_type arg)=0
Virtual function call required by unary function objects.
ecl::UnaryFunctionReference::~UnaryFunctionReference
virtual ~UnaryFunctionReference()
Definition: function_objects.hpp:1116
ecl::NullaryMemberFunction::member_function
R(C::* member_function)()
Definition: function_objects.hpp:429
ecl::PartiallyBoundUnaryMemberFunction::operator()
R operator()(A a)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:714
ecl::NullaryMemberFunction::~NullaryMemberFunction
virtual ~NullaryMemberFunction()
Definition: function_objects.hpp:413
ecl::PartiallyBoundBinaryMemberFunction::member_class
C & member_class
Definition: function_objects.hpp:841
ecl::NullaryFunctionCopy
Create a NullaryFunction object composited from an existing function object.
Definition: function_objects.hpp:861
nullary_function.hpp
ecl::UnaryFunction::result_type
R result_type
The result type.
Definition: function_objects.hpp:79
ecl::UnaryMemberFunction::~UnaryMemberFunction
virtual ~UnaryMemberFunction()
Definition: function_objects.hpp:504
ecl::NullaryMemberFunction
Unary function object for member functions without arguments.
Definition: function_objects.hpp:397
ecl::BinaryFunction::operator()
virtual result_type operator()(first_argument_type arg1, second_argument_type arg2)=0
Virtual function call required by binary function objects.
ecl::UnaryFreeFunction::~UnaryFreeFunction
virtual ~UnaryFreeFunction()
Definition: function_objects.hpp:219
ecl::PartiallyBoundUnaryMemberFunction::PartiallyBoundUnaryMemberFunction
PartiallyBoundUnaryMemberFunction(R(C::*function)(A), C &class_object)
Binds a unary member function and creates a nullary function object.
Definition: function_objects.hpp:701
ecl::NullaryFunctionReference::operator()
Result operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:963
ecl::UnaryFunctionReference::operator()
Result operator()(T t)
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:1124
ecl::BinaryFunction::second_argument_type
A2 second_argument_type
The second argument type.
Definition: function_objects.hpp:109
ecl::BoundUnaryMemberFunction
Nullary function object for bound unary member functions.
Definition: function_objects.hpp:750
ecl::BoundUnaryFreeFunction::free_function
R(* free_function)(A)
Definition: function_objects.hpp:323
ecl::BoundUnaryMemberFunction::operator()
R operator()()
This ensures any children objects are deleted correctly.
Definition: function_objects.hpp:774
ecl::BinaryFunction::first_argument_type
A1 first_argument_type
The first argument type.
Definition: function_objects.hpp:108
ecl
Embedded control libraries.
ecl::PartiallyBoundBinaryMemberFunction
Binary function object for partially bound binary member functions.
Definition: function_objects.hpp:813
ecl::NullaryFunctionCopy::NullaryFunctionCopy
NullaryFunctionCopy(const FunctionObject &f_o)
NullaryFunction child constructor for nullary function objects.
Definition: function_objects.hpp:874
ecl::generateFunctionObject
NullaryFreeFunction< R > generateFunctionObject(R(*function)())
Generate a nullary function object from a void global/static function.
Definition: function_objects.hpp:1186
ecl::PartiallyBoundUnaryMemberFunction
Unary function object for partially bound unary member functions.
Definition: function_objects.hpp:691
ecl::UnaryFreeFunction::free_function
R(* free_function)(A)
Definition: function_objects.hpp:231
ecl::BinaryFunction::~BinaryFunction
virtual ~BinaryFunction()
Definition: function_objects.hpp:118
ecl::NullaryFunction::operator()
virtual result_type operator()()=0
Virtual function call required by nullary function objects.


ecl_utilities
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:32