CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLSAX2FileHandler.h
Go to the documentation of this file.
1 #ifndef DDL_SAX2FileHandler_H
2 #define DDL_SAX2FileHandler_H
3 
4 // ---------------------------------------------------------------------------
5 // Includes
6 // ---------------------------------------------------------------------------
7 // Parser parts.
10 
11 // DDCore parts
14 
15 // Xerces dependencies
16 #include <xercesc/sax2/Attributes.hpp>
17 
18 #include <string>
19 #include <vector>
20 #include <map>
21 
23 
41 {
42 
43  public:
44 
45  // -----------------------------------------------------------------------
46  // Constructor and Destructor
47  // -----------------------------------------------------------------------
48 
49  // DDLSAX2FileHandler();
52 
53  void init() ;
54  // void setStorage( DDCompactView & cpv );
55 
56  // -----------------------------------------------------------------------
57  // Handlers for the SAX ContentHandler interface
58  // -----------------------------------------------------------------------
59 
60  void startElement(const XMLCh* const uri, const XMLCh* const localname
61  , const XMLCh* const qname, const Attributes& attrs);
62  void endElement(const XMLCh* const uri, const XMLCh* const localname
63  , const XMLCh* const qname);
64  void characters (const XMLCh *const chars, const unsigned int length);
65  void comment (const XMLCh *const chars, const unsigned int length );
66 
67  // virtual std::string extractFileName(std::string fullname);
68 
69  virtual const std::string& parent() const;
70  virtual const std::string& self() const;
71 
72  // -----------------------------------------------------------------------
73  // Dump information on number and name of elements processed.
74  // -----------------------------------------------------------------------
77 
78  protected:
80  void createDDConstants() const;
81  // Map that holds name and number of elements processed.
82  std::map < std::string, int> elementTypeCounter_;
83  std::vector<std::string> namesMap_;
84  std::vector < size_t > names_;
87 };
88 
89 #endif
DDLSAX2FileHandler(DDCompactView &cpv)
virtual const std::string & parent() const
type of data representation of DDCompactView
Definition: DDCompactView.h:76
DDLSAX2FileHandler is the SAX2 Handler for XML files found in the configuration file.
void dumpElementTypeCounter()
This dumps some statistics on elements encountered in the file.
void characters(const XMLCh *const chars, const unsigned int length)
DDLElementRegistry xmlelems_
void comment(const XMLCh *const chars, const unsigned int length)
std::vector< std::string > namesMap_
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
std::vector< size_t > names_
def qname
Definition: asciidump.py:315
std::map< std::string, int > elementTypeCounter_
DDCompactView & cpv_
DDLSAX2Handler inherits from Xerces C++ DefaultHandler.
The main class for processing parsed elements.
XERCES_CPP_NAMESPACE::Attributes Attributes
void createDDConstants() const
creates all DDConstant from the evaluator which has been already &#39;filled&#39; in the first scan of the do...
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs)