Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
Namespaces | Classes
btcsignals Namespace Reference

btcsignals is a simple mechanism for signaling events to multiple subscribers. More...

Namespaces

namespace  detail
 

Classes

class  any_of
 A combiner, which checks if at least one callback returned true. More...
 
class  connection
 
class  null_value
 The default combiner, which only returns void. More...
 
class  scoped_connection
 
class  signal
 

Detailed Description

btcsignals is a simple mechanism for signaling events to multiple subscribers.

It is api-compatible with a minimal subset of boost::signals2.

Rather than using a custom slot type, and the features/complexity that they imply, std::function is used to store the callbacks. There is no automatic tracking of objects the callbacks refer to, so callers need to disconnect callbacks before those objects are destroyed.

Like boost::signals2, disconnecting a connection destroys its callback object, or if the callback is running at the time, destroys it when the call returns. Callbacks that are never disconnected are destroyed with the signal.

All usage is thread-safe except for interacting with a connection while copying/moving it on another thread.