18#ifndef LIVE_CELLS_MAKE_CELL_HPP
19#define LIVE_CELLS_MAKE_CELL_HPP
23#include "observable.hpp"
75 template <
typename K,
typename...
Args>
91 template <
typename...
Args>
95 key_(key_ref::create<unique_key>()) {}
109 template <
typename...
Args>
112 cell(std::forward<Args>(
args)...) {}
219 template <
typename C,
typename Parent = make_cell<C>>
221 using Parent::make_cell;
267 Parent::cell.value(
value);
static argument_tracker & global()
Definition tracker.hpp:99
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
key_ref key() const
Get the key that uniquely identifies the underlying Cell.
Definition observable.hpp:182
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
Same as make_cell but also provides a value setter value(Parent::value_type) so that the definition s...
Definition make_cell.hpp:220
Parent::value_type operator=(const Parent::value_type &value) const
Set the value of the cell.
Definition make_cell.hpp:254
Parent::value_type operator=(const Parent::value_type &value)
Set the value of the cell to value.
Definition make_cell.hpp:235
void value(const Parent::value_type &value) const
Set the value of the cell to value.
Definition make_cell.hpp:266
std::shared_ptr< observer > ref
Shared pointer to an observer.
Definition types.hpp:37
Concept defining an object that can be identified by a key.
Definition types.hpp:72
Concept defining an observable object that can be tracked dynamically as a dependency.
Definition types.hpp:88
Definition boolean.hpp:26
decltype(std::declval< C >().value()) cell_value_type
The return type of C::value().
Definition make_cell.hpp:32
Defines a cell class using C such that the constraints defined by the concept Cell are satisifed.
Definition make_cell.hpp:60
make_cell(Args &&... args)
Constructor that forwards all its arguments args to the constructor of C.
Definition make_cell.hpp:93
C cell
Definition make_cell.hpp:203
void remove_observer(observer::ref obs) const
Remove an observer from the cell.
Definition make_cell.hpp:134
make_cell(K &&key, Args &&... args)
Constructor that allows a key to be provided, with args forwarded to the constructor of C.
Definition make_cell.hpp:77
void add_observer(observer::ref obs) const
Add an observer to the cell.
Definition make_cell.hpp:123
cell_value_type< C > value_type
Cell value type (return type of C::value()).
Definition make_cell.hpp:64
const std::enable_if<!Keyable< C >, key_ref >::type key_
Key identifying the cell.
Definition make_cell.hpp:211
key_ref key() const
Get the key identifying the cell.
Definition make_cell.hpp:184
value_type operator()() const
Get the value of the cell and track it as a dependency.
Definition make_cell.hpp:173
value_type value() const
Get the value of the cell.
Definition make_cell.hpp:145
value_type operator()() const
Get the value of the cell and track it as a dependency.
Definition make_cell.hpp:157
key_ref key() const
Get the key identifying the cell.
Definition make_cell.hpp:195
make_cell(Args &&... args)
Constructor that forwards all its arguments args to the constructor of C.
Definition make_cell.hpp:111