]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Settings.hh
dispatcher alias methods
[chaz/yoink] / src / Moof / Settings.hh
index 9c29007613f90d6b35a7c8500208581dae05a5a5..653d4561dd1e2af4dd4b66ddcd1232b90b893f1d 100644 (file)
 #include <map>
 #include <string>
 
-#include <Moof/Singleton.hh>
 #include <Moof/Serializable.hh>
 
 
 namespace Mf {
 
 
-class Settings : public Singleton<Settings>
+class Settings
 {
 public:
        Settings() {}
        Settings(int argc, char* argv[]);
 
+       // get global instance
+       static Settings& getInstance();
+
        void parseArgs(int argc, char* argv[]);
 
        void loadFromFile(const std::string& filePath, bool precedence = false);
@@ -62,18 +64,18 @@ public:
        bool getNumber(const std::string& key, T& value);
 
 private:
-       std::map<std::string,SerializablePtr> map_;
+       Serializable::Map map_;
 };
 
 
 template <typename T>
 bool Settings::get(const std::string& key, T& value)
 {
-       std::map<std::string,SerializablePtr>::const_iterator it = map_.find(key);
+       Serializable::Map::const_iterator it = map_.find(key);
 
        if (it != map_.end())
        {
-               SerializablePtr obj = (*it).second;
+               SerializableP obj = (*it).second;
                return obj->get(value);
        }
        else
@@ -85,11 +87,11 @@ bool Settings::get(const std::string& key, T& value)
 template <typename T>
 bool Settings::getNumber(const std::string& key, T& value)
 {
-       std::map<std::string,SerializablePtr>::const_iterator it = map_.find(key);
+       Serializable::Map::const_iterator it = map_.find(key);
 
        if (it != map_.end())
        {
-               SerializablePtr obj = (*it).second;
+               SerializableP obj = (*it).second;
                return obj->getNumber(value);
        }
        else
This page took 0.020775 seconds and 4 git commands to generate.