EnTT 3.14.0
|
Minimal implementation of the monostate pattern. More...
#include <monostate.hpp>
Public Member Functions | |
template<typename Type > | |
monostate & | operator= (Type val) noexcept |
Assigns a value of a specific type to a given key. | |
template<typename Type > | |
operator Type () const noexcept | |
Gets a value of a specific type for a given key. | |
Minimal implementation of the monostate pattern.
A minimal, yet complete configuration system built on top of the monostate pattern. Thread safe by design, it works only with basic types like int
s or bool
s.
Multiple types and therefore more than one value can be associated with a single key. Because of this, users must pay attention to use the same type both during an assignment and when they try to read back their data. Otherwise, they can incur in unexpected results.
Definition at line 21 of file monostate.hpp.
|
inlinenoexcept |
Gets a value of a specific type for a given key.
Type | Type of the value to get. |
Definition at line 40 of file monostate.hpp.
|
inlinenoexcept |
Assigns a value of a specific type to a given key.
Type | Type of the value to assign. |
val | User data to assign to the given key. |
Definition at line 29 of file monostate.hpp.