Template Class State
Defined in File Reactivity.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Types
public Cacao::Reactivity::Dependency(Class Dependency)public Cacao::Reactivity::EffectOutput(Class EffectOutput)
Class Documentation
-
template<astra::Serializable T>
class State : public Cacao::Reactivity::Dependency, public Cacao::Reactivity::EffectOutput A source of reactive state.
Public Functions
-
template<typename ...Args>
inline State(Args&&... args) Create some state with an initial value.
- Parameters:
initial – The initial value to store
-
inline operator const T&() const
Get the current value.
- Returns:
The current held value
-
inline const T *operator->() const
Access the current value in a read-only manner.
-
inline State &operator=(const T &value)
Wholly replace the currently held value with a copy of an existing object.
- Parameters:
value – The new value
-
inline State &operator=(T &&value)
Wholly replace the currently held value with a new one.
- Parameters:
value – The new value
-
inline MutationProxy Modify()
Modify the contents of the currently held value.
-
template<typename ...Args>