|
Lamp-Da 0.1
A compact lantern project
|
(store) Binds a local variable of type T to key in storage (with automatic read & save)
More...
#include <context_type.hpp>
Public Member Functions | |
| void LMBD_INLINE | setValue (T value) |
(optional) Set local to value then write key to store | |
| bool LMBD_INLINE | getValue () |
(optional) Read key from store, return True if local was written | |
| void LMBD_INLINE | getValue (T defVal) |
(optional) Read key value, if not found, set local to defVal | |
| bool LMBD_INLINE | hasValue () |
(optional) Return True if key is set in store, False if unknown | |
| KeyProxy (T &local) | |
Use ContextTy::storageFor to construct a KeyProxy bound to local. | |
Public Attributes | |
| T & | local |
| Local variable reference bound to KeyProxy. | |
Static Public Attributes | |
| static constexpr StoreEnum | key = _key |
Enumeration value uniquely identifying where local will be stored. | |
(store) Binds a local variable of type T to key in storage (with automatic read & save)
Before using this, you must define in your mode the following:
You will then be able to bind persistent storage to a local variable:
Other advanced use-cases are left undocumented, for experienced users :)