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 ( DDCompactView cpv)

Definition at line 15 of file FIPConfiguration.cc.

16  : configHandler_( cpv ),
17  cpv_( cpv )
18 {}
DDLSAX2ConfigHandler configHandler_
DDCompactView & cpv_
FIPConfiguration::~FIPConfiguration ( void  )
override

Definition at line 20 of file FIPConfiguration.cc.

21 {}

Member Function Documentation

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

References configHandler_, DDLSAX2ConfigHandler::doValidation(), and AlCaHLTBitMon_QueryRunRegistry::string.

37 {
39 }
DDLSAX2ConfigHandler configHandler_
const bool doValidation() const
void FIPConfiguration::dumpFileList ( void  ) const
overridevirtual

Print out the list of files.

Implements DDLDocumentProvider.

Definition at line 48 of file FIPConfiguration.cc.

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

49 {
50  std::cout << "File List:" << std::endl;
51  std::cout << " number of files=" << files_.size() << std::endl;
52  for (const auto & file : files_)
53  std::cout << file << std::endl;
54 }
std::vector< std::string > files_
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 24 of file FIPConfiguration.cc.

References files_.

25 {
26  return files_;
27 }
std::vector< std::string > files_
std::string FIPConfiguration::getSchemaLocation ( void  ) const
overridevirtual

Return the designation for where to look for the schema.

Implements DDLDocumentProvider.

Definition at line 42 of file FIPConfiguration.cc.

References configHandler_, and DDLSAX2ConfigHandler::getSchemaLocation().

43 {
45 }
DDLSAX2ConfigHandler configHandler_
const std::string getSchemaLocation() const
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 30 of file FIPConfiguration.cc.

References urls_.

31 {
32  return urls_;
33 }
std::vector< std::string > urls_
int FIPConfiguration::readConfig ( const std::string &  filename)
overridevirtual

Read in the configuration file.

Implements DDLDocumentProvider.

Definition at line 97 of file FIPConfiguration.cc.

Referenced by output(), and testParser().

98 {
99  return readConfig( filename, false );
100 }
int readConfig(const std::string &filename) override
Read in the configuration file.
int FIPConfiguration::readConfig ( const std::string &  filename,
bool  fullPath 
)

Read in the configuration file.

Definition at line 62 of file FIPConfiguration.cc.

References configHandler_, cpv_, files_, edm::FileInPath::fullPath(), DDLSAX2ConfigHandler::getFileNames(), DDLSAX2ConfigHandler::getURLs(), DDLParser::getXMLParser(), AlCaHLTBitMon_QueryRunRegistry::string, and urls_.

63 {
64  std::string absoluteFileName (filename);
65  if (!fullPath) {
67  // config file
68  absoluteFileName = fp.fullPath();
69  }
70 
71  // Set the parser to use the handler for the configuration file.
72  // This makes sure the Parser is initialized and gets a handle to it.
73  DDLParser ddlp(cpv_);
74  ddlp.getXMLParser()->setContentHandler(&configHandler_);
75  ddlp.getXMLParser()->parse(absoluteFileName.c_str());
76  const std::vector<std::string>& vURLs = configHandler_.getURLs();
77  const std::vector<std::string>& vFiles = configHandler_.getFileNames();
78  size_t maxInd = vFiles.size();
79  size_t ind = 0;
80  // ea. file listed in the config
81  for(; ind < maxInd ; ++ind)
82  {
83  edm::FileInPath fp(vURLs[ind] + "/" + vFiles[ind]);
84  // std::cout << "FileInPath says..." << fp.fullPath() << std::endl;
85  files_.emplace_back(fp.fullPath());
86  urls_.emplace_back("");
87  }
88 
89  // std::vector<std::string> fnames = configHandler_.getFileNames();
90  // std::cout << "there are " << fnames.size() << " files." << std::endl;
91  // for (size_t i = 0; i < fnames.size(); ++i)
92  // std::cout << "url=" << configHandler_.getURLs()[i] << " file=" << configHandler_.getFileNames()[i] << std::endl;
93  return 0;
94 }
DDLSAX2ConfigHandler configHandler_
std::vector< std::string > urls_
DDCompactView & cpv_
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:62
const std::vector< std::string > & getURLs() const
std::vector< std::string > files_
const std::vector< std::string > & getFileNames() const

Member Data Documentation

DDLSAX2ConfigHandler FIPConfiguration::configHandler_
private

Definition at line 59 of file FIPConfiguration.h.

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

DDCompactView& FIPConfiguration::cpv_
private

Definition at line 62 of file FIPConfiguration.h.

Referenced by readConfig().

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

Definition at line 60 of file FIPConfiguration.h.

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

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

Definition at line 61 of file FIPConfiguration.h.

Referenced by getURLList(), and readConfig().