CMS 3D CMS Logo

DDLSAX2ExpressionHandler Class Reference

DDLSAX2ExpressionHandler is the first pass SAX2 Handler for XML files found in the configuration file. More...

#include <DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler.h>

Inheritance diagram for DDLSAX2ExpressionHandler:

DDLSAX2FileHandler DDLSAX2Handler

List of all members.

Public Member Functions

 DDLSAX2ExpressionHandler ()
void endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
void startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs)
 ~DDLSAX2ExpressionHandler ()

Private Attributes

std::string pElementName


Detailed Description

DDLSAX2ExpressionHandler is the first pass SAX2 Handler for XML files found in the configuration file.

Author:
Michael Case
DDLSAX2ExpressionHandler.h - description ------------------- begin: Mon Feb 25, 2002 email: case@ucdhep.ucdavis.edu

This processes only ConstantsSection/Parameter elements so there is no need to make it as elaborate as the second pass parser.

Definition at line 26 of file DDLSAX2ExpressionHandler.h.


Constructor & Destructor Documentation

DDLSAX2ExpressionHandler::DDLSAX2ExpressionHandler (  ) 

Definition at line 42 of file DDLSAX2ExpressionHandler.cc.

00042                                                       : inConstantsSection_(false)
00043 {
00044 }

DDLSAX2ExpressionHandler::~DDLSAX2ExpressionHandler (  ) 

Definition at line 46 of file DDLSAX2ExpressionHandler.cc.

00047 {
00048 }


Member Function Documentation

void DDLSAX2ExpressionHandler::endElement ( const XMLCh *const   uri,
const XMLCh *const   localname,
const XMLCh *const   qname 
) [virtual]

Reimplemented from DDLSAX2FileHandler.

Definition at line 92 of file DDLSAX2ExpressionHandler.cc.

00095 {
00096 
00097 }

void DDLSAX2ExpressionHandler::startElement ( const XMLCh *const   uri,
const XMLCh *const   localname,
const XMLCh *const   qname,
const Attributes attrs 
)

Reimplemented from DDLSAX2FileHandler.

Definition at line 53 of file DDLSAX2ExpressionHandler.cc.

References DDLSAX2Handler::attrCount_, DCOUT_V, DDLSAX2Handler::elementCount_, DDLSAX2FileHandler::elementTypeCounter_, DDLSAX2FileHandler::extractFileName(), DDLParser::getCurrFileName(), DDLSAX2Handler::getnmspace(), i, DDLParser::instance(), DDI::Singleton< I >::instance(), pElementName, and ExprEvalInterface::set().

00057 {
00058   //  static seal::SealTimer tdseh("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler::startElement(..)", false);
00059   
00060   ++elementCount_;
00061   attrCount_ += attrs.getLength();
00062 
00063   pElementName = StrX(qname).localForm();
00064 
00065   if (pElementName == "Constant") 
00066     {
00067       ++elementTypeCounter_[pElementName];
00068       DCOUT_V('P', std::string("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler: start ") + pElementName);
00069       unsigned int numAtts = attrs.getLength();
00070       std::string varName, varValue;
00071       for (unsigned int i = 0; i < numAtts; ++i)
00072         {
00073           std::string myattname(StrX(attrs.getLocalName(i)).localForm());
00074           std::string myvalue(StrX(attrs.getValue(i)).localForm());
00075 
00076           std::string myQName(StrX(attrs.getQName(i)).localForm());
00077           DCOUT_V('P', std::string("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler: ") + "getLocalName = " + myattname + "  getValue = " +  myvalue + "   getQName = " + myQName);
00078 
00079           // attributes unit and quantity are not used right now.
00080           if (myattname == "name")
00081             varName = myvalue;
00082           else if (myattname == "value")
00083             varValue = myvalue;
00084         }
00085       DDLParser* beingParsed = DDLParser::instance();
00086       std::string nmspace = getnmspace(extractFileName( beingParsed->getCurrFileName()));
00087       ExprEvalInterface & ev = ExprEvalSingleton::instance();
00088       ev.set(nmspace, varName, varValue);
00089     }
00090 }


Member Data Documentation

std::string DDLSAX2ExpressionHandler::pElementName [private]

Definition at line 48 of file DDLSAX2ExpressionHandler.h.

Referenced by startElement().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:03 2009 for CMSSW by  doxygen 1.5.4