|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Stores customization choices as JSON text, by PrefKey. More...
#include <preferences.hpp>
Public Member Functions | |
| IPreferencesStore (IPreferencesStore const &)=delete | |
| IPreferencesStore & | operator= (IPreferencesStore const &)=delete |
| IPreferencesStore (IPreferencesStore &&)=delete | |
| IPreferencesStore & | operator= (IPreferencesStore &&)=delete |
| virtual async::Completion< std::optional< std::string > > | get (PrefKey const &key)=0 |
| Reads a choice. | |
| virtual async::Completion< bool > | set (PrefKey const &key, std::string json)=0 |
| Writes a choice, replacing what was stored. | |
| virtual async::Completion< bool > | remove (PrefKey const &key)=0 |
| Forgets a choice, so the point is at the document's default again. | |
Stores customization choices as JSON text, by PrefKey.
Every call is asynchronous, so a store may sit on a database or a remote service. A store owns the executor its completions are delivered on. The preferences model calls it only with keys whose person the server derived and with values it has already bounded and parsed, so a store applies no bound of its own.
Definition at line 50 of file preferences.hpp.
|
nodiscardpure virtual |
Reads a choice.
| key | The entry. |
Implemented in morph::ui::MemoryPreferencesStore.
|
nodiscardpure virtual |
Writes a choice, replacing what was stored.
| key | The entry. |
| json | Its JSON text. |
Implemented in morph::ui::MemoryPreferencesStore.
|
nodiscardpure virtual |
Forgets a choice, so the point is at the document's default again.
| key | The entry. |
Implemented in morph::ui::MemoryPreferencesStore.