Embedded Multicore Building Blocks V1.0.0
|
Wraps function pointers, member function pointers, and functors with up to five arguments. More...
#include <function.h>
Public Member Functions | |
template<class ClassType > | |
Function (ClassType const &obj) | |
Constructor from functor. More... | |
Function (ReturnType(*func)(...)) | |
Constructor from function pointer with return type ReturnType and up to five arguments. More... | |
template<class ClassType > | |
Function (ClassType &obj, ReturnType(ClassType::*func)(...)) | |
Constructor from object and member function pointer with return type ReturnType and up to five arguments. More... | |
Function (Function const &func) | |
Copy constructor. More... | |
~Function () | |
Destructor. More... | |
void | operator= (ReturnType(*func)(...)) |
Assigns this object a new function pointer. More... | |
void | operator= (Function &func) |
Assigns this object another Function. More... | |
template<class C > | |
void | operator= (C const &obj) |
Assigns this object a new functor. More... | |
ReturnType | operator() (...) |
Calls the wrapped function with the given parameters. More... | |
Wraps function pointers, member function pointers, and functors with up to five arguments.
|
explicit |
Constructor from functor.
Uses operator() with return type ReturnType and up to five arguments. Copies the functor.
obj | The functor to wrap. |
|
explicit |
Constructor from function pointer with return type ReturnType and up to five arguments.
func | The function pointer. |
embb::base::Function< ReturnType,... >::Function | ( | ClassType & | obj, |
ReturnType(ClassType::*)(...) | func | ||
) |
Constructor from object and member function pointer with return type ReturnType and up to five arguments.
obj | Reference to object. |
func | Member function pointer. |
embb::base::Function< ReturnType,... >::Function | ( | Function< ReturnType,... > const & | func | ) |
Copy constructor.
func | The Function to copy. |
embb::base::Function< ReturnType,... >::~Function | ( | ) |
Destructor.
void embb::base::Function< ReturnType,... >::operator= | ( | ReturnType(*)(...) | func | ) |
Assigns this object a new function pointer.
func | The function pointer. |
void embb::base::Function< ReturnType,... >::operator= | ( | Function< ReturnType,... > & | func | ) |
void embb::base::Function< ReturnType,... >::operator= | ( | C const & | obj | ) |
Assigns this object a new functor.
The functor is copied.
obj | The functor. |
ReturnType embb::base::Function< ReturnType,... >::operator() | ( | ... | ) |
Calls the wrapped function with the given parameters.