#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 32 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, corrVsCorr::filename, and open().
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | const L1GtVhdlTemplateFile & | rhs | ) |
copy constructor
Definition at line 38 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 279 of file L1GtVhdlTemplateFile.cc.
Referenced by diclist.diclist::add(), 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 281 of file L1GtVhdlTemplateFile.cc.
References geometryDiff::file, mps_fire::i, and lines_.
Referenced by diclist.diclist::add().
bool L1GtVhdlTemplateFile::close | ( | void | ) |
Definition at line 209 of file L1GtVhdlTemplateFile.cc.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().
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 238 of file L1GtVhdlTemplateFile.cc.
References str, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by getSubstitutionParametersFromTemplate().
|
static |
replaces searchString with replaceString at it's first occurance in string
Definition at line 49 of file L1GtVhdlTemplateFile.cc.
References position, and edm::replaceString().
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), getConditionsFromAlgo(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), 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 347 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), mps_fire::i, mps_fire::result, and split().
std::string L1GtVhdlTemplateFile::getInternalParameter | ( | const std::string & | indentifier | ) |
returns a parameter of a internal template file
Definition at line 376 of file L1GtVhdlTemplateFile.cc.
References parameterMap_.
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), 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 266 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 177 of file L1GtVhdlTemplateFile.cc.
References Skims_PA_cff::content, 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 200 of file L1GtVhdlTemplateFile.cc.
References findAndChange::_file, insert(), and groupFilesInBlocks::temp.
bool L1GtVhdlTemplateFile::isBlank | ( | const char & | chr | ) | const |
checks weather a char is a blank
Definition at line 317 of file L1GtVhdlTemplateFile.cc.
Referenced by split().
std::string L1GtVhdlTemplateFile::lines2String | ( | ) | const |
returns a string with the content of vector lines
Definition at line 364 of file L1GtVhdlTemplateFile.cc.
References edmScanValgrind::buffer, and 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 60 of file L1GtVhdlTemplateFile.cc.
References edmScanValgrind::buffer, MillePedeFileConverter_cfg::fileName, recoMuon::in, makeListRunsInFiles::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 214 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 224 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and parameterMap_.
bool L1GtVhdlTemplateFile::removeEmptyLines | ( | ) |
deletes all empty lines in a template file
Definition at line 304 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu().
bool L1GtVhdlTemplateFile::removeLineWithContent | ( | const std::string & | str | ) |
removes all lines that contain the str
Definition at line 287 of file L1GtVhdlTemplateFile.cc.
References lines_, position, str, 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 222 of file L1GtVhdlTemplateFile.cc.
References lines_.
std::map< std::string, std::string > L1GtVhdlTemplateFile::returnParameterMap | ( | ) | const |
returns parameter map
Definition at line 236 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 145 of file L1GtVhdlTemplateFile.cc.
References MillePedeFileConverter_cfg::fileName, 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 323 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 161 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), lines_, edm::replaceString(), and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
|
private |
internal files additionally have entries in parameterMap_ for "normal" files parameterMap is empty
Definition at line 29 of file L1GtVhdlTemplateFile.h.
Referenced by L1GtVhdlTemplateFile().
|
private |
containing the content of the VHDL file
Definition at line 31 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 33 of file L1GtVhdlTemplateFile.h.
Referenced by getInternalParameter(), L1GtVhdlTemplateFile(), open(), printParameterMap(), and returnParameterMap().