runMACS
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
ConfigManager.h
Go to the documentation of this file.
1 #ifndef __CONFIGMANAGER_H
2 #define __CONFIGMANAGER_H
3 
4 #include <string>
5 #include <list>
6 
7 #include <json/json.h>
8 
9 #define CONFIGMANAGER ConfigManager::getInstance()
10 
12  public:
13  static ConfigManager & getInstance();
14  const Json::Value & operator[](const std::string & value_name) const;
15  void addConfigDir(const std::string & dirname);
16  void addConfigFile(const std::string & filename);
17 
18  private:
19  ConfigManager();
20  ~ConfigManager();
22  const ConfigManager & operator=(const ConfigManager &);
23 
24  void init(const std::list<std::string> & config_files);
25  std::list<Json::Value> roots;
26 
27  const Json::Value & getValue(const Json::Value & root, const std::string & name) const;
28 };
29 #endif // __CONFIGMANAGER_H
void addConfigDir(const std::string &dirname)
void addConfigFile(const std::string &filename)
const Json::Value & operator[](const std::string &value_name) const
static ConfigManager & getInstance()