Template Class ObservedVariable
Defined in File observed-variables.h
Class Documentation
-
template<typename T, std::uint8_t Observers = 1>
class ObservedVariable Adds immediate observer callbacks to synchronized, versioned storage.
Every set() invokes observers on the calling thread, even when the value is unchanged. Waiters wake only for a changed value. Use CE::State::VersionedVariable directly when callback thread affinity is undesirable. Callbacks run in array order after releasing the storage mutex, with this set’s argument, not a later snapshot. Their const reference is borrowed for the call. Concurrent/reentrant sets can overlap callbacks; callbacks protect their own targets. A throw propagates after publication and skips later observers without rollback.
Public Functions
-
inline ObservedVariable &operator=(T value)
-
inline ::CE::State::VersionedSnapshot<T> snapshot() const
Declaration:
[[nodiscard]]
-
inline std::uint64_t revision() const
Declaration:
[[nodiscard]]
-
inline ::CE::State::VersionedSnapshot<T> wait_for_change(std::uint64_t since) const
Declaration:
[[nodiscard]]
-
inline void wait_until_change() const
-
inline ObservedVariable &operator=(T value)