21 #ifndef SAYONARA_SETTINGS_H_ 22 #define SAYONARA_SETTINGS_H_ 24 #include "Utils/Settings/SettingKey.h" 25 #include "Utils/Settings/Setting.h" 26 #include "Utils/Settings/SettingNotifier.h" 27 #include "Utils/Singleton.h" 31 #define GetSetting(x) Settings::instance()->get<x>() 32 #define SetSetting(x, y) Settings::instance()->set<x>(y) 33 #define ListenSetting(x, y) Set::listen<x>(this, &y) 34 #define ListenSettingNoCall(x, y) Set::listen<x>(this, &y, false) 36 using SettingArray=std::array<AbstrSetting*, static_cast<unsigned int>(SettingKey::Num_Setting_Keys)>;
51 const SettingArray& settings();
57 bool check_settings();
60 template<
typename KeyClass>
61 const typename KeyClass::Data& get()
const 64 SettingPtr s = static_cast<SettingPtr>( setting(KeyClass::key) );
69 template<
typename KeyClass>
70 void set(
const typename KeyClass::Data& val)
73 SettingPtr s = static_cast<SettingPtr>( setting(KeyClass::key) );
75 if( s->assign_value(val))
83 template<
typename KeyClass>
94 #endif // SAYONARA_SETTINGS_H_ The Setting class T is the pure value type e.g. QString.
Definition: Setting.h:73
Definition: SettingNotifier.h:47
The Settings class.
Definition: Settings.h:42
The AbstrSetting class Every setting needs a key and a value The SettingKey is only used inside the s...
Definition: Setting.h:37