|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
The server's preferences model: reads and writes the calling person's choices through a store. More...
#include <preferences.hpp>
Public Member Functions | |
| PreferencesModel (std::shared_ptr< IPreferencesStore > store, PreferencesOptions options) | |
A model over store. | |
| ::core::async::Task< PrefValues > | execute (PrefLoad request) |
Reads the caller's stored choices of request's points. | |
| ::core::async::Task< PrefStored > | execute (PrefSet request) |
| Stores the caller's choice. | |
| ::core::async::Task< PrefRemoved > | execute (PrefRemove request) |
| Forgets the caller's choice. | |
The server's preferences model: reads and writes the calling person's choices through a store.
The person is the principal of the verified session (session::current()), which RemoteServer stamps from the authoriser before dispatch. The authoriser sees the model and the action, never the body, so the model is where the key is decided: no request names a person, and one that tries reaches only its own caller's entries. With no verified principal there is no key that belongs to the caller alone, so load answers nothing and set and remove are refused.
Definition at line 203 of file preferences.hpp.
|
inline |
A model over store.
| store | Where choices are kept. Shared by every instance. |
| options | The bounds. |
Definition at line 208 of file preferences.hpp.
|
inline |
Reads the caller's stored choices of request's points.
| request | The application, the scope and the points. |
Definition at line 219 of file preferences.hpp.
|
inline |
Stores the caller's choice.
| request | The key's application, scope and point, and the choice's JSON text. |
Definition at line 247 of file preferences.hpp.
|
inline |
Forgets the caller's choice.
| request | The key's application, scope and point. |
Definition at line 264 of file preferences.hpp.