GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
XMLHandler.h
1 #ifndef GEAR_XMLHandler_H
2 #define GEAR_XMLHandler_H 1
3 
4 #include <string>
5 
6 namespace gear {
7 
8  class TiXmlElement ;
9  class GearParameters ;
10  class GearMgr ;
11 
17  class XMLHandler {
18 
19  public:
20 
21  virtual ~XMLHandler() { /* no_op*/ }
22 
25  virtual TiXmlElement toXML( const GearParameters & parameters ) const = 0 ;
26 
27 
31  virtual GearParameters* fromXML( const TiXmlElement* xmlElement , GearMgr* gearMgr=0) const = 0 ;
32 
33 
34  }; // class
35 
36 
37  class TiXmlNode ;
38 
40  std::string getXMLAttribute(const TiXmlNode* node , const std::string& name ) ;
41 
43  std::string getOptionalXMLAttribute(const TiXmlNode* node , const std::string& name ,
44  const std::string& defaultValue) ;
45 
48  std::string getChildElementValue(const TiXmlNode* node , const std::string& name ) ;
49 
54  std::string getOptionalChildElementValue(const TiXmlNode* node , const std::string& name ,
55  const std::string& defaultValue ) ;
56 
57 
58 } // namespace gear
59 
60 #endif /* ifndef GEAR_XMLHandler_H */
std::string getOptionalXMLAttribute(const TiXmlNode *node, const std::string &name, const std::string &defaultValue)
Helper method used for parsing XML.
virtual GearParameters * fromXML(const TiXmlElement *xmlElement, GearMgr *gearMgr=0) const =0
Creates the approprtiate GearParameters subclass from the given XML element (node) and adss it to the...
Interface for XML handlers of GEAR classes.
Definition: XMLHandler.h:17
std::string getOptionalChildElementValue(const TiXmlNode *node, const std::string &name, const std::string &defaultValue)
Helper method used for parsing XML - returns the attribute &#39;value&#39; of the optional named child elemen...
Abstract interface for a set of parameters that can be used to describe the geometrical properties of...
The parent class for everything in the Document Object Model.
Definition: tinyxml.h:370
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
The element is a container class.
Definition: tinyxml.h:827
virtual TiXmlElement toXML(const GearParameters &parameters) const =0
Creates an XML node for the given parameters.
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
Definition: GearMgr.h:36
std::string getChildElementValue(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML - returns the attribute &#39;value&#39; of the named child element as doub...