00001 #ifndef Registry_h
00002 #define Registry_h
00003
00004 #include <map>
00005
00006 #define NODE_ENTRY "Entry"
00007
00008 namespace ECF
00009 {
00010
00011 enum type
00012 { INT, UINT, STRING, FLOAT, DOUBLE, CHAR, ERROR };
00013
00014 struct Param
00015 {
00016 voidP value;
00017 enum ECF::type T;
00018 bool bModified;
00019 };
00020
00021 }
00022 typedef boost::shared_ptr<ECF::Param> ParamP;
00023
00024
00030 class Registry
00031 {
00032 private:
00033 std::map < std::string, ParamP > parameters_;
00034 typedef std::map < std::string, ParamP >::iterator map_iter;
00035
00036 public:
00037 bool registerEntry(std::string, voidP, enum ECF::type, uint index = 0);
00038 bool isRegistered(std::string);
00039 bool modifyEntry(std::string, voidP, uint index = 0);
00040 voidP getEntry(std::string, uint index = 0);
00041 ECF::type getType(std::string);
00042 bool isModified(std::string, uint index = 0);
00043 bool readEntries(const XMLNode& node, std::string prefix = "", uint index = 0);
00044 void dumpEntries(std::ostream &os);
00045 void write(XMLNode&);
00046 };
00047 typedef boost::shared_ptr<Registry> RegistryP;
00048
00049 #endif
00050