Go to the documentation of this file.00001 #ifndef DDL_SAX2FileHandler_H
00002 #define DDL_SAX2FileHandler_H
00003
00004
00005
00006
00007
00008 #include "DetectorDescription/Parser/interface/DDLSAX2Handler.h"
00009 #include "DetectorDescription/Parser/interface/DDLElementRegistry.h"
00010
00011
00012 #include "DetectorDescription/Core/interface/DDName.h"
00013 #include "DetectorDescription/Core/interface/DDCompactView.h"
00014
00015
00016 #include <xercesc/sax2/Attributes.hpp>
00017
00018 #include <string>
00019 #include <vector>
00020 #include <map>
00021
00023
00040 class DDLSAX2FileHandler : public DDLSAX2Handler
00041 {
00042
00043 public:
00044
00045
00046
00047
00048
00049
00050 DDLSAX2FileHandler( DDCompactView& cpv );
00051 ~DDLSAX2FileHandler();
00052
00053 void init() ;
00054
00055
00056
00057
00058
00059
00060 void startElement(const XMLCh* const uri, const XMLCh* const localname
00061 , const XMLCh* const qname, const Attributes& attrs);
00062 void endElement(const XMLCh* const uri, const XMLCh* const localname
00063 , const XMLCh* const qname);
00064 void characters (const XMLCh *const chars, const unsigned int length);
00065 void comment (const XMLCh *const chars, const unsigned int length );
00066
00067
00068
00069 virtual const std::string& parent() const;
00070 virtual const std::string& self() const;
00071
00072
00073
00074
00076 void dumpElementTypeCounter();
00077
00078 protected:
00080 void createDDConstants() const;
00081
00082 std::map < std::string, int> elementTypeCounter_;
00083 std::vector<std::string> namesMap_;
00084 std::vector < size_t > names_;
00085 DDCompactView& cpv_;
00086 DDLElementRegistry xmlelems_;
00087 };
00088
00089 #endif