00001 #ifndef DD_XMLElementRegistry_H 00002 #define DD_XMLElementRegistry_H 00003 // ------------------------------------------------------------------------- 00004 // Includes 00005 // ------------------------------------------------------------------------- 00006 #include "DDXMLElement.h" 00007 00008 #include <map> 00009 #include <string> 00010 00011 // ------------------------------------------------------------------------- 00012 // Class declaration 00013 // ------------------------------------------------------------------------- 00014 00016 00029 class DDXMLElementRegistry 00030 { 00031 00032 friend std::ostream & operator<<(std::ostream & os, const DDXMLElementRegistry & element); 00033 00034 public: 00035 00036 typedef std::map <std::string, DDXMLElement*> RegistryMap; 00037 00039 virtual ~DDXMLElementRegistry(); 00040 00042 void registerElement(const std::string& name, DDXMLElement*); 00043 00045 00050 DDXMLElement* getElement(const std::string& name); 00051 00053 std::string getElementName(DDXMLElement* theElement); 00054 00055 void stream(std::ostream & os) const; 00056 00057 protected: 00058 00060 DDXMLElementRegistry(); 00061 00062 /* /// Way to check getElement returned a correct response. */ 00063 /* RegistryMap::iterator DDXMLElementRegistry::find(const std::string& name) const; */ 00064 00065 /* /// Way to check getElement returned a correct response. */ 00066 /* RegistryMap::iterator DDXMLElementRegistry::end() const; */ 00067 00068 private: 00069 RegistryMap registry_; 00070 00071 }; 00072 00073 #endif