
Options singleton for engine-related options
The options are read at system startup and saved at shutdown.
Public Types | |
| typedef std::map< std::string, OptionValue > | Map |
Public Member Functions | |
| void | clear () |
| OptionValue | get (const std::string &key, OptionValue def=0, bool add=false) |
| retrieves a value | |
| void | load (const std::string &file, bool clear=true) |
loads settings from file | |
| void | reload (bool clearOld=true) |
reloads the options from OPTIONS_FILE | |
| void | remove (const std::string &key) |
| void | save (const std::string &file) const |
| saves settings to a file | |
| void | set (const std::string &key, OptionValue val) |
| sets a value | |
Static Public Member Functions | |
| static void | destroyInstance () |
| may be used to manually destroy the singleton instance | |
| static EngineOptions * | getInstance () |
| accesses the singleton instance | |
| static bool | isActive () |
| checks if the singleton is active | |
| static bool | isDestroyed () |
| checks if the singleton is destroyed | |
| static bool | isVirgin () |
| checks if the singleton has not been initialized | |
Public Attributes | |
| Map | options |
Static Public Attributes | |
| static const std::string | OPTIONS_FILE |
Protected Member Functions | |
| Singleton () | |
Static Protected Member Functions | |
| static void | destroyedError () |
| static void | initInstance () |
|
|
|
|
|
|
|
|
|
|
|
may be used to manually destroy the singleton instance If this function is not called, the instance is destroyed automatically during shutdown. |
|
||||||||||||||||
|
retrieves a value
If
|
|
|
accesses the singleton instance The exact operation executed by calling this function is determined by the singleton policies.
|
|
|
|
|
|
checks if the singleton is active
|
|
|
checks if the singleton is destroyed
This function returns
|
|
|
checks if the singleton has not been initialized A singleton is not initialized if no instance exists and no instance has been destroyed.
|
|
||||||||||||
|
loads settings from
If
|
|
|
reloads the options from
|
|
|
|
|
|
saves settings to a file
|
|
||||||||||||
|
sets a value
If set("foo",OptionValue(true)); set("foo",true); |
|
|
|
|
|
|
|
|
|
1.4.3