Live Cells C++
Reactive Programming for C++
|
Defines a cell class using C such that the constraints defined by the concept Cell
are satisifed.
More...
#include <make_cell.hpp>
Public Types | |
typedef cell_value_type< C > | value_type |
Cell value type (return type of C::value() ). | |
Public Member Functions | |
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. | |
Protected Attributes | |
C | cell |
const std::enable_if<!Keyable< C >, key_ref >::type | key_ |
Key identifying the cell. | |
Defines a cell class using C such that the constraints defined by the concept Cell
are satisifed.
In-effect, this class generates a cell interface from a prototype that does not satisfy all the constraints of Cell
.
C::value()
, C::add_observer()
, C::remove_observer()
are used to implement the value()
, add_observer()
and remove_observer()
methods respectively.
The return type of C::value()
is used to define the value_type
.
If C::key()
exists (that is C satisfies the Keyable
concept), it is used to implement the key()
method. Otherwise a default implementation is provided that returns the key given in the constructor.
If C::operator()()
exists (that is C satisfies the Trackable
concept), it is used to implement the operator()()
method. Otherwise a default implementation is provided.
|
inline |
Constructor that allows a key to be provided, with args forwarded to the constructor of C.
C::key()
is not defined.key | The key identifying the cell |
args | Arguments forwarded to constructor of C |
|
inline |
Constructor that forwards all its arguments args to the constructor of C.
A unique_key
is used as the key for this cell.
C::key()
is not defined.args | Arguments forwarded to constructor of C |
|
inline |
Constructor that forwards all its arguments args to the constructor of C.
This constructor does not generate or accept any key arguments. If any are provided, they are forwarded to the constructor of C.
C::key()
is defined.args | Arguments forwarded to constructor of C |
|
inline |
Add an observer to the cell.
Cell methods
C::add_observer()
.obs | Observer to add to cell |
|
inline |
Get the key identifying the cell.
C::key()
.
|
inline |
Get the key identifying the cell.
C::key()
is not defined.
|
inline |
Get the value of the cell and track it as a dependency.
C::value()
|
inline |
Get the value of the cell and track it as a dependency.
C::operator()()
is defined.C::operator()()
|
inline |
Remove an observer from the cell.
C::remove_observer()
.obs | Observer to remove from cell |
|
inline |
Get the value of the cell.
C::value()
|
protected |
The
partial cell implementation.
|
protected |
Key identifying the cell.
C::key()
is not defined.