Live Cells C++
Reactive Programming for C++
|
Defines the cell protocol. More...
#include <types.hpp>
Defines the cell protocol.
Cells must define the following types:
value_type
The type of value held by the observable.
Cell types must the following methods:
void add_observer(observer::ref o) const
;
Add observer o to this cell.
void remove_observer(observer::ref o) const
;
Remove observer o from this cell.
Implementations should only remove o after this method is called the same number of times as add_observer()
was called with the same observer o.
value_type value() const
;
Return the value held by the observable.
value_type operator()() const
;
Track this cell as a dependency and return its value.
key_ref key() const
;
Return a key that uniquely identifies the observable.