Unary function object for partially bound unary member functions. More...
#include <function_objects.hpp>
Public Member Functions | |
R | 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) |
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(); }
C | : the member function's class type. |
A | : the member function's argument type. |
R | : the return type. |
Definition at line 685 of file function_objects.hpp.
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.
function | : the unary global/static function. |
class_object | : the member function's class instance. |
Definition at line 695 of file function_objects.hpp.
virtual ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::~PartiallyBoundUnaryMemberFunction | ( | ) | [inline, virtual] |
Definition at line 699 of file function_objects.hpp.
R ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::operator() | ( | A | 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.
a | : the argument passed to the function. |
Implements ecl::UnaryFunction< A, R >.
Definition at line 708 of file function_objects.hpp.
C& ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::member_class [private] |
Definition at line 712 of file function_objects.hpp.
void(C::* ecl::PartiallyBoundUnaryMemberFunction< C, A, R >::member_function)(A) [private] |
Definition at line 713 of file function_objects.hpp.