$search
Nullary function object for bound unary global/static functions. More...
#include <function_objects.hpp>
Public Member Functions | |
BoundUnaryFreeFunction (R(*function)(A), A a) | |
Binds a unary function and creates a nullary function object. | |
R | operator() () |
This ensures any children objects are deleted correctly. | |
virtual | ~BoundUnaryFreeFunction () |
Private Attributes | |
A | argument |
R(* | free_function )(A) |
Nullary function object for bound unary global/static functions.
Binds the argument to a unary global/static function and uses this to construct a nullary function object.
Usage:
void f(int i) {} int main() { BoundUnaryFreeFunction<int,void> function_object(f,1); function_object(); }
Note, often the use of generateFunctionObject is simpler.
A | : the type of the argument to be bound. | |
R | : the return type. |
Definition at line 287 of file function_objects.hpp.
ecl::BoundUnaryFreeFunction< A, R >::BoundUnaryFreeFunction | ( | R(*)(A) | function, | |
A | a | |||
) | [inline] |
Binds a unary function and creates a nullary function object.
Accepts both the function and a value for its single argument, binds them and creates a nullary function object.
function | : the unary global/static function. | |
a | : the argument to bind. |
Definition at line 298 of file function_objects.hpp.
virtual ecl::BoundUnaryFreeFunction< A, R >::~BoundUnaryFreeFunction | ( | ) | [inline, virtual] |
Definition at line 299 of file function_objects.hpp.
R ecl::BoundUnaryFreeFunction< A, R >::operator() | ( | ) | [inline, virtual] |
This ensures any children objects are deleted correctly.
A nullary function object call. Redirects the function object call to the bound global/static function.
Implements ecl::NullaryFunction< R >.
Definition at line 307 of file function_objects.hpp.
A ecl::BoundUnaryFreeFunction< A, R >::argument [private] |
Definition at line 311 of file function_objects.hpp.
R(* ecl::BoundUnaryFreeFunction< A, R >::free_function)(A) [private] |
Definition at line 310 of file function_objects.hpp.