18#ifndef LIVE_CELLS_PEEK_CELL_HPP
19#define LIVE_CELLS_PEEK_CELL_HPP
22#include "cell_state.hpp"
23#include "stateful_cell.hpp"
99 typename C::value_type
value()
const {
129 template <
typename C>
static argument_tracker & global()
Definition tracker.hpp:99
Maintains the state of a stateful cell.
Definition cell_state.hpp:43
virtual void init()
Called before the first observer is added.
Definition cell_state.hpp:68
virtual void pause()
Called after the last observer is removed.
Definition cell_state.hpp:79
Dynamically typed Cell container.
Definition observable.hpp:133
T value() const
Get the value held by the underlying Cell.
Definition observable.hpp:197
void remove_observer(observer::ref obs)
Remove an observer from the underlying Cell.
Definition observable.hpp:172
void add_observer(observer::ref obs)
Add an observer to the underlying Cell.
Definition observable.hpp:159
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
Defines the interface for observing changes to the value of a Cell.
Definition types.hpp:32
Maintains the state of a peek_cell.
Definition peek_cell.hpp:40
void update(const key_ref &k, bool) override
Notifies this observer that the value of the Cell identified by k has changed.
Definition peek_cell.hpp:53
void init() override
Called before the first observer is added.
Definition peek_cell.hpp:56
peek_cell_state(key_ref k, C cell)
Create a peek_cell state.
Definition peek_cell.hpp:48
void will_update(const key_ref &k) override
Notifies this observer that the value of the Cell identified by k is going to change.
Definition peek_cell.hpp:52
void pause() override
Called after the last observer is removed.
Definition peek_cell.hpp:61
A Cell that reads the value of another Cell without notifying its observers when it changes.
Definition peek_cell.hpp:76
C::value_type operator()() const
Get the value of the argument cell and track it as a dependency.
Definition peek_cell.hpp:109
C::value_type value() const
Get the value of the argument cell.
Definition peek_cell.hpp:99
C::value_type value_type
The type of value held by this cell.
Definition peek_cell.hpp:83
peek_cell(const C &cell)
Create a peek cell that reads the value of cell.
Definition peek_cell.hpp:90
Base class for a cell with a state.
Definition stateful_cell.hpp:42
Base class for a key distinguished from other keys by one or more values.
Definition keys.hpp:147
value_key(key_ref value, Ts... rest)
Create a key distinguished from other keys by one or more values.
Definition keys.hpp:167
Defines the cell protocol.
Definition types.hpp:128
constexpr auto peek
Operator for reading the value of a cell without reacting to changes.
Definition peek_cell.hpp:147
Definition boolean.hpp:26
auto peek(const C &cell)
Create a Cell that reads the value of cell but does not notify its observers when the value has chang...
Definition peek_cell.hpp:130
Key identifying a peek_cell.
Definition peek_cell.hpp:29