37 [[nodiscard]]
virtual void reset() noexcept {}
41 void save() const noexcept;
68 ttlet lock = std::scoped_lock(mutex);
69 tt_axiom(_deserializing >= 0);
86 int _deserializing = 0;
88 template<
typename T,
typename Observable,
typename Key>
89 static void deserialize_value(Observable &obj,
datum const &data, Key
const &key)
noexcept
91 if (data.contains(key)) {
92 auto const &data_value = data[key];
93 if (holds_alternative<T>(data_value)) {
94 obj =
static_cast<T
>(data_value);
97 "Could not deserialize '{}' for key '{}' to a '{}' type.",
98 to_string(data_value),
111 mutable bool _modified =
false;
113 timer::callback_ptr_type _check_modified_ptr;
117 void set_modified() noexcept
119 ttlet
lock = std::scoped_lock(mutex);
120 tt_axiom(_deserializing >= 0);
121 if (_deserializing == 0) {
126 void check_modified() noexcept
128 ttlet
lock = std::scoped_lock(mutex);
129 tt_axiom(_deserializing >= 0);
user preferences.
Definition preferences.hpp:24
void load() noexcept
Load the preferences.
void save() const noexcept
Save the preferences.
virtual datum serialize() const noexcept
Serialize the preferences data.
Definition preferences.hpp:54
virtual void deserialize(datum const &data) noexcept
Deserialize the preferences.
Definition preferences.hpp:66
virtual void reset() noexcept
Reset data members to their default value.
Definition preferences.hpp:37