btcsignals is a simple mechanism for signaling events to multiple subscribers. It is api‐compatible with a minimal subset of boost::signals2.
Description
Rather than using a custom slot type, and the features/complexity that they imply, std::function is used to store the callbacks. Lifetime management of the callbacks is left up to the user.
All usage is thread‐safe except for interacting with a connection while copying/moving it on another thread.
Types
Name |
Description |
A combiner, which checks if at least one callback returned true. |
|
State object representing the liveness of a registered callback. signal::connect() returns an enabled connection which can be held and disabled in the future. |
|
The default combiner, which only returns void. |
|
RAII‐style connection management that disconnects on destruction. |
|
Functor for calling zero or more connected callbacks. |
Created with MrDocs