|
ComSquare
|
A callback where you can subscribe to and emit it. More...
#include <Callback.hpp>
Public Member Functions | |
| template<typename Func > | |
| int | addCallback (Func callback) |
| Add a method to be called when this callback is invoked. More... | |
| void | removeCallback (int id) |
| Remove a function from this callback. More... | |
| void | operator() (Types ...args) const |
| Callback ()=default | |
| A default constructor. More... | |
| Callback (const Callback &)=default | |
| A default copy constructor. More... | |
| ~Callback ()=default | |
| A default destructor. More... | |
| Callback & | operator= (const Callback &)=default |
| A default assignment operator. More... | |
| template<typename Func > | |
| Callback (Func callback) | |
| Implicitly transform a callable into a callback. More... | |
Private Attributes | |
| int | _nextID = 0 |
| std::unordered_map< int, std::function< void(Types...)> > | _functions = {} |
| The list of functions to call. More... | |
A callback where you can subscribe to and emit it.
|
default |
A default constructor.
|
default |
A default copy constructor.
|
default |
A default destructor.
|
inline |
Implicitly transform a callable into a callback.
|
inline |
Add a method to be called when this callback is invoked.
| callback | The list of arguments of the callback method |
|
inline |
|
default |
A default assignment operator.
|
inline |
Remove a function from this callback.
| id | The ID of the function. |
|
private |
The list of functions to call.
|
private |
1.8.17