Live Cells C++
Reactive Programming for C++
|
Maintains the association between keys and cell states. More...
#include <cell_state.hpp>
Public Member Functions | |
template<typename S , typename... Args> | |
std::shared_ptr< S > | get (key_ref k, Args... args) |
void | remove (key_ref k) |
Static Public Member Functions | |
static state_manager & | global () |
Maintains the association between keys and cell states.
Retrieve a cell state associated with a given key, or create a new state if there is no state associated with the given key.
A state of type S is created by passing one argument to its constructor, the key.
If k is a unique_key, or k->is_unique() is true, a new state is always created without associating it with the key.
k | The key |
args | Additional arguments to pass to the constructor of the state. |
|
inlinestatic |
Retrieve the global state_manager instance.
Remove the state associated with a given key.
k | The key |