Ion
|
SettingManager tracks all existing SettingBase instances, and allows callers to obtain a map of all settings, get a specific setting or listen for when any setting in a group changes. More...
#include "settingmanager.h"
Public Types | |
typedef std::map< std::string, SettingBase * > | SettingMap |
Maps a setting's name to setting itself and its groups. More... | |
Public Member Functions | |
~SettingManager () | |
Static Public Member Functions | |
static SettingBase * | GetSetting (const std::string &name) |
Returns the setting with the passed name. More... | |
static const SettingMap & | GetAllSettings () |
Returns all settings keyed by their names. More... | |
static void | RegisterSetting (SettingBase *setting) |
Adds the setting to the manager and its groups. More... | |
static void | UnregisterSetting (SettingBase *setting) |
Removes the setting from the manager and its groups. More... | |
static void | RegisterGroupListener (const std::string &group, const std::string &key, const SettingBase::Listener &listener) |
Adds a function that will be called when any setting in the passed group changes. More... | |
static void | EnableGroupListener (const std::string &group, const std::string &key, bool enable) |
Enables or disables the group listener identified by key. More... | |
static void | UnregisterGroupListener (const std::string &group, const std::string &key) |
Removes the group listener identified by key. More... | |
SettingManager tracks all existing SettingBase instances, and allows callers to obtain a map of all settings, get a specific setting or listen for when any setting in a group changes.
See SettingBase for a discussion of groups.
Definition at line 34 of file settingmanager.h.
typedef std::map<std::string, SettingBase*> ion::base::SettingManager::SettingMap |
Maps a setting's name to setting itself and its groups.
Definition at line 37 of file settingmanager.h.
ion::base::SettingManager::~SettingManager | ( | ) |
Definition at line 225 of file settingmanager.cc.
|
static |
Enables or disables the group listener identified by key.
Definition at line 255 of file settingmanager.cc.
|
static |
Returns all settings keyed by their names.
Definition at line 232 of file settingmanager.cc.
|
static |
Returns the setting with the passed name.
Definition at line 228 of file settingmanager.cc.
|
static |
Adds a function that will be called when any setting in the passed group changes.
The listening function is identified by the passed key, which must be passed to UnregisterListener() to remove the listener. The particular setting that changed will be passed to the listener (see SettingBase::Listener).
Definition at line 248 of file settingmanager.cc.
|
static |
Adds the setting to the manager and its groups.
Definition at line 236 of file settingmanager.cc.
Referenced by ion::base::SettingBase::SettingBase().
|
static |
Removes the group listener identified by key.
Definition at line 261 of file settingmanager.cc.
|
static |
Removes the setting from the manager and its groups.
Definition at line 240 of file settingmanager.cc.
Referenced by ion::base::SettingBase::~SettingBase().