CMS 3D CMS Logo

DDLSAX2FileHandler.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_PARSER_DDL_SAX2_FILE_HANDLER_H
2 #define DETECTOR_DESCRIPTION_PARSER_DDL_SAX2_FILE_HANDLER_H
3 
4 #include <cstddef>
5 #include <map>
6 #include <string>
7 #include <vector>
8 #include <xercesc/sax2/Attributes.hpp>
9 
14 
15 class DDCompactView;
16 class DDLElementRegistry;
17 
19 
36 {
37  public:
38 
40  ~DDLSAX2FileHandler() override;
41 
42  void init() ;
43 
44  // -----------------------------------------------------------------------
45  // Handlers for the SAX ContentHandler interface
46  // -----------------------------------------------------------------------
47 
48  void startElement( const XMLCh* uri, const XMLCh* localname,
49  const XMLCh* qname, const Attributes& attrs) override;
50  void endElement( const XMLCh* uri, const XMLCh* localname,
51  const XMLCh* qname) override;
52  void characters( const XMLCh* chars, XMLSize_t length) override;
53  void comment( const XMLCh* chars, XMLSize_t length ) override;
54 
56  void createDDConstants() const;
57 
58  protected:
60  private:
61  virtual const std::string& parent() const;
62  virtual const std::string& self() const;
63 
64  private:
65 
66  std::vector< std::string > namesMap_;
67  std::vector< size_t > names_;
70 };
71 
72 #endif
virtual const std::string & parent() const
void comment(const XMLCh *chars, XMLSize_t length) override
std::vector< std::string > namesMap_
DDLElementRegistry & registry_
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
DDLSAX2FileHandler is the SAX2 Handler for XML files found in the configuration file.
~DDLSAX2FileHandler() override
DDLElementRegistry & registry()
std::vector< size_t > names_
DDCompactView & cpv_
void endElement(const XMLCh *uri, const XMLCh *localname, const XMLCh *qname) override
XERCES_CPP_NAMESPACE::Attributes Attributes
DDLSAX2Handler inherits from Xerces C++ DefaultHandler.
The main class for processing parsed elements.
void startElement(const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const Attributes &attrs) override
DDLSAX2FileHandler(DDCompactView &cpv, DDLElementRegistry &)
void characters(const XMLCh *chars, XMLSize_t length) override
void createDDConstants() const
creates all DDConstant from the evaluator which has been already &#39;filled&#39; in the first scan of the do...