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

Unary function object for partially bound unary member functions. More...

#include <function_objects.hpp>

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

Public Member Functions

operator() (A a)
 This ensures any children objects are deleted correctly. More...
 
 PartiallyBoundUnaryMemberFunction (R(C::*function)(A), C &class_object)
 Binds a unary member function and creates a nullary function object. More...
 
virtual ~PartiallyBoundUnaryMemberFunction ()
 
- Public Member Functions inherited from ecl::UnaryFunction< A, R >
virtual ~UnaryFunction ()
 

Private Attributes

C & member_class
 
void(C::* member_function )(A)
 

Additional Inherited Members

- Public Types inherited from ecl::UnaryFunction< A, R >
typedef A argument_type
 The first argument type. More...
 
typedef R result_type
 The result type. More...
 

Detailed Description

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

Unary function object for partially bound unary member functions.

Binds the class instance but not the argument for a unary member function and uses this to construct a unary function object.

Usage:

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

Definition at line 685 of file function_objects.hpp.

Constructor & Destructor Documentation

◆ PartiallyBoundUnaryMemberFunction()

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

Binds a unary member function and creates a nullary function object.

Accepts the function, class instance only (not the argument), binds them and creates a unary function object.

Parameters
function: the unary global/static function.
class_object: the member function's class instance.

Definition at line 695 of file function_objects.hpp.

◆ ~PartiallyBoundUnaryMemberFunction()

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

Definition at line 699 of file function_objects.hpp.

Member Function Documentation

◆ operator()()

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

This ensures any children objects are deleted correctly.

A unary function object call.

Redirects the unary function object call to the bound member function.

Parameters
a: the argument passed to the function.
Returns
R : the function's return value.

Implements ecl::UnaryFunction< A, R >.

Definition at line 708 of file function_objects.hpp.

Member Data Documentation

◆ member_class

template<typename C , typename A , typename R = void>
C& ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::member_class
private

Definition at line 712 of file function_objects.hpp.

◆ member_function

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

Definition at line 713 of file function_objects.hpp.


The documentation for this class was generated from the following file:


ecl_utilities
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:41