#include "callback.hh"
Inherits enable_shared_from_this< CallbackList< A... > >.
Public Types | |
using | Callback = std::function< void(const A &...)> |
Public Member Functions | |
size_t | add (const Callback &f) |
std::function< void()> | add_delcb (const Callback &f) |
ASE_DEFINE_MAKE_SHARED (CallbackList) | |
void | call (const std::function< void(const Callback &, const A &...)> &wrapper, const A &...args) |
bool | del (size_t id) |
bool | empty () const |
void | operator() (const A &...args) |
Reentrant callback list with configurable arguments.
using Callback = std::function<void(const A&...)> |
ASE_DEFINE_MAKE_SHARED | ( | CallbackList< A > | ) |
bool empty | ( | ) | const |
Check if the callback list is empty, i.e. invocation will not call any callbacks.
bool del | ( | size_t | id | ) |
Delete a previously added callback via its id, returns if any was found.
size_t add | ( | const Callback & | f | ) |
Add a callback, returns an id that can be used for deletion.
std::function< void()> add_delcb | ( | const Callback & | f | ) |
Add a callback and return a deleter that removes the callback when invoked.
void call | ( | const std::function< void(const Callback &, const A &...)> & | wrapper, |
const A &... | args | ||
) |
Call all callbacks in the order they were added via wrapper function.
void operator() | ( | const A &... | args | ) |
Call all callbacks in the order they were added.