18#ifndef LIVE_CELLS_TYPES_HPP
19#define LIVE_CELLS_TYPES_HPP
37 typedef std::shared_ptr<observer>
ref;
73 { o.key() } -> std::same_as<key_ref>;
89 { o() } -> std::same_as<
decltype(o.value())>;
127 template <
typename T>
128 concept Cell =
requires(
const T &o) {
131 { o.value() } -> std::same_as<typename T::value_type>;
132 { o() } -> std::same_as<typename T::value_type>;
133 { o.key() } -> std::same_as<key_ref>;
140 template <
typename C,
typename T>
154 template <
typename C>
156 { c.value(std::declval<typename C::value_type>()) };
163 template <
typename C,
typename T>
177 template <
typename Op,
typename C>
179 { op(std::declval<C>()) } ->
Cell;
193 template <Cell C, Operator<C> O>
A computed cell which determines its argument cells at runtime.
Definition dynamic_compute_cell.hpp:153
Dynamically type key container.
Definition keys.hpp:76
Defines the interface for observing changes to the value of a Cell.
Definition types.hpp:32
virtual void will_update(const key_ref &k)=0
Notifies this observer that the value of the Cell identified by k is going to change.
std::shared_ptr< observer > ref
Shared pointer to an observer.
Definition types.hpp:37
virtual void update(const key_ref &k, bool did_change)=0
Notifies this observer that the value of the Cell identified by k has changed.
Defines the cell protocol.
Definition types.hpp:128
Concept defining an object that can be identified by a key.
Definition types.hpp:72
Concept defining a Cell that can have its value set.
Definition types.hpp:155
Concept defining an observable object that can be tracked dynamically as a dependency.
Definition types.hpp:88
Concept that constrains Cell to cells holding a specific value type T.
Definition types.hpp:141
Concept that constrains MutableCell to cells holding a specific value type T.
Definition types.hpp:164
Concept defining an operator on a cell.
Definition types.hpp:178
auto operator|(const C &arg, const O &op)
Apply an Operator op on a Cell arg.
Definition types.hpp:194
Definition boolean.hpp:26