12 #ifndef ECL_UTILITIES_FUNCTION_OBJECTS_HPP_ 13 #define ECL_UTILITIES_FUNCTION_OBJECTS_HPP_ 20 #include "../utilities/references.hpp" 45 template <
typename R =
void>
68 template <
typename A,
typename R =
void>
77 virtual result_type
operator()(argument_type arg) = 0;
96 template <
typename A1,
typename A2,
typename R =
void>
109 virtual result_type
operator()(first_argument_type arg1, second_argument_type arg2) = 0;
125 template <
typename R =
void>
149 R (*free_function)();
184 void (*free_function)();
199 template <
typename A,
typename R =
void>
225 R (*free_function)(A);
237 template <
typename A>
262 void (*free_function)(A);
291 template <
typename A,
typename R =
void>
315 R (*free_function)(A);
328 template <
typename A>
352 void (*free_function)(A);
390 template <
typename C,
typename R =
void>
415 return (class_object.*member_function)();
418 R (C::*member_function)();
431 template <
typename C>
454 (class_object.*member_function)();
457 void (C::*member_function)();
486 template <
typename C,
typename A,
typename R =
void>
510 return (class_object.*member_function)(a);
513 R (C::*member_function)(A);
526 template <
typename C,
typename A>
550 (class_object.*member_function)(a);
553 void (C::*member_function)(A);
585 template <
typename C,
typename R =
void>
597 member_class(class_object),
598 member_function(function)
613 R (C::*member_function)();
627 template <
typename C>
639 member_class(class_object),
640 member_function(function)
653 void (C::*member_function)();
684 template <
typename C,
typename A,
typename R =
void>
696 member_class(class_object),
697 member_function(function)
709 return (member_class.*member_function)(a);
713 void (C::*member_function)(A);
743 template <
typename C,
typename A,
typename R =
void>
756 member_class(class_object),
757 member_function(function),
769 return (member_class.*member_function)(argument);
773 void (C::*member_function)(A);
806 template <
typename C,
typename A,
typename B,
typename R =
void>
818 member_class(class_object),
819 member_function(function)
832 return (member_class.*member_function)(a, b);
836 void (C::*member_function)(A, B);
854 template <
typename FunctionObject,
typename Result =
void>
893 template <
typename FunctionObject>
934 template <
typename FunctionObject,
typename Result =
void>
974 template <
typename FunctionObject>
1015 template <
typename FunctionObject,
typename T,
typename Result =
void>
1054 template <
typename FunctionObject,
typename T>
1095 template <
typename FunctionObject,
typename T,
typename Result =
void>
1135 template <
typename ReferenceWrapper,
typename T>
1179 template <
typename R>
1197 template <
typename A,
typename R>
1217 template <
typename A,
typename R,
typename I>
1238 template <
typename A,
typename R,
typename I>
1256 template <
typename C,
typename R>
1275 template <
typename C,
typename R>
1294 template <
typename C,
typename A,
typename R>
1316 template <
typename C,
typename A,
typename R>
1338 template <
typename C,
typename A,
typename R,
typename I>
1365 template <
typename C,
typename A,
typename R,
typename I>
virtual ~NullaryMemberFunction()
virtual ~BoundUnaryFreeFunction()
R result_type
The result type.
void operator()(C &class_object)
This ensures any children objects are deleted correctly.
virtual ~PartiallyBoundUnaryMemberFunction()
Embedded control libraries.
void operator()()
This ensures any children objects are deleted correctly.
virtual ~UnaryMemberFunction()
virtual ~PartiallyBoundBinaryMemberFunction()
UnaryFunctionCopy(const FunctionObject &f_o)
UnaryFunction child constructor for unary function objects.
Result operator()(T t)
This ensures any children objects are deleted correctly.
virtual ~BinaryFunction()
R operator()(A a)
This ensures any children objects are deleted correctly.
PartiallyBoundUnaryMemberFunction(R(C::*function)(A), C &class_object)
Binds a unary member function and creates a nullary function object.
A2 second_argument_type
The second argument type.
FunctionObject function_object
FunctionObject & function_object
BoundNullaryMemberFunction(R(C::*function)(), C &class_object)
Binds a unary member function and creates a nullary function object.
void operator()(T t)
This ensures any children objects are deleted correctly.
ReferenceWrapper::type FunctionObject
Nullary function object for bound unary global/static functions.
UnaryFunctionCopy(const FunctionObject &f_o)
UnaryFunction child constructor for unary function objects.
Create a NullaryFunction object composited from an existing function object.
virtual ~BoundNullaryMemberFunction()
Binary function object for unary member functions.
R operator()()
This ensures any children objects are deleted correctly.
virtual ~UnaryFreeFunction()
R operator()(A a)
This ensures any children objects are deleted correctly.
virtual ~NullaryFreeFunction()
UnaryFreeFunction(void(*function)(A))
Unary function object constructor for global/static unary functions with no return type...
FunctionObject & function_object
NullaryMemberFunction(void(C::*function)())
Unary function object constructor for void member functions.
BoundUnaryFreeFunction(R(*function)(A), A a)
Binds a unary function and creates a nullary function object.
void operator()()
This ensures any children objects are deleted correctly.
virtual ~BoundUnaryMemberFunction()
virtual result_type operator()()=0
Virtual function call required by nullary function objects.
Provides a wrapper which allows the original object to be passed like a reference.
PartiallyBoundBinaryMemberFunction(R(C::*function)(A, B), C &class_object)
Binds a binary member function and creates a binary function object.
virtual ~NullaryFunctionReference()
BoundNullaryMemberFunction(void(C::*function)(), C &class_object)
Binds a unary member function and creates a nullary function object.
Unary function object for partially bound unary member functions.
Create a UnaryFunction object composited from an existing function object.
void operator()(A a)
This ensures any children objects are deleted correctly.
Creates a unary function from a reference wrapper.
R operator()(C &class_object)
This ensures any children objects are deleted correctly.
Unary function object for member functions without arguments.
FunctionObject function_object
R operator()()
This ensures any children objects are deleted correctly.
virtual ~NullaryFunctionCopy()
virtual ~BoundUnaryFreeFunction()
UnaryFunctionReference(const ReferenceWrapper< FunctionObject > &wrapper)
Creates a UnaryFunction descendant from a reference wrapper.
Virtual interface definition for binary function objects.
virtual ~NullaryFunctionReference()
FunctionObject function_object
R result_type
The result type.
R operator()(C &class_object, A a)
This ensures any children objects are deleted correctly.
Creates a nullary function from a reference wrapper.
virtual ~NullaryFunctionCopy()
Nullary function object for bound nullary member functions.
A argument_type
The first argument type.
UnaryFreeFunction(R(*function)(A))
Unary function object constructor for global/static functions.
NullaryFunctionReference(const ReferenceWrapper< FunctionObject > &wrapper)
Creates a NullaryFunction descendant from a reference wrapper.
FunctionObject function_object
Result operator()()
This ensures any children objects are deleted correctly.
virtual ~BoundNullaryMemberFunction()
virtual ~UnaryFunctionCopy()
void operator()()
This ensures any children objects are deleted correctly.
virtual ~NullaryMemberFunction()
virtual ~UnaryMemberFunction()
NullaryMemberFunction(R(C::*function)())
Unary function object constructor for member functions without arguments.
Binary function object for partially bound binary member functions.
NullaryFunctionCopy(const FunctionObject &f_o)
NullaryFunction child constructor for nullary function objects.
virtual ~NullaryFunction()
void operator()()
This ensures any children objects are deleted correctly.
Nullary function object for bound unary member functions.
void operator()()
This ensures any children objects are deleted correctly.
virtual ~UnaryFunctionCopy()
UnaryMemberFunction(R(C::*function)(A))
Binary function object constructor for unary member functions.
UnaryFunctionReference(const ReferenceWrapper &wrapper)
Creates a UnaryFunction descendant from a reference wrapper.
Unary function object for global/static functions.
virtual ~UnaryFunctionReference()
Result operator()(T t)
This ensures any children objects are deleted correctly.
#define ecl_compile_time_concept_check(Model)
R result_type
The result type.
virtual ~UnaryFreeFunction()
Nullary function object for void global/static functions.
UnaryMemberFunction(void(C::*function)(A))
Binary function object constructor for unary member functions.
BoundUnaryFreeFunction(void(*function)(A), A a)
Binds a unary function and creates a nullary function object.
A1 first_argument_type
The first argument type.
NullaryFreeFunction(void(*function)())
Nullary function object constructor for void global/static functions with no args.
BoundUnaryMemberFunction(R(C::*function)(A), C &class_object, A a)
Binds a unary member function and creates a nullary function object.
NullaryFreeFunction(R(*function)())
Nullary function object constructor for global/static functions with no args.
R operator()(A a, B b)
This ensures any children objects are deleted correctly.
NullaryFunctionReference(const ReferenceWrapper< FunctionObject > &wrapper)
Creates a NullaryFunction descendant from a reference wrapper.
FunctionObject & function_object
virtual ~UnaryFunctionReference()
Virtual interface definition for unary function objects.
virtual ~NullaryFreeFunction()
R operator()()
This ensures any children objects are deleted correctly.
NullaryFunctionCopy(const FunctionObject &f_o)
NullaryFunction child constructor for nullary function objects.
void operator()(C &class_object, A a)
This ensures any children objects are deleted correctly.
FunctionObject & function_object
Virtual interface definition for nullary function objects.
Result operator()()
This ensures any children objects are deleted correctly.
NullaryFreeFunction< R > generateFunctionObject(R(*function)())
Generate a nullary function object from a void global/static function.
void operator()(T t)
This ensures any children objects are deleted correctly.
R operator()()
This ensures any children objects are deleted correctly.