Public Member Functions | Private Attributes | List of all members
ecl::UnaryMemberFunction< C, A, R > Class Template Reference

Binary function object for unary member functions. More...

#include <function_objects.hpp>

Inheritance diagram for ecl::UnaryMemberFunction< C, A, R >:
Inheritance graph
[legend]

Public Member Functions

operator() (C &class_object, A a)
 This ensures any children objects are deleted correctly. More...
 
 UnaryMemberFunction (R(C::*function)(A))
 Binary function object constructor for unary member functions. More...
 
virtual ~UnaryMemberFunction ()
 
- Public Member Functions inherited from ecl::BinaryFunction< C &, A, void >
virtual ~BinaryFunction ()
 

Private Attributes

R(C::* member_function )(A)
 

Additional Inherited Members

- Public Types inherited from ecl::BinaryFunction< C &, A, void >
typedef C & first_argument_type
 The first argument type. More...
 
typedef void result_type
 The result type. More...
 
typedef A second_argument_type
 The second argument type. More...
 

Detailed Description

template<typename C, typename A, typename R = void>
class ecl::UnaryMemberFunction< C, A, R >

Binary function object for unary member functions.

Creates a function object from a unary member function.

Usage:

class A {
public:
void f(int i) { //...
}
};
int main() {
A a;
UnaryMemberFunction<A,int,void> function_object(&A::f);
function_object(a,1);
}
Template Parameters
C: the member function's class type.
A: the member function's argument type.
R: the return type.
See also
ecl::utilities::UnaryMemberFunction<C,A,void>, generateFunctionObject, FunctionObjects.

Definition at line 493 of file function_objects.hpp.

Constructor & Destructor Documentation

◆ UnaryMemberFunction()

template<typename C , typename A , typename R = void>
ecl::UnaryMemberFunction< C, A, R >::UnaryMemberFunction ( R(C::*)(A)  function)
inline

Binary function object constructor for unary member functions.

Accepts a unary member function, and builds the function object around it.

Parameters
function: a unary member function.

Definition at line 503 of file function_objects.hpp.

◆ ~UnaryMemberFunction()

template<typename C , typename A , typename R = void>
virtual ecl::UnaryMemberFunction< C, A, R >::~UnaryMemberFunction ( )
inlinevirtual

Definition at line 504 of file function_objects.hpp.

Member Function Documentation

◆ operator()()

template<typename C , typename A , typename R = void>
R ecl::UnaryMemberFunction< C, A, R >::operator() ( C &  class_object,
a 
)
inlinevirtual

This ensures any children objects are deleted correctly.

A binary function object call.

Uses the specified class instance and argument to redirect the function call to the unary member function.

Parameters
class_object: the member function's class instance.
a: the member function's argument value.
Returns
R : the function's return value.

Implements ecl::BinaryFunction< C &, A, void >.

Definition at line 515 of file function_objects.hpp.

Member Data Documentation

◆ member_function

template<typename C , typename A , typename R = void>
R(C::* ecl::UnaryMemberFunction< C, A, R >::member_function) (A)
private

Definition at line 519 of file function_objects.hpp.


The documentation for this class was generated from the following file:
main
int main(int argc, char **argv)


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