14namespace display_device {
25 explicit MacPersistentState(std::shared_ptr<SettingsPersistenceInterface> settings_persistence_api,
bool throw_on_load_error =
false);
32 [[nodiscard]]
bool persistState(
const std::optional<MacSingleDisplayConfigState> &state);
38 [[nodiscard]]
const std::optional<MacSingleDisplayConfigState> &
getState()
const;
47 std::shared_ptr<SettingsPersistenceInterface> m_settings_persistence_api;
48 std::optional<MacSingleDisplayConfigState> m_cached_state;
A wrapper around SettingsPersistenceInterface and cached macOS state.
Definition persistent_state.h:18
const std::shared_ptr< SettingsPersistenceInterface > & getSettingsPersistenceApi() const
Get the settings persistence API.
Definition persistent_state.cpp:72
const std::optional< MacSingleDisplayConfigState > & getState() const
Get cached state.
Definition persistent_state.cpp:68
MacPersistentState(std::shared_ptr< SettingsPersistenceInterface > settings_persistence_api, bool throw_on_load_error=false)
Default constructor for the class.
Definition persistent_state.cpp:28
bool persistState(const std::optional< MacSingleDisplayConfigState > &state)
Store the new state via the interface and cache it.
Definition persistent_state.cpp:56
Declarations for macOS specific display device types.
Declarations for the SettingsPersistenceInterface.