18#ifndef LIVE_CELLS_MUTABLE_CELL_VIEW_HPP
19#define LIVE_CELLS_MUTABLE_CELL_VIEW_HPP
25#include "make_cell.hpp"
26#include "compute_cell.hpp"
27#include "mutable_cell.hpp"
43 template <std::invocable F,
typename R,
typename... Os>
50 typedef std::invoke_result_t<F> value_type;
102 template <std::invocable F,
typename R, Cell... Ts>
179 template <
typename A1,
typename A2,
typename... As>
184 auto compute = std::get<1>(
packed);
185 auto reverse = std::get<2>(
packed);
187 return std::apply([&] (
auto...
args) {
189 return compute(
args.value()...);
196 template <
typename A1,
typename A2,
typename... As>
197 auto cell_view(A1 arg1, A2 arg2, As... args) {
198 auto packed = internal::pack<2>(arg1, arg2, args...);
200 auto fn_args = std::get<0>(packed);
201 auto compute = std::get<1>(packed);
202 auto reverse = std::get<2>(packed);
204 return std::apply([&] (
auto... args) {
206 return compute(args.value()...);
A cell with a value that is a function of one or more argument cells.
Definition compute_cell.hpp:44
auto value() const
Get the value of the cell.
Definition compute_cell.hpp:67
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
A stateless mutable computed cell that does not cache its own value.
Definition mutable_cell_view.hpp:44
void value(value_type value) const
Set the value of the cell.
Definition mutable_cell_view.hpp:79
mutable_cell_view_base(F compute, R reverse, Os... args)
Create a stateless mutable computed cell.
Definition mutable_cell_view.hpp:70
Definition boolean.hpp:26
auto make_mutable_cell_view(std::invocable auto compute, auto reverse, auto... args)
Definition mutable_cell_view.hpp:117
auto cell_view(key_ref key, A1 arg1, A2 arg2, As... args)
Definition mutable_cell_view.hpp:180
void batch(F fn)
Batch changes to the values of mutable cells.
Definition mutable_cell.hpp:307