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, void >
virtual ~UnaryFunction ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from ecl::UnaryFunction< A, void >
typedef A argument_type
 The first argument type. More...
 
typedef void 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 691 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 701 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 705 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, void >.

Definition at line 714 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 718 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 719 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