CMS 3D CMS Logo

Public Member Functions | Protected Attributes

DQMParserBase Class Reference

#include <DQMParserBase.h>

Inheritance diagram for DQMParserBase:
QTestConfigurationParser SiPixelConfigParser SiPixelLayoutParser SiStripConfigParser SiStripLayoutParser SummaryPlotXmlParser

List of all members.

Public Member Functions

int countNodes (std::string tagName)
 Returns the number of nodes with given name.
xercesc::DOMDocument * doc ()
 DOM Document.
 DQMParserBase ()
 Creator.
void getDocument (std::string configFile, bool UseDB=false)
 Methor that parses the xml file configFile.
void getNewDocument (std::string configFile, bool UseDB=false)
 Parses a new Document.
virtual ~DQMParserBase ()
 Destructor.

Protected Attributes

xercesc::XercesDOMParser * parser

Detailed Description

* Base class for Parsers used by DQM

Date:
2011/06/16 03:07:27
Revision:
1.6
Author:
Ilaria Segoni

Definition at line 33 of file DQMParserBase.h.


Constructor & Destructor Documentation

DQMParserBase::DQMParserBase ( )

Creator.

Definition at line 18 of file DQMParserBase.cc.

References geometryXMLtoCSV::parser.

                            {
        parser=0; 
}
DQMParserBase::~DQMParserBase ( ) [virtual]

Destructor.

Definition at line 22 of file DQMParserBase.cc.

References geometryXMLtoCSV::parser.

                             {
        delete parser;
        parser=0; 
}

Member Function Documentation

int DQMParserBase::countNodes ( std::string  tagName)

Returns the number of nodes with given name.

Definition at line 62 of file DQMParserBase.cc.

References qtxml::_toDOMS(), and geometryXMLtoCSV::parser.

                                              {
        unsigned int tagsNum  = 
          parser->getDocument()->getElementsByTagName(qtxml::_toDOMS(tagName))->getLength();
        return tagsNum;
}
xercesc::DOMDocument* DQMParserBase::doc ( ) [inline]
void DQMParserBase::getDocument ( std::string  configFile,
bool  UseDB = false 
)

Methor that parses the xml file configFile.

Definition at line 28 of file DQMParserBase.cc.

References asciidump::doc, and geometryXMLtoCSV::parser.

Referenced by QTestHandle::configureTests(), SiStripActionExecutor::createShiftReport(), SiPixelActionExecutor::createSummary(), SiPixelInformationExtractor::getTrackerMapHistos(), SiStripInformationExtractor::readConfiguration(), SiStripSummaryCreator::readConfiguration(), and SiPixelActionExecutor::readConfiguration().

                                                               {
        
    parser = new XercesDOMParser;     
    parser->setValidationScheme(XercesDOMParser::Val_Auto);
    parser->setDoNamespaces(false);
    if(UseDB){
//       std::cout<<"=== This is config file from getDocument ====== "<<std::endl;
//       std::cout<<configFile<<std::endl;
      MemBufInputSource mb((const XMLByte*)configFile.c_str(),strlen(configFile.c_str()),"",false);
      parser->parse(mb);
    }
    else{
      parser->parse(configFile.c_str()); 
    }
    xercesc::DOMDocument* doc = parser->getDocument();
    assert(doc);

}
void DQMParserBase::getNewDocument ( std::string  configFile,
bool  UseDB = false 
)

Parses a new Document.

Definition at line 47 of file DQMParserBase.cc.

References gather_cfg::cout, asciidump::doc, and geometryXMLtoCSV::parser.

Referenced by QTestHandle::configureTests().

                                                                  {
  parser->resetDocumentPool();
  if(UseDB){
    std::cout<<"=== This is config file from getNewDocument ==== "<<std::endl;
    std::cout<<configFile<<std::endl;
    MemBufInputSource mb((const XMLByte*)configFile.c_str(),strlen(configFile.c_str()),"",false);
    parser->parse(mb);
  }
  else{
    parser->parse(configFile.c_str()); 
  }
  xercesc::DOMDocument* doc = parser->getDocument();
  assert(doc);

}

Member Data Documentation

xercesc::XercesDOMParser* DQMParserBase::parser [protected]

Definition at line 49 of file DQMParserBase.h.

Referenced by doc().