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

Nullary function object for bound unary member functions. More...

#include <function_objects.hpp>

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

Public Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from ecl::NullaryFunction< void >
typedef void result_type
 The result type. More...
 

Detailed Description

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

Nullary function object for bound unary member functions.

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

Usage:

class A {
public:
void f(int i) { //...
}
int main() {
A a;
BoundUnaryMemberFunction<A,int,void> function_object(&A::f,a,1);
function_object();
}
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 750 of file function_objects.hpp.

Constructor & Destructor Documentation

◆ BoundUnaryMemberFunction()

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

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

Accepts the function, class instance and a value for its single argument, binds them and creates a nullary function object.

Parameters
function: the unary global/static function.
class_object: the member function's class instance.
a: the value of the argument to bind.

Definition at line 761 of file function_objects.hpp.

◆ ~BoundUnaryMemberFunction()

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

Definition at line 766 of file function_objects.hpp.

Member Function Documentation

◆ operator()()

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

This ensures any children objects are deleted correctly.

A nullary function object call.

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

Returns
R : the function's return value.

Implements ecl::NullaryFunction< void >.

Definition at line 774 of file function_objects.hpp.

Member Data Documentation

◆ argument

template<typename C , typename A , typename R = void>
A ecl::BoundUnaryMemberFunction< C, A, R >::argument
private

Definition at line 780 of file function_objects.hpp.

◆ member_class

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

Definition at line 778 of file function_objects.hpp.

◆ member_function

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

Definition at line 779 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