Scanframe Modular Application 0.1.0
|
Encapsulates the std::function() template. More...
#include <TClosure.h>
Public Types | |
typedef std::function< Result(Args...)> | func_type |
Function type of the lambda or function. | |
Public Member Functions | |
TClosure ()=default | |
Default constructor. | |
TClosure (const TClosure &c) | |
Copy constructor. | |
TClosure (const func_type &fn) | |
Function assignment constructor. | |
TClosure & | assign (const func_type &fn) |
Function assignment method for static function. | |
template<typename ClassType , typename MethodType , typename... BoundArgs> | |
TClosure & | assign (ClassType *cls, MethodType mtd, BoundArgs... args) |
Binds a non-static class member function to this instance. | |
TClosure & | unassign () |
Function assignment member. | |
TClosure & | operator= (const TClosure &c) |
Closure assignment operator. | |
TClosure & | operator= (const func_type &f) |
Closure assignment operator. | |
Result | operator() (Args... args) const |
Make the call to the member function. | |
bool | isAssigned () const |
Checks if the closure is valid for calling. | |
operator bool () const | |
Checks if the closure is valid for calling. | |
Protected Member Functions | |
Result | call (Args... args) const |
Makes the call to the member function. | |
Encapsulates the std::function() template.
Result | Return type of the function. |
Args | Variable amount of function arguments. |
typedef std::function<Result(Args...)> sf::TClosure< Result, Args >::func_type |
Function type of the lambda or function.
|
default |
Default constructor.
|
inline |
Copy constructor.
|
inlineexplicit |
Function assignment constructor.
|
inline |
Binds a non-static class member function to this instance.
Short for passing a std::bind(...) result the assign().
For example:
ClassType | Type having the to be called method. |
MethodType | Type from the passed class type. |
BoundArgs | Only std::placeholders::_? enumeration values. (see std::bind) |
cls | Pointer of the class having the passed method. |
mtd | Pointer to method of the given class. |
args | Amount of arguments needed to call the method using std::placeholders::_? enumeration values. |
|
inline |
Function assignment method for static function.
|
protected |
Makes the call to the member function.
args | List of arguments specified by the template. |
|
inline |
Checks if the closure is valid for calling.
|
inlineexplicit |
Checks if the closure is valid for calling.
|
inline |
Make the call to the member function.
args | List of arguments specified by the template. |
|
inline |
Closure assignment operator.
|
inline |
Closure assignment operator.
|
inline |
Function assignment member.