| 1 |
#ifndef HEADER_ENVIRON_H |
| 2 |
#define HEADER_ENVIRON_H |
| 3 |
|
| 4 |
class Path; |
| 5 |
class BaseMsg; |
| 6 |
|
| 7 |
#include "NoCopy.h" |
| 8 |
|
| 9 |
#include <string> |
| 10 |
#include <map> |
| 11 |
|
| 12 |
/** |
| 13 |
* Params. |
| 14 |
*/ |
| 15 |
class Environ : public NoCopy { |
| 16 |
private: |
| 17 |
typedef std::map<std::string,std::string> t_values; |
| 18 |
typedef std::multimap<std::string,BaseMsg*> t_watchers; |
| 19 |
t_values m_values; |
| 20 |
t_watchers m_watchers; |
| 21 |
public: |
| 22 |
virtual ~Environ(); |
| 23 |
void store(const Path &file); |
| 24 |
|
| 25 |
void setParam(const std::string &name, const std::string &value); |
| 26 |
void setParam(const std::string &name, long value); |
| 27 |
|
| 28 |
std::string getParam(const std::string &name, |
| 29 |
const std::string &implicit="") const; |
| 30 |
int getAsInt(const std::string &name, |
| 31 |
int implicit=0) const; |
| 32 |
bool getAsBool(const std::string &name, |
| 33 |
bool implicit=false) const; |
| 34 |
|
| 35 |
void addWatcher(const std::string &name, BaseMsg *msg); |
| 36 |
void removeWatchers(const std::string &listenerName); |
| 37 |
std::string toString() const; |
| 38 |
std::string getHelpInfo() const; |
| 39 |
}; |
| 40 |
|
| 41 |
#endif |