CMS 3D CMS Logo

FIPConfiguration Class Reference

FIPConfiguration reads in the configuration file for the DDParser. More...

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

Inheritance diagram for FIPConfiguration:

DDLDocumentProvider

List of all members.

Public Member Functions

virtual bool doValidation () const
 Return whether Validation should be on or off and where the DDL SchemaLocation is.
virtual void dumpFileList (void) const
 Print out the list of files.
 FIPConfiguration ()
virtual const std::vector
< std::string > & 
getFileList (void) const
 Return a list of files as a std::vector of strings.
std::string getSchemaLocation () const
 Return the designation for where to look for the schema.
virtual const std::vector
< std::string > & 
getURLList (void) const
 Return a list of urls as a std::vector of strings.
int readConfig (const std::string &filename)
 Read in the configuration file.
virtual ~FIPConfiguration ()

Private Attributes

DDLSAX2ConfigHandler configHandler_
std::vector< std::string > files_
DDLParserparser_
std::vector< std::string > urls_


Detailed Description

FIPConfiguration reads in the configuration file for the DDParser.

Author:
Michael Case
FIPConfiguration.h - description ------------------- begin: Sun Nov 13, 2005 email: case@ucdhep.ucdavis.edu

Definition at line 28 of file FIPConfiguration.h.


Constructor & Destructor Documentation

FIPConfiguration::FIPConfiguration (  ) 

Definition at line 53 of file FIPConfiguration.cc.

References DDLParser::instance(), and parser_.

00053                                    : configHandler_()
00054 { 
00055   parser_ = DDLParser::instance();
00056   //  std::cout << "Making a FIPConfiguration with configHandler_ at " << &configHandler_ << std::endl;
00057 }

FIPConfiguration::~FIPConfiguration (  )  [virtual]

Definition at line 48 of file FIPConfiguration.cc.

00049 {
00050   //  parser_->getXMLParser()->setContentHandler(0);  
00051 }


Member Function Documentation

bool FIPConfiguration::doValidation (  )  const [virtual]

Return whether Validation should be on or off and where the DDL SchemaLocation is.

Implements DDLDocumentProvider.

Definition at line 69 of file FIPConfiguration.cc.

References configHandler_, and DDLSAX2ConfigHandler::doValidation().

00069 { return configHandler_.doValidation(); }

void FIPConfiguration::dumpFileList ( void   )  const [virtual]

Print out the list of files.

Implements DDLDocumentProvider.

Definition at line 73 of file FIPConfiguration.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), files_, and it.

00073                                               {
00074   std::cout << "File List:" << std::endl;
00075   std::cout << "  number of files=" << files_.size() << std::endl;
00076   for (std::vector<std::string>::const_iterator it = files_.begin(); it != files_.end(); ++it)
00077     std::cout << *it << std::endl;
00078 }

const std::vector< std::string > & FIPConfiguration::getFileList ( void   )  const [virtual]

Return a list of files as a std::vector of strings.

Implements DDLDocumentProvider.

Definition at line 59 of file FIPConfiguration.cc.

References files_.

00060 {
00061   return files_;
00062 }

std::string FIPConfiguration::getSchemaLocation (  )  const [virtual]

Return the designation for where to look for the schema.

Implements DDLDocumentProvider.

Definition at line 71 of file FIPConfiguration.cc.

References configHandler_, and DDLSAX2ConfigHandler::getSchemaLocation().

00071 { return configHandler_.getSchemaLocation(); }

const std::vector< std::string > & FIPConfiguration::getURLList ( void   )  const [virtual]

Return a list of urls as a std::vector of strings.

This implementation does not provide a meaningful url list.

Implements DDLDocumentProvider.

Definition at line 64 of file FIPConfiguration.cc.

References urls_.

00065 {
00066   return urls_;
00067 }

int FIPConfiguration::readConfig ( const std::string &  filename  )  [virtual]

Read in the configuration file.

Implements DDLDocumentProvider.

Definition at line 84 of file FIPConfiguration.cc.

References configHandler_, DCOUT, files_, edm::FileInPath::fullPath(), DDLSAX2ConfigHandler::getFileNames(), DDLSAX2ConfigHandler::getURLs(), DDLParser::getXMLParser(), parser_, and urls_.

00085 {
00086   DCOUT('P', "FIPConfiguration::ReadConfig(): started");
00087 
00088   // Set the parser to use the handler for the configuration file.
00089   // This makes sure the Parser is initialized and gets a handle to it.
00090   parser_->getXMLParser()->setContentHandler(&configHandler_);
00091   edm::FileInPath fp(filename);
00092   // config file
00093   std::string absoluteFileName (filename);
00094   absoluteFileName = fp.fullPath();
00095   parser_->getXMLParser()->parse(absoluteFileName.c_str());
00096   const std::vector<std::string>& vURLs = configHandler_.getURLs();
00097   const std::vector<std::string>& vFiles = configHandler_.getFileNames();
00098   size_t maxInd = vFiles.size();
00099   size_t ind = 0;
00100   // ea. file listed in the config
00101   for(; ind < maxInd ; ++ind) {
00102     edm::FileInPath fp(vURLs[ind] + "/" + vFiles[ind]);
00103     //    std::cout << "FileInPath says..." << fp.fullPath() << std::endl;
00104     files_.push_back(fp.fullPath());
00105     urls_.push_back("");
00106   }
00107 
00108   //   std::vector<std::string> fnames = configHandler_.getFileNames();
00109   //   std::cout << "there are " << fnames.size() << " files." << std::endl;
00110   //   for (size_t i = 0; i < fnames.size(); ++i)
00111   //     std::cout << "url=" << configHandler_.getURLs()[i] << " file=" << configHandler_.getFileNames()[i] << std::endl;
00112   return 0;
00113 }


Member Data Documentation

DDLSAX2ConfigHandler FIPConfiguration::configHandler_ [private]

Definition at line 61 of file FIPConfiguration.h.

Referenced by doValidation(), getSchemaLocation(), and readConfig().

std::vector<std::string> FIPConfiguration::files_ [private]

Definition at line 62 of file FIPConfiguration.h.

Referenced by dumpFileList(), getFileList(), and readConfig().

DDLParser* FIPConfiguration::parser_ [private]

Definition at line 60 of file FIPConfiguration.h.

Referenced by FIPConfiguration(), and readConfig().

std::vector<std::string> FIPConfiguration::urls_ [private]

Definition at line 63 of file FIPConfiguration.h.

Referenced by getURLList(), and readConfig().


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