|
Clio
develop
The XRP Ledger API server.
|
Base class containing common ObservableValue functionality. More...
#include <ObservableValue.hpp>

Public Member Functions | |
| boost::signals2::connection | observe (std::invocable< T const & > auto &&fn) |
| Registers an observer callback for value changes. | |
| bool | hasObservers () const |
| Checks if there are any active observers. | |
| virtual void | forceNotify ()=0 |
| Forces notification of all observers with the current value. | |
Protected Member Functions | |
| void | notifyObservers (T const &value) |
| Notifies all observers with the given value. | |
Protected Attributes | |
| boost::signals2::signal< void(T const &)> | onUpdate_ |
Base class containing common ObservableValue functionality.
This class contains all the observer management and notification logic that is shared between regular and atomic ObservableValue specializations.
| T | The value type (for atomic specializations, this is the underlying type, not std::atomic<T>) |
|
pure virtual |
Forces notification of all observers with the current value.
This method will notify all observers with the current value regardless of whether the value has changed since the last notification.
Implemented in util::ObservableValue< std::atomic< T > >, and util::ObservableValue< T >.
|
inlinenodiscard |
Checks if there are any active observers.
|
inlineprotected |
Notifies all observers with the given value.
| value | The value to send to observers |
|
inline |
Registers an observer callback for value changes.
| fn | Callback function/lambda that accepts T const& |