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 <stdint.h>
7 #include <vector>
8 #include <map>
9 
10 // TODO: merge this with configreader?
11 class ConfigWriter : public errut::ErrorBase
12 {
13 public:
14  ConfigWriter();
15  ~ConfigWriter();
16 
17  bool addKey(const std::string &key, double value);
18  bool addKey(const std::string &key, const std::vector<double> &values);
19  bool addKey(const std::string &key, int value);
20  bool addKey(const std::string &key, int64_t value);
21  bool addKey(const std::string &key, bool value);
22  bool addKey(const std::string &key, const char *pStr);
23  bool addKey(const std::string &key, const std::string &value);
24 
25  void getKeys(std::vector<std::string> &keys) const;
26  bool getKeyValue(const std::string &key, std::string &value) const;
27 private:
28  std::map<std::string,std::string> m_keyValues;
29 };
30 
31 #endif // CONFIGWRITER_H
Base class which allows an error message to be set.
Definition: errorbase.h:49