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

Provides an interface for a cell with a value that is dependent on one or more argument cells. More...

#include <dependent_cell.hpp>

Collaboration diagram for live_cells::dependent_cell< Ts >:

Public Member Functions

 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
 

Protected Attributes

merged_observable< Ts... > observable
 

Detailed Description

template<Cell... Ts>
class live_cells::dependent_cell< Ts >

Provides an interface for a cell with a value that is dependent on one or more argument cells.

The observers of this cell are notified when the values of the argument cells change.

Note
This cell is stateless with its value computed whenever it is accessed and its observers added directly to the argument cells.
This is not a complete class and hence does not satisfy the Cell concept. Subclasses should a value() method that computes the cells value.

Constructor & Destructor Documentation

◆ dependent_cell()

template<Cell... Ts>
live_cells::dependent_cell< Ts >::dependent_cell ( Ts... args)
inline

Create a cell with a value dependent on the argument cells in args.

The observers of this cell are notified whenever the value of one of args changes.

Parameters
argsArgument cells

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