CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FIPConfiguration Class Reference

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

#include <FIPConfiguration.h>

Inheritance diagram for FIPConfiguration:
DDLDocumentProvider

Public Member Functions

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

Private Attributes

DDLSAX2ConfigHandler configHandler_
 
DDCompactViewcpv_
 
std::vector< std::string > files_
 
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@.nosp@m.ucdh.nosp@m.ep.uc.nosp@m.davi.nosp@m.s.edu

Definition at line 27 of file FIPConfiguration.h.

Constructor & Destructor Documentation

◆ FIPConfiguration()

FIPConfiguration::FIPConfiguration ( DDCompactView cpv)

Definition at line 15 of file FIPConfiguration.cc.

15 : configHandler_(cpv), cpv_(cpv) {}

◆ ~FIPConfiguration()

FIPConfiguration::~FIPConfiguration ( void  )
override

Definition at line 17 of file FIPConfiguration.cc.

17 {}

Member Function Documentation

◆ doValidation()

bool FIPConfiguration::doValidation ( void  ) const
overridevirtual

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

Implements DDLDocumentProvider.

Definition at line 23 of file FIPConfiguration.cc.

23 { return configHandler_.doValidation(); }

References configHandler_, and DDLSAX2ConfigHandler::doValidation().

◆ dumpFileList()

void FIPConfiguration::dumpFileList ( void  ) const
overridevirtual

Print out the list of files.

Implements DDLDocumentProvider.

Definition at line 27 of file FIPConfiguration.cc.

27  {
28  std::cout << "File List:" << std::endl;
29  std::cout << " number of files=" << files_.size() << std::endl;
30  for (const auto& file : files_)
31  std::cout << file << std::endl;
32 }

References gather_cfg::cout, geometryDiff::file, and files_.

◆ getFileList()

const std::vector< std::string > & FIPConfiguration::getFileList ( void  ) const
overridevirtual

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

Implements DDLDocumentProvider.

Definition at line 19 of file FIPConfiguration.cc.

19 { return files_; }

References files_.

◆ getSchemaLocation()

std::string FIPConfiguration::getSchemaLocation ( void  ) const
overridevirtual

Return the designation for where to look for the schema.

Implements DDLDocumentProvider.

Definition at line 25 of file FIPConfiguration.cc.

References configHandler_, and DDLSAX2ConfigHandler::getSchemaLocation().

◆ getURLList()

const std::vector< std::string > & FIPConfiguration::getURLList ( void  ) const
overridevirtual

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 21 of file FIPConfiguration.cc.

21 { return urls_; }

References urls_.

◆ readConfig() [1/2]

int FIPConfiguration::readConfig ( const std::string &  filename)
overridevirtual

Read in the configuration file.

Implements DDLDocumentProvider.

Definition at line 71 of file FIPConfiguration.cc.

71 { return readConfig(filename, false); }

References corrVsCorr::filename.

Referenced by output(), and testParser().

◆ readConfig() [2/2]

int FIPConfiguration::readConfig ( const std::string &  filename,
bool  fullPath 
)

Read in the configuration file.

Definition at line 39 of file FIPConfiguration.cc.

39  {
40  std::string absoluteFileName(filename);
41  if (!fullPath) {
43  // config file
44  absoluteFileName = fp.fullPath();
45  }
46 
47  // Set the parser to use the handler for the configuration file.
48  // This makes sure the Parser is initialized and gets a handle to it.
49  DDLParser ddlp(cpv_);
50  ddlp.getXMLParser()->setContentHandler(&configHandler_);
51  ddlp.getXMLParser()->parse(absoluteFileName.c_str());
52  const std::vector<std::string>& vURLs = configHandler_.getURLs();
53  const std::vector<std::string>& vFiles = configHandler_.getFileNames();
54  size_t maxInd = vFiles.size();
55  size_t ind = 0;
56  // ea. file listed in the config
57  for (; ind < maxInd; ++ind) {
58  edm::FileInPath fp(vURLs[ind] + "/" + vFiles[ind]);
59  // std::cout << "FileInPath says..." << fp.fullPath() << std::endl;
60  files_.emplace_back(fp.fullPath());
61  urls_.emplace_back("");
62  }
63 
64  // std::vector<std::string> fnames = configHandler_.getFileNames();
65  // std::cout << "there are " << fnames.size() << " files." << std::endl;
66  // for (size_t i = 0; i < fnames.size(); ++i)
67  // std::cout << "url=" << configHandler_.getURLs()[i] << " file=" << configHandler_.getFileNames()[i] << std::endl;
68  return 0;
69 }

References configHandler_, cpv_, corrVsCorr::filename, files_, personalPlayback::fp, contentValuesFiles::fullPath, DDLSAX2ConfigHandler::getFileNames(), DDLSAX2ConfigHandler::getURLs(), DDLParser::getXMLParser(), AlCaHLTBitMon_QueryRunRegistry::string, and urls_.

Member Data Documentation

◆ configHandler_

DDLSAX2ConfigHandler FIPConfiguration::configHandler_
private

Definition at line 57 of file FIPConfiguration.h.

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

◆ cpv_

DDCompactView& FIPConfiguration::cpv_
private

Definition at line 60 of file FIPConfiguration.h.

Referenced by readConfig().

◆ files_

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

Definition at line 58 of file FIPConfiguration.h.

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

◆ urls_

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

Definition at line 59 of file FIPConfiguration.h.

Referenced by getURLList(), and readConfig().

DDLSAX2ConfigHandler::getSchemaLocation
const std::string getSchemaLocation() const
Definition: DDLSAX2ConfigHandler.cc:60
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FIPConfiguration::files_
std::vector< std::string > files_
Definition: FIPConfiguration.h:58
personalPlayback.fp
fp
Definition: personalPlayback.py:523
edm::FileInPath
Definition: FileInPath.h:61
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
DDLSAX2ConfigHandler::doValidation
const bool doValidation() const
Definition: DDLSAX2ConfigHandler.cc:62
geometryDiff.file
file
Definition: geometryDiff.py:13
FIPConfiguration::configHandler_
DDLSAX2ConfigHandler configHandler_
Definition: FIPConfiguration.h:57
DDLParser
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
FIPConfiguration::urls_
std::vector< std::string > urls_
Definition: FIPConfiguration.h:59
DDLSAX2ConfigHandler::getFileNames
const std::vector< std::string > & getFileNames() const
Definition: DDLSAX2ConfigHandler.cc:56
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FIPConfiguration::readConfig
int readConfig(const std::string &filename) override
Read in the configuration file.
Definition: FIPConfiguration.cc:71
DDLSAX2ConfigHandler::getURLs
const std::vector< std::string > & getURLs() const
Definition: DDLSAX2ConfigHandler.cc:58
FIPConfiguration::cpv_
DDCompactView & cpv_
Definition: FIPConfiguration.h:60