7#include "group_ptr.hpp"
8#include "../coroutine/module.hpp"
9#include "../macros.hpp"
14namespace hi::inline
v1 {
21 void const *
const ptr;
31 constexpr virtual ~observable() =
default;
32 observable(observable
const&) =
delete;
33 observable(observable&&) =
delete;
34 observable& operator=(observable
const&) =
delete;
35 observable& operator=(observable&&) =
delete;
36 constexpr observable()
noexcept =
default;
43 [[nodiscard]]
virtual void const *
read() const noexcept = 0;
51 [[nodiscard]] virtual
void *
copy(
void const *ptr) const noexcept = 0;
58 virtual
void commit(
void *ptr) noexcept = 0;
65 virtual
void abort(
void *ptr) const noexcept = 0;
DOXYGEN BUG.
Definition algorithm.hpp:16
Enable a class to be used in a group_ptr.
Definition group_ptr.hpp:37
Definition observable.hpp:16
std::vector< std::string > path_type
The type of the path used for notifying observers.
Definition observable.hpp:19
virtual void read_unlock() const noexcept=0
Unlock for reading.
virtual void write_unlock() const noexcept=0
Unlock for writing.
virtual void read_lock() const noexcept=0
Lock for reading.
virtual void write_lock() const noexcept=0
Lock for writing.
virtual void commit(void *ptr) noexcept=0
Commit the modified copy.
virtual void const * read() const noexcept=0
Get a pointer to the current value.
virtual void * copy(void const *ptr) const noexcept=0
Allocate and make a copy of the value.
virtual void abort(void *ptr) const noexcept=0
Abort the modified copy.