Public Member Functions | Private Attributes | List of all members
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]

Public Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from ecl::BinaryFunction< A, B, void >
typedef A first_argument_type
 The first argument type. More...
 
typedef void result_type
 The result type. More...
 
typedef B second_argument_type
 The second argument type. More...
 

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

Constructor & Destructor Documentation

◆ PartiallyBoundBinaryMemberFunction()

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

◆ ~PartiallyBoundBinaryMemberFunction()

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

Definition at line 827 of file function_objects.hpp.

Member Function Documentation

◆ operator()()

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

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, void >.

Definition at line 837 of file function_objects.hpp.

Member Data Documentation

◆ member_class

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

Definition at line 841 of file function_objects.hpp.

◆ member_function

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 842 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