18#ifndef LIVE_CELLS_CONSTANT_CELL_HPP
19#define LIVE_CELLS_CONSTANT_CELL_HPP
24#include "observable.hpp"
44 bool eq(
const key &
k)
const noexcept override {
51 return std::hash<T>{}(
value);
86 return key_ref::create<constant_key<T>>(m_value);
131 template <
typename T>
140 template <
typename T>
172 template <
typename T>
A cell which holds a constant value.
Definition constant_cell.hpp:62
key_ref key() const
Get the key that identifies this cell.
Definition constant_cell.hpp:85
T value() const
Get the constant value held by this cell.
Definition constant_cell.hpp:94
T operator()() const
Get the constant value held by this cell.
Definition constant_cell.hpp:114
T value_type
The type of the constant value.
Definition constant_cell.hpp:65
constant_cell(const T &value)
Construct a cell with a constant value.
Definition constant_cell.hpp:75
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 a key which uniquely identifies a cell.
Definition keys.hpp:33
std::shared_ptr< observer > ref
Shared pointer to an observer.
Definition types.hpp:37
Concept specifying that T is either a Cell or a value that can be converted to a constant_cell.
Definition constant_cell.hpp:141
Defines the cell protocol.
Definition types.hpp:128
Definition boolean.hpp:26
constant_cell< T > value(const T &value)
Definition constant_cell.hpp:132
auto ensure_cell(const Cell auto &thing)
Ensure that thing is a Cell.
Definition constant_cell.hpp:155
Key identifying a constant_cell.
Definition constant_cell.hpp:32
const T value
Constant value.
Definition constant_cell.hpp:34
constant_key(T value)
Create a constant cell key identifying a constant_cell with a given value.
Definition constant_cell.hpp:42
std::size_t hash() const noexcept override
Compute the hash code for this key.
Definition constant_cell.hpp:50
bool eq(const key &k) const noexcept override
Compare this key to another key for equality.
Definition constant_cell.hpp:44