Live Cells C++
Reactive Programming for C++
|
Namespaces | |
namespace | ops |
Classes | |
class | argument_tracker |
struct | bad_typed_cell_cast |
Exception thrown when attempting to cast a cell to a typed_cell with a value type that is incompatible with the cell's value type. More... | |
class | batch_update |
Defer changes to the values of mutable cells. More... | |
class | cell |
Dynamically typed Cell container. More... | |
class | cell_state |
Maintains the state of a stateful cell. More... | |
class | changes_only_cell_state |
Mixin that modifies a compute_cell_state subclass to only notify its observers if the new value of the cell is not equal (!=) to the previous value. More... | |
struct | changes_only_option |
Cell option specifying that the cell, to which it is applied, should only notify its observers when its new value is not equal (by == ) to its previous value. More... | |
class | compute_cell_base |
A cell with a value that is a function of one or more argument cells. More... | |
class | compute_cell_state |
Cell state for a cell which computes a value as a function of one or more argument cells. More... | |
class | constant_cell |
A cell which holds a constant value. More... | |
struct | constant_key |
Key identifying a constant_cell . More... | |
class | dependent_cell |
Provides an interface for a cell with a value that is dependent on one or more argument cells. More... | |
class | dynamic_compute_cell |
A computed cell which determines its argument cells at runtime. More... | |
class | dynamic_compute_cell_state |
Maintains the state of a dynamic_compute_cell . More... | |
class | dynamic_compute_changes_only_cell_state |
A dynamic_compute_cell_state that only notifies the observers of the cell if the new value of the cell is not equal to the previous value. More... | |
class | dynamic_compute_state |
Defines the computation function of the state of a dynamic_compute_cell . More... | |
class | dynamic_mutable_compute_cell |
A mutable computed cell with the argument cells determined dynamically. More... | |
class | dynamic_mutable_compute_cell_state |
Maintains the state of a dynamic_mutable_compute_cell . More... | |
class | dynamic_mutable_compute_changes_only_cell_state |
A dynamic_mutable_compute_cell_state that only notifies the observers of the cell if its value has actually changed. More... | |
class | key |
Defines the interface for a key which uniquely identifies a cell. More... | |
class | key_ref |
Dynamically type key container. More... | |
struct | make_cell |
Defines a cell class using C such that the constraints defined by the concept Cell are satisifed. More... | |
class | make_mutable_cell |
Same as make_cell but also provides a value setter value(Parent::value_type) so that the definition satisfies the MutableCell concept. More... | |
class | maybe |
Container holding a cell value or an exception that occurred while computing a value. More... | |
class | merged_observable |
Allows multiple cells to be observed at once. More... | |
class | merged_observable< T > |
class | mutable_cell |
A stateful cell which can have its value set directly. More... | |
class | mutable_cell_state |
Maintains the state of a mutable_cell . More... | |
class | mutable_cell_view_base |
A stateless mutable computed cell that does not cache its own value. More... | |
class | mutable_compute_cell_state |
Maintains the state of a mutable computed cell. More... | |
class | observer |
Defines the interface for observing changes to the value of a Cell . More... | |
class | observer_cell_state |
Provides functionality for observing a cell from a cell_state . More... | |
class | peek_cell |
A Cell that reads the value of another Cell without notifying its observers when it changes. More... | |
struct | peek_cell_key |
Key identifying a peek_cell. More... | |
class | peek_cell_state |
Maintains the state of a peek_cell . More... | |
class | previous_value_cell |
A Cell that evaluates to the previous value of another Cell . More... | |
struct | previous_value_cell_key |
Key identifying a previous_value_cell . More... | |
class | previous_value_cell_state |
Maintains the state of a previous_value_cell . More... | |
class | state_manager |
Maintains the association between keys and cell states. More... | |
class | stateful_cell |
Base class for a cell with a state. More... | |
class | static_mutable_compute_cell |
A mutable computed cell with arguments determined at compile-time. More... | |
class | static_mutable_compute_cell_state |
Maintains the state for a static_mutable_compute_cell . More... | |
class | static_mutable_compute_changes_only_cell_state |
A static_mutable_compute_cell_state that only notifies the observers of the cell when the cell's value has actually changed. More... | |
struct | stop_compute_exception |
Exception indicating that the value of a cell should not be computed. More... | |
class | store_cell |
A Cell that caches the value of another Cell . More... | |
class | store_cell_compute_state |
Defines the computation function of a store_cell . More... | |
struct | store_cell_key |
Key identifying a store_cell . More... | |
class | store_cell_state |
Maintains the state of a store_cell . More... | |
class | store_changes_only_cell_state |
A store_cell_state that only notifies the observers of the cell if the new value of the cell is not equal to its previous value. More... | |
class | typed_cell |
Dynamically typed Cell container with a static value type. More... | |
struct | uninitialized_cell_error |
Exception indicating that the value of a cell was referenced before its initial value was computed. More... | |
class | unique_key |
A key of uniquely identified by a single instance. More... | |
class | value_key |
Base class for a key distinguished from other keys by one or more values. More... | |
class | value_key< T > |
Base class for a key distinguished from other keys by one value. More... | |
class | watcher |
Handle for a cell watch function. More... | |
Concepts | |
concept | Computable |
Defines a type that computes a value when the call operator operator() is invoked. | |
concept | CellOrValue |
Concept specifying that T is either a Cell or a value that can be converted to a constant_cell . | |
concept | Keyable |
Concept defining an object that can be identified by a key. | |
concept | Trackable |
Concept defining an observable object that can be tracked dynamically as a dependency. | |
concept | Cell |
Defines the cell protocol. | |
concept | TypedCell |
Concept that constrains Cell to cells holding a specific value type T. | |
concept | MutableCell |
Concept defining a Cell that can have its value set. | |
concept | TypedMutableCell |
Concept that constrains MutableCell to cells holding a specific value type T. | |
Typedefs | |
template<std::invocable F, Cell... Ts> | |
using | compute_cell = make_cell<compute_cell_base<F,Ts...>> |
A computed cell with a static argument list. | |
template<typename C > | |
using | cell_value_type = decltype(std::declval<C>().value()) |
The return type of C::value(). | |
template<std::invocable F, typename R , Cell... Ts> | |
using | mutable_cell_view = make_mutable_cell<mutable_cell_view_base<F,R,Ts...>> |
A stateless mutable computed cell. | |
Functions | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator&& (const A &a, const B &b) |
Creates a Cell that evaluates to the logical and of the values of cells a and b. | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator|| (const A &a, const B &b) |
Create a cell that evaluates to the logical or of the values of cells a and b. | |
auto | operator! (const Cell auto &cell) |
Create a cell that evaluates to the logical not of the value of a cell. | |
auto | select (Cell auto condition, Cell auto if_true, Cell auto if_false) |
Create a cell which selects between the values of two cells based on the value of a condition cell. | |
auto | select (Cell auto condition, Cell auto if_true) |
Create a cell which evaluates to the value of another cell only if a condition is true . | |
auto | make_compute_cell (std::invocable auto f, auto... args) |
auto | make_compute_cell (key_ref key, std::invocable auto f, auto... args) |
template<std::invocable F> | |
auto | computed (F &&compute) |
Create a cell with a value that is a function of one or more argument cells. | |
template<std::invocable F> | |
auto | computed (changes_only_option option, F &&compute) |
Create a cell with a value that is a function of one or more argument cells and only notifies its observers when its value has actually changed. | |
template<std::invocable F> | |
auto | computed (key_ref key, F &&compute) |
Create a cell with a value that is a function of one or more argument cells. | |
template<std::invocable F> | |
auto | computed (changes_only_option option, key_ref key, F &&compute) |
Create a cell with a value that is a function of one or more argument cells and only notifies its observers when its value has actually changed. | |
template<typename A , typename... As> | |
auto | computed (A arg1, As... args) |
Create a cell with a value that is a function of the values of one or more argument cells. | |
template<typename A , typename... As> | |
auto | computed (key_ref key, A arg1, As... args) |
Create a cell with a value that is a function of the values of one or more argument cells. | |
void | none () |
Stop the computation of the current computed cell's value. | |
template<typename T > | |
constant_cell< T > | value (const T &value) |
auto | ensure_cell (const Cell auto &thing) |
Ensure that thing is a Cell . | |
template<typename T > | |
auto | ensure_cell (const T &thing) |
Ensure that thing is a Cell . | |
template<typename T , typename U > requires ( (Cell<T> && CellOrValue<U>) || (CellOrValue<T> && Cell<U>) ) | |
auto | operator== (const T &a, const U &b) |
Create a Cell that compares two cells for equality by == . | |
template<typename T , typename U > requires ( (Cell<T> && CellOrValue<U>) || (CellOrValue<T> && Cell<U>) ) | |
auto | operator!= (const T &a, const U &b) |
Create a Cell that compares two cells for inequality by != . | |
auto | on_error (const Cell auto &cell, const Cell auto &error_value) |
Create a Cell which handles all exceptions thrown while computing the value of a cell. | |
template<typename E > | |
auto | on_error (const Cell auto &cell, const Cell auto &error_value) |
Create a Cell which handles exceptions of type E thrown while computing the value of a cell. | |
bool | operator== (const key &k1, const key &k2) |
bool | operator!= (const key &k1, const key &k2) |
bool | operator== (const key_ref &k1, const key_ref &k2) |
bool | operator!= (const key_ref &k1, const key_ref &k2) |
auto | maybe_wrap (const std::invocable auto &f) |
Create a maybe holding the result of calling f. | |
template<typename A , typename B > | |
bool | operator== (const maybe< A > &a, const maybe< B > &b) |
template<typename T > | |
mutable_cell< T > | variable (T value) |
Create a new mutable cell with an initial value. | |
template<typename T > | |
mutable_cell< T > | variable (key_ref key, T value) |
Create a new mutable cell, identified by a key, with an initial value. | |
template<typename F > | |
void | batch (F fn) |
Batch changes to the values of mutable cells. | |
template<typename T > | |
T | operator+= (const MutableCell auto &c, const T &value) |
Add value to the value of Cell c. | |
template<typename T > | |
T | operator-= (const MutableCell auto &c, const T &value) |
Subtract value from the value of Cell c. | |
template<typename T > | |
T | operator*= (const MutableCell auto &c, const T &value) |
Multiply the value of Cell c by value. | |
template<typename T > | |
T | operator/= (const MutableCell auto &c, const T &value) |
Divide the value of Cell c by value. | |
template<typename T > | |
T | operator%= (const MutableCell auto &c, const T &value) |
Compute the remainder of the value of Cell c divided by value, and assign it to c. | |
template<typename T > | |
T | operator<<= (const MutableCell auto &c, const T &value) |
Left shift the value of Cell c by value. | |
template<typename T > | |
T | operator>>= (const MutableCell auto &c, const T &value) |
Right shift the value of Cell c by value. | |
template<typename T > | |
T | operator&= (const MutableCell auto &c, const T &value) |
Compute the bitwise and of the value of Cell c and value, and assign it to c. | |
template<typename T > | |
T | operator^= (const MutableCell auto &c, const T &value) |
Compute the bitwise exclusive or of the value of Cell c and value, and assign it to c. | |
template<typename T > | |
T | operator|= (const MutableCell auto &c, const T &value) |
Compute the bitwise or of the value of Cell c and value, and assign it to c. | |
auto | operator++ (const MutableCell auto &c) |
Increment the value of Cell c. | |
auto | operator++ (const MutableCell auto &c, int) |
Increment the value of Cell c. | |
auto | operator-- (const MutableCell auto &c) |
Decrement the value of Cell c. | |
auto | operator-- (const MutableCell auto &c, int) |
Decrement the value of Cell c. | |
auto | make_mutable_cell_view (std::invocable auto compute, auto reverse, auto... args) |
auto | make_mutable_cell_view (key_ref key, std::invocable auto compute, auto reverse, auto... args) |
template<typename A1 , typename A2 , typename... As> | |
auto | cell_view (key_ref key, A1 arg1, A2 arg2, As... args) |
template<typename A1 , typename A2 , typename... As> | |
auto | cell_view (A1 arg1, A2 arg2, As... args) |
template<std::invocable F, typename R > | |
auto | mutable_computed (F &&fn, R &&reverse) |
Create a mutable computed cell with dynamically determined argument cells. | |
template<std::invocable F, typename R > | |
auto | mutable_computed (changes_only_option option, F &&fn, R &&reverse) |
Create a mutable computed cell with dynamically determined argument cells that only notifies its observers when its value has actually changed. | |
template<typename A1 , typename A2 , typename... As> | |
auto | mutable_computed (A1 arg1, A2 arg2, As... args) |
Create a mutable computed cell. | |
template<typename A1 , typename A2 , typename... As> | |
auto | mutable_computed (changes_only_option option, A1 arg1, A2 arg2, As... args) |
Create a mutable computed cell that only notifies its observers when its value has actually changed. | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator+ (const A &a, const B &b) |
Create a Cell that computes the sum (using the + operator) of cells and . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator- (const A &a, const B &b) |
Create a Cell that computes the difference (using the - operator) of cells and . | |
auto | operator- (const Cell auto &cell) |
Create a Cell that negates the value of another cell using the unary - operator. | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator* (const A &a, const B &b) |
Create a Cell that computes the product (using the . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator/ (const A &a, const B &b) |
Create a Cell that computes the quotient (using the / operator) of cells and . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator% (const A &a, const B &b) |
Create a Cell that computes the remainder (using the % operator) of cell divided by . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator< (const A &a, const B &b) |
Create a Cell that is true if the value of cell is less than (by the < operator) the value of cell . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator<= (const A &a, const B &b) |
Create a Cell that is true if the value of cell is less than or equal to (by the <= operator) the value of cell . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator> (const A &a, const B &b) |
Create a Cell that is true if the value of cell is greater than (by the > operator) the value of cell . | |
template<typename A , typename B > requires ( (Cell<A> && CellOrValue<B>) || (CellOrValue<A> && Cell<B>) ) | |
auto | operator>= (const A &a, const B &b) |
Create a Cell that is true if the value of cell is greater than or equal to (by the >= operator) the value of cell . | |
template<typename C > | |
auto | peek (const C &cell) |
Create a Cell that reads the value of cell but does not notify its observers when the value has changes. | |
template<Cell C> | |
auto | previous (const C &cell) |
Create a Cell that evaluates to the previous value of cell. | |
template<std::invocable C, typename R , Cell... As> | |
auto | make_mutable_compute_cell (C compute, R reverse, As... args) |
Create a static_mutable_compute_cell with compute function compute, reverse compute function reverse and arguments args. | |
template<std::invocable C, typename R , Cell... As> | |
auto | make_mutable_compute_cell (changes_only_option option, C compute, R reverse, As... args) |
Create a static_mutable_compute_cell with compute function compute, reverse compute function reverse and arguments args, that only notifies its observers when its value has actually changed. | |
template<Cell C> | |
auto | store (const C &arg) |
Create a Cell that caches the value of another Cell . | |
template<Cell C> | |
auto | store (changes_only_option option, const C &arg) |
Create a Cell that caches the value of another Cell and only notifies its observers when its value has actually changed. | |
template<typename F > | |
std::shared_ptr< watcher > | watch (F fn) |
Register a cell watch function. | |
Namespace containing all functions and classes provided by the live cells library.
using live_cells::compute_cell = make_cell<compute_cell_base<F,Ts...>> |
A computed cell with a static argument list.
This cell is stateless in that it does not cache its value, nor keeps track of its own observers. Instead, its value is computed whenever value()
is called and observers added to this cell are added directly to the argument cells.
A stateless mutable computed cell.
This implements a mutable computed cell which does not cache its value. Instead its value is computed on demand and observers are added directly to the argument cells.
Cell
and MutableCell
concepts. Batch changes to the values of mutable cells.
The function fn is called with zero arguments. When the value of a mutable cell is set within fn, the observers of the cell are only notified of the change after fn returns.
fn | A function of zero arguments |
Create a stateless mutable computed cell.
This is like a mutable cell view but it does not store its own value nor does it track its own observers. As a result this cell has slightly different semantics from a mutable computed cell, in that its value is always recomputed when accessed even after it is set explicitly.
key | The key identifying the cell. |
arg1 | First argument to compute value function. |
arg2,args | Remaining compute value function arguments followed by compute value and reverse compute functions. |
The compute value function is passed the values of the argument cells, in the same order as they are provided in the argument list.
The reverse compute function (last in the argument list) is passed the value that was assigned to the cell.
Create a cell with a value that is a function of the values of one or more argument cells.
arg1 | First argument to value computation function. |
args | Remaining arguments followed by compute value function. The compute value function is called to compute the value of the cell when necessary. The values of the argument cells are passed to the compute value function in the same order as they are provided in this function. |
auto live_cells::computed | ( | changes_only_option | option, |
F && | compute ) |
Create a cell with a value that is a function of one or more argument cells and only notifies its observers when its value has actually changed.
The argument cells, referenced within compute, are determined dynamically. For this to work, the values of the argument cells must be referenced using the function call operator and not the Cell::value()
getter method.
option | Changes only cell option |
compute | Compute value function |
auto live_cells::computed | ( | changes_only_option | option, |
key_ref | key, | ||
F && | compute ) |
Create a cell with a value that is a function of one or more argument cells and only notifies its observers when its value has actually changed.
The argument cells, referenced within compute, are determined dynamically. For this to work, the values of the argument cells must be referenced using the function call operator and not the Cell::value()
getter method.
option | Changes only cell option |
key | Key identifying the cell |
compute | Compute value function |
auto live_cells::computed | ( | F && | compute | ) |
Create a cell with a value that is a function of one or more argument cells.
The argument cells, referenced within compute, are determined dynamically. For this to work, the values of the argument cells must be referenced using the function call operator and not the Cell::value()
getter method.
compute | Compute value function |
Create a cell with a value that is a function of the values of one or more argument cells.
key | Key identifying the cell |
arg1 | First argument to value computation function. |
args | Remaining arguments followed by compute value function. The compute value function is called to compute the value of the cell when necessary. The values of the argument cells are passed to the compute value function in the same order as they are provided in this function. |
Create a cell with a value that is a function of one or more argument cells.
The argument cells, referenced within compute, are determined dynamically. For this to work, the values of the argument cells must be referenced using the function call operator and not the Cell::value()
getter method.
key | Key identifying the cell |
compute | Compute value function |
Ensure that thing is a Cell
.
If thing is not a cell it is converted to a constant_cell
.
thing | A Cell or value |
Cell
Ensure that thing is a Cell
.
If thing is not a cell it is converted to a constant_cell
.
constant_cell
holding the value thing.thing | A Cell or value |
Cell
Create a stateless computed cell with a given compute value function and argument cells.
key | Key identifying the cell. |
f | A function of no arguments, called to compute the value of the cell. |
args | List of argument Cells on which the value of this cell depends. |
Create a stateless computed cell with a given compute value function and argument cells.
f | A function of no arguments, called to compute the value of the cell. |
args | List of argument Cells on which the value of this cell depends. |
auto live_cells::make_mutable_cell_view | ( | key_ref | key, |
std::invocable auto | compute, | ||
auto | reverse, | ||
auto... | args ) |
Create a stateless computed cell with a given compute and reverse function function and argument cells
key | Key identifying the cell. |
f | A function of no arguments, called to compute the value of the cell. |
args | List of argument Cells on which the value of this cell depends. |
Create a stateless mutable computed cell with a given compute and reverse function and argument cells.
f | A function of no arguments, called to compute the value of the cell. |
args | List of argument Cells on which the value of this cell depends. |
Create a static_mutable_compute_cell
with compute function compute, reverse compute function reverse and arguments args.
compute | Compute value function. |
reverse | Reverse compute function. |
args | Argument cells |
auto live_cells::make_mutable_compute_cell | ( | changes_only_option | option, |
C | compute, | ||
R | reverse, | ||
As... | args ) |
Create a static_mutable_compute_cell
with compute function compute, reverse compute function reverse and arguments args, that only notifies its observers when its value has actually changed.
option | Changes only cell option |
compute | Compute value function. |
reverse | Reverse compute function. |
args | Argument cells |
Create a maybe
holding the result of calling f.
f is called with no arguments. If it returns normally, the resulting maybe
holds the returned value. If f throws an exception the resulting maybe holds the thrown exception.
A | function of no arguments. |
maybe
holding the result of calling f. Create a mutable computed cell.
Ordinarily the value of the cell is the value computed by a function of the cells in args.
The returned cell is also a mutable cell, which means its value can be set explicitly. When the value of the cell is set explicitly, the reverse computation function is called. The reverse computation function, should set the values of the cells in args such that the compute value function returns the same value as the value that was assigned to the cell.
arg1 | First argument to compute value function. |
arg2,args | Remaining compute value function arguments followed by compute value and reverse compute functions. The compute value function is passed the values of the argument cells, in the same order as they are provided in the argument list. The reverse compute function (last in the argument list) is passed the value that was assigned to the cell. |
auto live_cells::mutable_computed | ( | changes_only_option | option, |
A1 | arg1, | ||
A2 | arg2, | ||
As... | args ) |
Create a mutable computed cell that only notifies its observers when its value has actually changed.
Ordinarily the value of the cell is the value computed by a function of the cells in args.
The returned cell is also a mutable cell, which means its value can be set explicitly. When the value of the cell is set explicitly, the reverse computation function is called. The reverse computation function, should set the values of the cells in args such that the compute value function returns the same value as the value that was assigned to the cell.
option | Changes only cell option |
arg1 | First argument to compute value function. |
arg2,args | Remaining compute value function arguments followed by compute value and reverse compute functions. The compute value function is passed the values of the argument cells, in the same order as they are provided in the argument list. The reverse compute function (last in the argument list) is passed the value that was assigned to the cell. |
auto live_cells::mutable_computed | ( | changes_only_option | option, |
F && | fn, | ||
R && | reverse ) |
Create a mutable computed cell with dynamically determined argument cells that only notifies its observers when its value has actually changed.
Ordinarily the value of the cell is the value computed by fn as a function of other cells.
The returned cell is also a mutable cell, which means its value can be set explicitly. When the value of the cell is set explicitly, the reverse computation function reverse is called. reverse should set the values of the cells referenced in fn such that fn returns the same value as the value that was assigned to the cell.
Cell::value()
getter method.option | Changes only cell option |
fn | Compute value function. This function is called with no arguments. |
reverse | Reverse computation function. This function is passed the value that was assigned to the cell. |
Create a mutable computed cell with dynamically determined argument cells.
Ordinarily the value of the cell is the value computed by fn as a function of other cells.
The returned cell is also a mutable cell, which means its value can be set explicitly. When the value of the cell is set explicitly, the reverse computation function reverse is called. reverse should set the values of the cells referenced in fn such that fn returns the same value as the value that was assigned to the cell.
Cell::value()
getter method.fn | Compute value function. This function is called with no arguments. |
reverse | Reverse computation function. This function is passed the value that was assigned to the cell. |
|
inline |
Stop the computation of the current computed cell's value.
When this method is called within the value computation of a cell, the cell's value is not recomputed. Instead its current value is preserved.
Create a Cell which handles all exceptions thrown while computing the value of a cell.
If an exception is thrown during the computation of the value of cell, the cell evaluates to the value of the error_value cell.
cell | The cell for which to handle exceptions |
error_value | The cell holding the value to use when an exception is thrown. |
Create a Cell which handles exceptions of type E thrown while computing the value of a cell.
If an exception is thrown during the computation of the value of cell, the cell evaluates to the value of the error_value cell.
cell | The cell for which to handle exceptions |
error_value | The cell holding the value to use when an exception is thrown. |
T live_cells::operator%= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator&= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator*= | ( | const MutableCell auto & | c, |
const T & | value ) |
auto live_cells::operator++ | ( | const MutableCell auto & | c | ) |
auto live_cells::operator++ | ( | const MutableCell auto & | c, |
int | ) |
T live_cells::operator+= | ( | const MutableCell auto & | c, |
const T & | value ) |
auto live_cells::operator- | ( | const Cell auto & | cell | ) |
auto live_cells::operator-- | ( | const MutableCell auto & | c | ) |
auto live_cells::operator-- | ( | const MutableCell auto & | c, |
int | ) |
T live_cells::operator-= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator/= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator<<= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator>>= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator^= | ( | const MutableCell auto & | c, |
const T & | value ) |
T live_cells::operator|= | ( | const MutableCell auto & | c, |
const T & | value ) |
Create a Cell
that evaluates to the previous value of cell.
cell | cell The argument cell. |
Create a cell which evaluates to the value of another cell only if a condition is true
.
If the value of the condition cell is true
, the cell evaluates to the value of the if_true cell. Otherwise the cell preserves its current value as if by calling none()
.
condition | Condition cell |
if_true | Cell selected when condition is true |
Create a cell which selects between the values of two cells based on the value of a condition cell.
If the value of the condition cell is true
, the cell evaluates to the value of the if_true cell. Otherwise the cell evaluates to the value of the if_false cell.
condition | Condition cell used to select between if_true and if_false |
if_true | Cell selected when condition is true |
if_false | Cell selected when condition is false |
auto live_cells::store | ( | changes_only_option | option, |
const C & | arg ) |
Create a Cell
that caches the value of another Cell
and only notifies its observers when its value has actually changed.
The returned cell reads the value of arg and caches it until it changes.
This cell guarantes that the value of arg is only recomputed when it when its dependencies change instead of being computed every time it is accessed, provided its value is only accessed through the returned cell.
option | Changes only cell option |
arg | The argument cell |
Create a Cell
that caches the value of another Cell
.
The returned cell reads the value of arg and caches it until it changes.
This cell guarantes that the value of arg is only recomputed when it when its dependencies change instead of being computed every time it is accessed, provided its value is only accessed through the returned cell.
arg | The argument cell |
constant_cell< T > live_cells::value | ( | const T & | value | ) |
Create a cell that holds a constant value.
value | The constant value. |
mutable_cell< T > live_cells::variable | ( | key_ref | key, |
T | value ) |
Create a new mutable cell, identified by a key, with an initial value.
key | Key identifying cell |
value | The initial value |
mutable_cell< T > live_cells::variable | ( | T | value | ) |
Create a new mutable cell with an initial value.
value | The initial value |
Register a cell watch function.
The function fn is called whenever the values of the cells referenced within it change.
fn is always called once immediately before this function returns, to determine which cells it references.
fn | A function of no arguments. |
watcher::stop()
method is called.