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

A Cell that evaluates to the previous value of another Cell. More...

#include <previous_value_cell.hpp>

Inheritance diagram for live_cells::previous_value_cell< C >:
Collaboration diagram for live_cells::previous_value_cell< C >:

Public Types

typedef C::value_type value_type
 The cell's value type.
 

Public Member Functions

 previous_value_cell (const C &cell)
 Create a cell that evaluates to the previous value of cell.
 
value_type value () const
 Get the value of the cell.
 
value_type operator() () const
 Get the value of the cell and track it as a dependency.
 
- Public Member Functions inherited from live_cells::stateful_cell< previous_value_cell_state< C > >
 stateful_cell (key_ref k, Args... args)
 Create a stateful cell and associate it with a state.
 
key_ref key () const
 Get the key identifying the cell.
 
void add_observer (observer::ref o) const
 Add an observer to the cell.
 
void remove_observer (observer::ref o) const
 Remove an observer from the cell.
 

Additional Inherited Members

- Protected Attributes inherited from live_cells::stateful_cell< previous_value_cell_state< C > >
const key_ref key_
 Key identifying the cell.
 
std::shared_ptr< previous_value_cell_state< C > > state
 Reference to the cell's state.
 

Detailed Description

template<Cell C>
class live_cells::previous_value_cell< C >

A Cell that evaluates to the previous value of another Cell.

Attention
This cell requires at least one observer to function.

Constructor & Destructor Documentation

◆ previous_value_cell()

template<Cell C>
live_cells::previous_value_cell< C >::previous_value_cell ( const C & cell)
inline

Create a cell that evaluates to the previous value of cell.

Parameters
cellThe argument cell.

Member Function Documentation

◆ operator()()

template<Cell C>
value_type live_cells::previous_value_cell< C >::operator() ( ) const
inline

Get the value of the cell and track it as a dependency.

Returns
The value of the cell.

◆ value()

template<Cell C>
value_type live_cells::previous_value_cell< C >::value ( ) const
inline

Get the value of the cell.

Returns
The value of the cell.

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