7#include "observable.hpp"
9#include "unfair_mutex.hpp"
11namespace hi::inline
v1 {
27 _rcu.emplace(value_type{});
34 template<
typename... Args>
37 _rcu.emplace(std::forward<Args>(args)...);
41 [[nodiscard]]
void const *read() const noexcept
override
46 [[nodiscard]]
void *copy(
void const *ptr)
const noexcept override
48 return _rcu.copy(
static_cast<value_type
const *
>(ptr));
51 void commit(
void *ptr)
noexcept override
53 _rcu.commit(
static_cast<value_type *
>(ptr));
56 void abort(
void *ptr)
const noexcept override
58 _rcu.abort(
static_cast<value_type *
>(ptr));
66 void read_unlock() const noexcept
override
77 void write_unlock() const noexcept
override
80 _write_mutex.unlock();
85 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:15
An abstract observable object.
Definition observable.hpp:28
Definition observable_value.hpp:16
constexpr observable_value(Args &&...args) noexcept
Construct the shared state and initialize the value.
Definition observable_value.hpp:35
constexpr observable_value() noexcept
Construct the shared state and default initialize the value.
Definition observable_value.hpp:25