Public Member Functions | Private Attributes
ecl::PartiallyBoundBinaryMemberFunction< C, A, B, R > Class Template Reference

Binary function object for partially bound binary member functions. More...

#include <function_objects.hpp>

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

List of all members.

Public Member Functions

operator() (A a, B b)
 This ensures any children objects are deleted correctly.
 PartiallyBoundBinaryMemberFunction (R(C::*function)(A, B), C &class_object)
 Binds a binary member function and creates a binary function object.
virtual ~PartiallyBoundBinaryMemberFunction ()

Private Attributes

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

Detailed Description

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

Binary function object for partially bound binary member functions.

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

Usage:

 class A {
 public:
     void f(int i, string n) { //...
     }

 int main() {
     A a;
     PartiallyBoundBinaryMemberFunction<A,int,string,void> function_object(&A::f,a);
     function_object(1,"dude");
 }
See also:
generateFunctionObject
Template Parameters:
C: the member function's class type.
A: the member function's first argument type.
B: the member function's second argument type.
R: the return type.
See also:
FunctionObjects.

Definition at line 807 of file function_objects.hpp.


Constructor & Destructor Documentation

template<typename C , typename A , typename B , typename R = void>
ecl::PartiallyBoundBinaryMemberFunction< C, A, B, R >::PartiallyBoundBinaryMemberFunction ( R(C::*)(A, B)  function,
C &  class_object 
) [inline]

Binds a binary member function and creates a binary function object.

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

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

Definition at line 817 of file function_objects.hpp.

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

Definition at line 821 of file function_objects.hpp.


Member Function Documentation

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

This ensures any children objects are deleted correctly.

A binary function object call.

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

Parameters:
a: the first argument passed to the function (type A).
b: the second argument passed to the function (type B).
Returns:
R : the function's return value.

Implements ecl::BinaryFunction< A, B, R >.

Definition at line 831 of file function_objects.hpp.


Member Data Documentation

template<typename C , typename A , typename B , typename R = void>
C& ecl::PartiallyBoundBinaryMemberFunction< C, A, B, R >::member_class [private]

Definition at line 835 of file function_objects.hpp.

template<typename C , typename A , typename B , typename R = void>
void(C::* ecl::PartiallyBoundBinaryMemberFunction< C, A, B, R >::member_function)(A, B) [private]

Definition at line 836 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 Jul 3 2017 02:21:39