14namespace display_device {
25 explicit PersistentState(std::shared_ptr<SettingsPersistenceInterface> settings_persistence_api,
bool throw_on_load_error =
false);
32 [[nodiscard]]
bool persistState(
const std::optional<SingleDisplayConfigState> &state);
38 [[nodiscard]]
const std::optional<SingleDisplayConfigState> &
getState()
const;
41 std::shared_ptr<SettingsPersistenceInterface> m_settings_persistence_api;
44 std::optional<SingleDisplayConfigState> m_cached_state;
A simple wrapper around the SettingsPersistenceInterface and cached local state to keep them in sync.
Definition persistent_state.h:18
bool persistState(const std::optional< SingleDisplayConfigState > &state)
Store the new state via the interface and cache it.
Definition persistent_state.cpp:42
PersistentState(std::shared_ptr< SettingsPersistenceInterface > settings_persistence_api, bool throw_on_load_error=false)
Definition persistent_state.cpp:14
const std::optional< SingleDisplayConfigState > & getState() const
Get cached state.
Definition persistent_state.cpp:72
Declarations for the SettingsPersistenceInterface.
Declarations for the WinDisplayDeviceInterface.