#include <L1GtVhdlTemplateFile.h>
Public Member Functions | |
void | append (const std::string &str) |
adds a line at the end of the the file with the content of str More... | |
void | append (const L1GtVhdlTemplateFile &file) |
adds the content of file at the end of (*this); the parameter map won't be changed More... | |
bool | close () |
bool | extractParametersFromString (const std::string &str, std::vector< std::string > ¶meters) const |
void | getConditionsFromAlgo (std::string condString, std::vector< std::string > &result) const |
extracts all conditions from a algorithm More... | |
std::string | getInternalParameter (const std::string &indentifier) |
returns a parameter of a internal template file More... | |
std::vector< std::string > | getSubstitutionParametersFromTemplate () const |
returns a vector with all substitution parameters that are found in the template file More... | |
bool | insert (const std::string &atLine, const std::vector< std::string > &content) |
replaces the whole line containing atLine and inserts content instead of it More... | |
bool | insert (const std::string atLine, const L1GtVhdlTemplateFile &file) |
replaces the whole line containing atLine with the content of file More... | |
bool | isBlank (const char &chr) const |
checks weather a char is a blank More... | |
L1GtVhdlTemplateFile () | |
standard constructor More... | |
L1GtVhdlTemplateFile (const std::string &filename) | |
constructor with filename More... | |
L1GtVhdlTemplateFile (const L1GtVhdlTemplateFile &rhs) | |
copy constructor More... | |
std::string | lines2String () const |
returns a string with the content of vector lines More... | |
bool | open (const std::string &fileName, bool internal=false) |
opens a template file. If the header information shall be parsed intern has to be set to true More... | |
void | print () const |
prints the content of the VHDL File (only lines_) More... | |
void | printParameterMap () const |
prints the parameter map More... | |
bool | removeEmptyLines () |
deletes all empty lines in a template file More... | |
bool | removeLineWithContent (const std::string &str) |
removes all lines that contain the str More... | |
std::vector< std::string > | returnLines () const |
returns a string vector with the current content of the VHDL File More... | |
std::map< std::string, std::string > | returnParameterMap () const |
returns parameter map More... | |
bool | save (const std::string &fileName) |
saves the content of the template file to a local file (the content of parameterMap_ will not be saved!) More... | |
bool | split (const std::string ¶m, std::vector< std::string > &result) const |
seperates a string at all blanks and saves the elements in result More... | |
bool | substitute (const std::string &searchString, const std::string &replaceString) |
replaces searchString with replaceString More... | |
~L1GtVhdlTemplateFile () | |
destructor More... | |
Static Public Member Functions | |
static const bool | findAndReplaceString (std::string ¶mString, const std::string &searchString, const std::string &replaceString) |
replaces searchString with replaceString at it's first occurance in string More... | |
Private Attributes | |
bool | intern_ |
std::vector< std::string > | lines_ |
containing the content of the VHDL file More... | |
std::map< std::string, std::string > | parameterMap_ |
containing the header information of internal files More... | |
The routines of this class provide all necessary features to deal with the VHDL templates for the firmware code of the GT
Implementation: <TODO: enter implementation details>
Description: a class to deal with VHDL template files
Implementation: <TODO: enter implementation details>
Definition at line 25 of file L1GtVhdlTemplateFile.h.
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | ) |
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | const std::string & | filename | ) |
constructor with filename
Definition at line 36 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and open().
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | const L1GtVhdlTemplateFile & | rhs | ) |
copy constructor
Definition at line 43 of file L1GtVhdlTemplateFile.cc.
References intern_, lines_, and parameterMap_.
L1GtVhdlTemplateFile::~L1GtVhdlTemplateFile | ( | ) |
void L1GtVhdlTemplateFile::append | ( | const std::string & | str | ) |
adds a line at the end of the the file with the content of str
Definition at line 340 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by diclist.diclist::add(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
void L1GtVhdlTemplateFile::append | ( | const L1GtVhdlTemplateFile & | file | ) |
adds the content of file at the end of (*this); the parameter map won't be changed
Definition at line 346 of file L1GtVhdlTemplateFile.cc.
References mps_fire::i, and lines_.
Referenced by diclist.diclist::add().
bool L1GtVhdlTemplateFile::close | ( | void | ) |
Definition at line 247 of file L1GtVhdlTemplateFile.cc.
Referenced by lumiQTWidget.ApplicationWindow::fileQuit(), esMonitoring.AsyncLineReaderMixin::handle_close(), esMonitoring.FDJsonServer::handle_close(), Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog::keyPressEvent().
bool L1GtVhdlTemplateFile::extractParametersFromString | ( | const std::string & | str, |
std::vector< std::string > & | parameters | ||
) | const |
finds all substitution parameters in str and collects them in the vector parameters. This routine is used by getSubstitutionParametersFromTemplate();
Definition at line 292 of file L1GtVhdlTemplateFile.cc.
References metProducer_cfi::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by getSubstitutionParametersFromTemplate().
|
static |
replaces searchString with replaceString at it's first occurance in string
Definition at line 59 of file L1GtVhdlTemplateFile.cc.
References position, and edm::replaceString().
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), getConditionsFromAlgo(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), L1GtVhdlWriterCore::processAlgorithmMap(), substitute(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
void L1GtVhdlTemplateFile::getConditionsFromAlgo | ( | std::string | condString, |
std::vector< std::string > & | result | ||
) | const |
extracts all conditions from a algorithm
Definition at line 425 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), mps_fire::i, and split().
Referenced by L1GtVhdlWriterCore::processAlgorithmMap().
std::string L1GtVhdlTemplateFile::getInternalParameter | ( | const std::string & | indentifier | ) |
returns a parameter of a internal template file
Definition at line 461 of file L1GtVhdlTemplateFile.cc.
References parameterMap_.
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore::writeDefValPkg().
std::vector< std::string > L1GtVhdlTemplateFile::getSubstitutionParametersFromTemplate | ( | ) | const |
returns a vector with all substitution parameters that are found in the template file
Definition at line 323 of file L1GtVhdlTemplateFile.cc.
References extractParametersFromString(), lines_, and groupFilesInBlocks::temp.
Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::insert | ( | const std::string & | atLine, |
const std::vector< std::string > & | content | ||
) |
replaces the whole line containing atLine and inserts content instead of it
Definition at line 210 of file L1GtVhdlTemplateFile.cc.
References lines_, and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), insert(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::insert | ( | const std::string | atLine, |
const L1GtVhdlTemplateFile & | file | ||
) |
replaces the whole line containing atLine with the content of file
Definition at line 237 of file L1GtVhdlTemplateFile.cc.
References insert(), returnLines(), and groupFilesInBlocks::temp.
bool L1GtVhdlTemplateFile::isBlank | ( | const char & | chr | ) | const |
checks weather a char is a blank
Definition at line 389 of file L1GtVhdlTemplateFile.cc.
Referenced by split().
std::string L1GtVhdlTemplateFile::lines2String | ( | ) | const |
returns a string with the content of vector lines
Definition at line 445 of file L1GtVhdlTemplateFile.cc.
References lines_.
bool L1GtVhdlTemplateFile::open | ( | const std::string & | fileName, |
bool | internal = false |
||
) |
opens a template file. If the header information shall be parsed intern has to be set to true
Definition at line 69 of file L1GtVhdlTemplateFile.cc.
References recoMuon::in, analyzePatCleaning_cfg::inputFile, lines_, parameterMap_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlTemplateFile(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
void L1GtVhdlTemplateFile::print | ( | void | ) | const |
prints the content of the VHDL File (only lines_)
Definition at line 254 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and lines_.
Referenced by L1GtVhdlWriterCore::printCommonHeader().
void L1GtVhdlTemplateFile::printParameterMap | ( | ) | const |
prints the parameter map
Definition at line 272 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and parameterMap_.
bool L1GtVhdlTemplateFile::removeEmptyLines | ( | ) |
deletes all empty lines in a template file
Definition at line 375 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVmeWriterCore::writeVME().
bool L1GtVhdlTemplateFile::removeLineWithContent | ( | const std::string & | str | ) |
removes all lines that contain the str
Definition at line 355 of file L1GtVhdlTemplateFile.cc.
References lines_, position, and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().
std::vector< std::string > L1GtVhdlTemplateFile::returnLines | ( | ) | const |
returns a string vector with the current content of the VHDL File
Definition at line 266 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by insert(), and L1GtVmeWriterCore::writeVME().
std::map< std::string, std::string > L1GtVhdlTemplateFile::returnParameterMap | ( | ) | const |
returns parameter map
Definition at line 286 of file L1GtVhdlTemplateFile.cc.
References parameterMap_.
Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::save | ( | const std::string & | fileName | ) |
saves the content of the template file to a local file (the content of parameterMap_ will not be saved!)
Definition at line 168 of file L1GtVhdlTemplateFile.cc.
References lines_, and download_sqlite_cfg::outputFile.
Referenced by L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
bool L1GtVhdlTemplateFile::split | ( | const std::string & | param, |
std::vector< std::string > & | result | ||
) | const |
seperates a string at all blanks and saves the elements in result
Definition at line 397 of file L1GtVhdlTemplateFile.cc.
References mps_fire::i, isBlank(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.
Referenced by getConditionsFromAlgo().
bool L1GtVhdlTemplateFile::substitute | ( | const std::string & | searchString, |
const std::string & | replaceString | ||
) |
replaces searchString with replaceString
Definition at line 188 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), lines_, and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), L1GtVhdlWriterCore::writeQsfSetupFiles(), and L1GtVmeWriterCore::writeVME().
|
private |
internal files additionally have entries in parameterMap_ for "normal" files parameterMap is empty
Definition at line 31 of file L1GtVhdlTemplateFile.h.
Referenced by L1GtVhdlTemplateFile().
|
private |
containing the content of the VHDL file
Definition at line 33 of file L1GtVhdlTemplateFile.h.
Referenced by append(), getSubstitutionParametersFromTemplate(), insert(), L1GtVhdlTemplateFile(), lines2String(), open(), print(), removeEmptyLines(), removeLineWithContent(), returnLines(), save(), and substitute().
|
private |
containing the header information of internal files
Definition at line 35 of file L1GtVhdlTemplateFile.h.
Referenced by getInternalParameter(), L1GtVhdlTemplateFile(), open(), printParameterMap(), and returnParameterMap().