Live Cells C++
Reactive Programming for C++
Loading...
Searching...
No Matches
live_cells::dynamic_compute_state< F > Class Template Reference

Defines the computation function of the state of a dynamic_compute_cell. More...

#include <dynamic_compute_cell.hpp>

Public Member Functions

 dynamic_compute_state (F compute)
 
auto operator() (observer::ref state)
 Compute the value of dynamic_compute_cell.
 

Friends

class dynamic_compute_cell_state< F >
 

Detailed Description

template<std::invocable F>
class live_cells::dynamic_compute_state< F >

Defines the computation function of the state of a dynamic_compute_cell.

Constructor & Destructor Documentation

◆ dynamic_compute_state()

template<std::invocable F>
live_cells::dynamic_compute_state< F >::dynamic_compute_state ( F compute)
inline

Create the computation state for a dynamic_compute_cell.

The function compute is called with no arguments, to compute the value of the cell. It should reference its argument cells using the function call operator so that they are registered as dependencies of the computed cell.

Parameters
computeFunction of no arguments called to compute the value of the cell.

Member Function Documentation

◆ operator()()

template<std::invocable F>
auto live_cells::dynamic_compute_state< F >::operator() ( observer::ref state)
inline

Compute the value of dynamic_compute_cell.

Parameters
stateThe computed cell state.

The documentation for this class was generated from the following file: