|
template<typename Broadcaster , typename F > |
auto | subscribe (Broadcaster &broadcaster, F &&f) |
| Function to subscribe to a broadcaster with a given function (either a lambda, std::function or function pointer). More...
|
|
template<typename Broadcaster , typename Signature , typename F >
requires (not Concepts::PointerOrSmartPointer<Broadcaster>) |
auto | subscribe (Broadcaster &broadcaster, F &&f) |
| Function to subscribe to a broadcaster with a given function (either a lambda, std::function or function pointer). More...
|
|
void | unSubscribeAll () |
| Unsubscribe from all listeners. At the moment unsubscribing can't be done more granularly. More...
|
|
void | unSubscribeLast () |
| Unsubscribe from the last subscribed listener. More...
|
|
void | unSubscribe (Token &&ts) |
|
The functions that the listener is listening to are stored in a vector of shared_ptr<void>. This type erasure has the advantage that we can listen to different function signatures and the Listener not being a template. This works, because the deleter of the stored objects is not bound to the type information and thus there are no memory leaks possible.