38 [[nodiscard]]
virtual void reset() noexcept {}
42 void save() const noexcept;
69 ttlet lock = std::scoped_lock(mutex);
70 tt_axiom(_deserializing >= 0);
87 int _deserializing = 0;
89 template<
typename T,
typename Observable,
typename Key>
90 static void deserialize_value(Observable &obj,
datum const &data, Key
const &key)
noexcept
92 if (data.contains(key)) {
93 auto const &data_value = data[key];
94 if (holds_alternative<T>(data_value)) {
95 obj =
static_cast<T
>(data_value);
98 "Could not deserialize '{}' for key '{}' to a '{}' type.",
99 to_string(data_value),
112 mutable bool _modified =
false;
114 timer::callback_ptr_type _check_modified_ptr;
118 void set_modified() noexcept
120 ttlet
lock = std::scoped_lock(mutex);
121 tt_axiom(_deserializing >= 0);
122 if (_deserializing == 0) {
127 void check_modified() noexcept
129 ttlet
lock = std::scoped_lock(mutex);
130 tt_axiom(_deserializing >= 0);
user preferences.
Definition preferences.hpp:25
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:55
virtual void deserialize(datum const &data) noexcept
Deserialize the preferences.
Definition preferences.hpp:67
virtual void reset() noexcept
Reset data members to their default value.
Definition preferences.hpp:38