00001 #ifndef Registry_h
00002 #define Registry_h
00003
00004 #include <map>
00005
00006 #define NODE_ENTRY "Entry"
00007
00008 namespace ECF
00009 {
00010
00015 enum type
00016 { INT, UINT, STRING, FLOAT, DOUBLE, CHAR, ERROR };
00017
00018
00023 struct Param
00024 {
00025 voidP value;
00026 enum ECF::type T;
00027 bool bModified;
00028 };
00029
00030 }
00031 typedef boost::shared_ptr<ECF::Param> ParamP;
00032
00033
00040 class Registry
00041 {
00042 private:
00043 std::map < std::string, ParamP > parameters_;
00044 typedef std::map < std::string, ParamP >::iterator map_iter;
00045
00046 public:
00047 bool registerEntry(std::string, voidP, enum ECF::type, uint index = 0);
00048 bool isRegistered(std::string);
00049 bool modifyEntry(std::string, voidP, uint index = 0);
00050 voidP getEntry(std::string, uint index = 0);
00051 ECF::type getType(std::string);
00052 bool isModified(std::string, uint index = 0);
00053 bool readEntries(const XMLNode& node, std::string prefix = "", uint index = 0);
00054 void dumpEntries(std::ostream &os);
00055 void write(XMLNode&);
00056 };
00057 typedef boost::shared_ptr<Registry> RegistryP;
00058
00059 #endif
00060