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

Same as make_cell but also provides a value setter value(Parent::value_type) so that the definition satisfies the MutableCell concept. More...

#include <make_cell.hpp>

Inheritance diagram for live_cells::make_mutable_cell< C, Parent >:
Collaboration diagram for live_cells::make_mutable_cell< C, Parent >:

Public Member Functions

Parent::value_type operator= (const Parent::value_type &value)
 Set the value of the cell to value.
 
Parent::value_type operator= (const Parent::value_type &value) const
 Set the value of the cell.
 
void value (const Parent::value_type &value) const
 Set the value of the cell to value.
 
- Public Member Functions inherited from live_cells::make_cell< C >
template<typename K , typename... Args>
requires (!Keyable<C> && std::constructible_from<C,Args...>)
 make_cell (K &&key, Args &&... args)
 Constructor that allows a key to be provided, with args forwarded to the constructor of C.
 
template<typename... Args>
requires (!Keyable<C> && std::constructible_from<C,Args...>)
 make_cell (Args &&... args)
 Constructor that forwards all its arguments args to the constructor of C.
 
template<typename... Args>
requires (Keyable<C> && std::constructible_from<C,Args...>)
 make_cell (Args &&... args)
 Constructor that forwards all its arguments args to the constructor of C.
 
void add_observer (observer::ref obs) const
 Add an observer to the cell.
 
void remove_observer (observer::ref obs) const
 Remove an observer from the 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.
 
value_type operator() () const
 Get the value of the cell and track it as a dependency.
 
key_ref key () const
 Get the key identifying the cell.
 
key_ref key () const
 Get the key identifying the cell.
 

Additional Inherited Members

- Public Types inherited from live_cells::make_cell< C >
typedef cell_value_type< C > value_type
 Cell value type (return type of C::value()).
 
- Protected Attributes inherited from live_cells::make_cell< C >
cell
 
const std::enable_if<!Keyable< C >, key_ref >::type key_
 Key identifying the cell.
 

Detailed Description

template<typename C, typename Parent = make_cell<C>>
class live_cells::make_mutable_cell< C, Parent >

Same as make_cell but also provides a value setter value(Parent::value_type) so that the definition satisfies the MutableCell concept.

Member Function Documentation

◆ operator=() [1/2]

template<typename C , typename Parent = make_cell<C>>
Parent::value_type live_cells::make_mutable_cell< C, Parent >::operator= ( const Parent::value_type & value)
inline

Set the value of the cell to value.

Note
Implemented using C::value(value).
Parameters
valueThe new value of the cell
Returns
value

◆ operator=() [2/2]

template<typename C , typename Parent = make_cell<C>>
Parent::value_type live_cells::make_mutable_cell< C, Parent >::operator= ( const Parent::value_type & value) const
inline

Set the value of the cell.

This is equivalent to \prop value(value).

Note
This const version is provided to allow setting the value of a mutable cell within a lambda provided for the reverse computation function of a mutable computed cell.
Parameters
valueThe new value
Returns
value

◆ value()

template<typename C , typename Parent = make_cell<C>>
void live_cells::make_mutable_cell< C, Parent >::value ( const Parent::value_type & value) const
inline

Set the value of the cell to value.

Note
Implemented using C::value(value).
Parameters
valueThe new value of the cell

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