Nullary function object for bound unary member functions. More...
#include <function_objects.hpp>
Public Member Functions | |
BoundUnaryMemberFunction (R(C::*function)(A), C &class_object, A a) | |
Binds a unary member function and creates a nullary function object. | |
R | operator() () |
This ensures any children objects are deleted correctly. | |
virtual | ~BoundUnaryMemberFunction () |
Private Attributes | |
A | argument |
C & | member_class |
void(C::* | member_function )(A) |
Nullary function object for bound unary member functions.
Binds the class instance and argument for a unary member function and uses this to construct a nullary function object.
Usage:
class A { public: void f(int i) { //... } int main() { A a; BoundUnaryMemberFunction<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 744 of file function_objects.hpp.
ecl::BoundUnaryMemberFunction< C, A, R >::BoundUnaryMemberFunction | ( | R(C::*)(A) | function, |
C & | class_object, | ||
A | a | ||
) | [inline] |
Binds a unary member function and creates a nullary function object.
Accepts the function, class instance and a value for its single argument, binds them and creates a nullary function object.
function | : the unary global/static function. |
class_object | : the member function's class instance. |
a | : the value of the argument to bind. |
Definition at line 755 of file function_objects.hpp.
virtual ecl::BoundUnaryMemberFunction< C, A, R >::~BoundUnaryMemberFunction | ( | ) | [inline, virtual] |
Definition at line 760 of file function_objects.hpp.
R ecl::BoundUnaryMemberFunction< C, A, R >::operator() | ( | ) | [inline, virtual] |
This ensures any children objects are deleted correctly.
A nullary function object call.
Redirects the nullary function object call to the bound member function.
Implements ecl::NullaryFunction< R >.
Definition at line 768 of file function_objects.hpp.
A ecl::BoundUnaryMemberFunction< C, A, R >::argument [private] |
Definition at line 774 of file function_objects.hpp.
C& ecl::BoundUnaryMemberFunction< C, A, R >::member_class [private] |
Definition at line 772 of file function_objects.hpp.
void(C::* ecl::BoundUnaryMemberFunction< C, A, R >::member_function)(A) [private] |
Definition at line 773 of file function_objects.hpp.