Live Cells C++
Reactive Programming for C++
|
A stateless mutable computed cell that does not cache its own value. More...
#include <mutable_cell_view.hpp>
Public Member Functions | |
mutable_cell_view_base (F compute, R reverse, Os... args) | |
Create a stateless mutable computed cell. | |
void | value (value_type value) const |
Set the value of the cell. | |
Public Member Functions inherited from live_cells::compute_cell_base< F, Os... > | |
compute_cell_base (F compute, Ts... args) | |
Create a cell with a value that is a function of the values of the cells args. | |
auto | value () const |
Get the value of the cell. | |
Public Member Functions inherited from live_cells::dependent_cell< Ts... > | |
dependent_cell (Ts... args) | |
Create a cell with a value dependent on the argument cells in args. | |
void | add_observer (observer::ref o) const |
void | remove_observer (observer::ref o) const |
Additional Inherited Members | |
Protected Attributes inherited from live_cells::dependent_cell< Ts... > | |
merged_observable< Ts... > | observable |
A stateless mutable computed cell that does not cache its own value.
The value of the cell is computed whenever it is accessed and observers are added directly to the argument cells.
Cell
concept. As such this class should not be instantiated directly. Instead the cell_view()
function should be used to create stateless mutable computed cells.
|
inline |
Create a stateless mutable computed cell.
compute | Compute value function. This function, of no arguments, should compute the cell's value as a function of the cells in args. |
reverse | Reverse computation function. This function should set the values of the cells in args, such that compute returns the same value as the value that was assigned to the cell, which is passed to this function. |
args | Argument cells referenced in compute |
|
inline |
Set the value of the cell.
value | The new value |