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 std::string description;
00029 };
00030
00031 }
00032 typedef boost::shared_ptr<ECF::Param> ParamP;
00033
00034
00041 class Registry
00042 {
00043 private:
00044 std::map < std::string, ParamP > parameters_;
00045 typedef std::map < std::string, ParamP >::iterator map_iter;
00046
00047 public:
00048 bool registerEntry(std::string, voidP, enum ECF::type, std::string description = "", uint index = 0);
00049 bool isRegistered(std::string);
00050 bool modifyEntry(std::string, voidP, uint index = 0);
00051 voidP getEntry(std::string, uint index = 0);
00052 ECF::type getType(std::string);
00053 bool isModified(std::string, uint index = 0);
00054 bool readEntries(const XMLNode& node, std::string prefix = "", uint index = 0);
00055 void dumpEntries(XMLNode&);
00056 void write(XMLNode&);
00057 };
00058 typedef boost::shared_ptr<Registry> RegistryP;
00059
00060 #endif
00061