Simpact Cyan
Population based event driven simulation using mNRM
configwriter.h
1 #ifndef CONFIGWRITER_H
2 
3 #define CONFIGWRITER_H
4 
5 #include "errut/errorbase.h"
6 #include <vector>
7 #include <map>
8 
9 // TODO: merge this with configreader?
10 class ConfigWriter : public errut::ErrorBase
11 {
12 public:
13  ConfigWriter();
14  ~ConfigWriter();
15 
16  bool addKey(const std::string &key, double value);
17  bool addKey(const std::string &key, int value);
18  bool addKey(const std::string &key, bool value);
19  bool addKey(const std::string &key, const char *pStr);
20  bool addKey(const std::string &key, const std::string &value);
21 
22  void getKeys(std::vector<std::string> &keys) const;
23  bool getKeyValue(const std::string &key, std::string &value) const;
24 private:
25  std::map<std::string,std::string> m_keyValues;
26 };
27 
28 #endif // CONFIGWRITER_H
Base class which allows an error message to be set.
Definition: errorbase.h:49