7#include "observable.hpp"
8#include "../concurrency/concurrency.hpp"
9#include "../utility/utility.hpp"
10#include "../macros.hpp"
30 _rcu.emplace(value_type{});
37 template<
typename... Args>
40 _rcu.emplace(std::forward<Args>(args)...);
44 [[nodiscard]]
void const *read() const noexcept
override
49 [[nodiscard]]
void *copy(
void const *ptr)
const noexcept override
51 return _rcu.copy(
static_cast<value_type
const *
>(ptr));
54 void commit(
void *ptr)
noexcept override
56 _rcu.commit(
static_cast<value_type *
>(ptr));
59 void abort(
void *ptr)
const noexcept override
61 _rcu.abort(
static_cast<value_type *
>(ptr));
69 void read_unlock() const noexcept
override
80 void write_unlock() const noexcept
override
83 _write_mutex.unlock();
88 mutable unfair_mutex _write_mutex;
@ read_lock
Lock the file for reading, i.e. shared-lock.
@ write_lock
Lock the file for writing, i.e. exclusive-lock.
DOXYGEN BUG.
Definition algorithm.hpp:16
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
An abstract observable object.
Definition observable.hpp:29
Definition observable_value.hpp:19
constexpr observable_value(Args &&...args) noexcept
Construct the shared state and initialize the value.
Definition observable_value.hpp:38
constexpr observable_value() noexcept
Construct the shared state and default initialize the value.
Definition observable_value.hpp:28