Public Member Functions | Private Attributes
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]

List of all members.

Public Member Functions

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.
virtual ~PartiallyBoundUnaryMemberFunction ()

Private Attributes

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

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,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 685 of file function_objects.hpp.


Constructor & Destructor Documentation

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.

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

Definition at line 699 of file function_objects.hpp.


Member Function Documentation

template<typename C , typename A , typename R = void>
R ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::operator() ( a) [inline, virtual]

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

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.

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 Wed Aug 26 2015 11:27:20