21 #ifndef SETTINGNOTIFIER_H 22 #define SETTINGNOTIFIER_H 24 #include "Utils/Logger/Logger.h" 25 #include "Utils/Settings/SayonaraClass.h" 26 #include "Utils/Settings/SettingKey.h" 38 void sig_value_changed();
42 void add_listener(T* c,
void (T::*fn)())
44 connect(
this, &AbstrSettingNotifier::sig_value_changed, c, fn);
48 template<
typename KeyClass>
72 emit sig_value_changed();
80 template<
typename T,
typename KeyClassInstance>
81 typename std::enable_if<std::is_base_of<SayonaraClass, T>::value,
void>::type
82 listen(
const KeyClassInstance& key, T* t,
void (T::*fn)(),
bool run=
true)
84 using KeyClass=decltype(key);
90 auto callable = std::bind(fn, t);
97 #endif // SETTINGNOTIFIER_H Definition: SettingNotifier.h:33
Definition: SettingNotifier.h:49
Set namespace defines the setting: Which key and which type.
Definition: SettingKey.h:216