CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
L1GtVhdlTemplateFile Class Reference

#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 > &parameters) 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 &param, 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 &paramString, 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...
 

Detailed Description

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>

Author
Philipp Wagner

Description: a class to deal with VHDL template files

Implementation: <TODO: enter implementation details>

Author
: Philipp Wagner

Definition at line 25 of file L1GtVhdlTemplateFile.h.

Constructor & Destructor Documentation

L1GtVhdlTemplateFile::L1GtVhdlTemplateFile ( )

standard constructor

Definition at line 29 of file L1GtVhdlTemplateFile.cc.

References intern_.

29 { intern_ = false; }
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile ( const std::string &  filename)

constructor with filename

Definition at line 32 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and open().

32  {
33  if (!open(filename, false))
34  std::cout << "Error while opening file: " << filename << std::endl;
35 }
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:144
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 ...
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile ( const L1GtVhdlTemplateFile rhs)

copy constructor

Definition at line 38 of file L1GtVhdlTemplateFile.cc.

References intern_, lines_, and parameterMap_.

38  {
39  lines_ = rhs.lines_;
40  intern_ = rhs.intern_;
42 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
std::vector< std::string > lines_
containing the content of the VHDL file
L1GtVhdlTemplateFile::~L1GtVhdlTemplateFile ( )

destructor

Definition at line 45 of file L1GtVhdlTemplateFile.cc.

45  {
46  // empty
47 }

Member Function Documentation

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.

References lines_.

Referenced by diclist.diclist::add(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), BeautifulSoup.Tag::setString(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().

279 { lines_.push_back(str); }
std::vector< std::string > lines_
containing the content of the VHDL file
#define str(s)
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 mps_fire::i, and lines_.

Referenced by diclist.diclist::add(), and BeautifulSoup.Tag::setString().

281  {
282  for (unsigned int i = 0; i < file.lines_.size(); i++) {
283  lines_.push_back(file.lines_.at(i));
284  }
285 }
std::vector< std::string > lines_
containing the content of the VHDL file
bool L1GtVhdlTemplateFile::close ( void  )

Definition at line 209 of file L1GtVhdlTemplateFile.cc.

Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().

209  {
210  //empty
211  return true;
212 }
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 AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getSubstitutionParametersFromTemplate().

239  {
240  // check, weather the current line is containing a substitution parameter
241  // the routine is making sure, that it's not extracting a parameter from
242  // a comment
243  if (int pos1 = str.find("$(") != std::string::npos && str.substr(0, 2) != "--") {
244  int pos2 = str.find(')');
245  // get the substituion parameter
246  std::string tempStr = (str.substr(pos1 + 1, (pos2 - pos1 - 1)));
247  // return a pair with the substitution parameter and the
248  // the rest of the string after the substitution parameter
249 
250  // here a should be checked, weather the vector is already containing
251  // the parameter befor adding it.
252 
253  parameters.push_back(tempStr);
254  //recursive call
255  while (extractParametersFromString(str.substr(pos2), parameters))
257 
258  return true;
259  } else {
260  return false;
261  }
262 
263  return true;
264 }
bool extractParametersFromString(const std::string &str, std::vector< std::string > &parameters) const
#define str(s)
const bool L1GtVhdlTemplateFile::findAndReplaceString ( std::string &  paramString,
const std::string &  searchString,
const std::string &  replaceString 
)
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(), L1GtVhdlWriterCore::processAlgorithmMap(), substitute(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().

51  {
52  size_t position;
53  position = paramString.find(searchString);
54  if (position == std::string::npos)
55  return false;
56  paramString.replace(position, searchString.length(), replaceString);
57  return true;
58 }
void replaceString(std::string &demangledName, std::string const &from, std::string const &to)
static int position[264][3]
Definition: ReadPGInfo.cc:289
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, and split().

Referenced by L1GtVhdlWriterCore::processAlgorithmMap().

347  {
348  std::vector<std::string> operators;
349 
350  operators.push_back("AND");
351  operators.push_back("OR");
352  operators.push_back("NOT");
353  operators.push_back("(");
354  operators.push_back(")");
355 
356  for (unsigned int i = 0; i < operators.size(); i++) {
357  while (findAndReplaceString(condString, operators.at(i), ""))
358  findAndReplaceString(condString, operators.at(i), "");
359  }
360 
361  split(condString, result);
362 }
bool split(const std::string &param, std::vector< std::string > &result) const
seperates a string at all blanks and saves the elements in result
static const bool findAndReplaceString(std::string &paramString, const std::string &searchString, const std::string &replaceString)
replaces searchString with replaceString at it&#39;s first occurance in string
tuple result
Definition: mps_fire.py:311
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(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore::writeDefValPkg().

376  {
377  return parameterMap_[indentifier];
378 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
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().

266  {
267  std::vector<std::string> temp;
268  std::vector<std::string>::const_iterator iter = lines_.begin();
269 
270  // loop until the substitution parameter is discovered the first time
271  while (iter != lines_.end()) {
272  extractParametersFromString((*iter), temp);
273  iter++;
274  }
275 
276  return temp;
277 }
bool extractParametersFromString(const std::string &str, std::vector< std::string > &parameters) const
std::vector< std::string > lines_
containing the content of the VHDL file
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 lines_, and summarizeEdmComparisonLogfiles::success.

Referenced by BeautifulSoup.PageElement::_invert(), SequenceTypes.Schedule::_replaceIfHeldDirectly(), L1GtVhdlWriterCore::buildCommonHeader(), insert(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().

177  {
178  bool success = false;
179  std::vector<std::string>::iterator iter = lines_.begin();
180 
181  //Loop until the substitution parameter is discovered the first time
182  while (iter != lines_.end()) {
183  //check, weather the current line is containing the substitution parameter
184  if ((*iter).find(atLine) != std::string::npos) {
185  //Delete the line with the subsitution parameter
186  iter = lines_.erase(iter);
187  //insert the content of file
188  lines_.insert(iter, content.begin(), content.end());
189 
190  success = true;
191  break;
192  }
193 
194  iter++;
195  }
196 
197  return success;
198 }
std::vector< std::string > lines_
containing the content of the VHDL file
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 insert(), returnLines(), and groupFilesInBlocks::temp.

Referenced by BeautifulSoup.PageElement::_invert(), and SequenceTypes.Schedule::_replaceIfHeldDirectly().

200  {
201  std::vector<std::string> temp = _file.returnLines();
202 
203  if (insert(atLine, temp))
204  return true;
205 
206  return false;
207 }
bool insert(const std::string &atLine, const std::vector< std::string > &content)
replaces the whole line containing atLine and inserts content instead of it
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().

317  {
318  if (chr == ' ')
319  return true;
320  return false;
321 }
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_.

364  {
365  std::vector<std::string>::const_iterator iter = lines_.begin();
366  std::ostringstream buffer;
367 
368  while (iter != lines_.end()) {
369  buffer << (*iter) << std::endl;
370  iter++;
371  }
372 
373  return buffer.str();
374 }
std::vector< std::string > lines_
containing the content of the VHDL file
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, recoMuon::in, writeEcalDQMStatus::inputFile, lines_, parameterMap_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlTemplateFile(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().

60  {
61  const char paramIndicator = '#';
62  const char commentIndicator = '%';
63  char buffer[2000];
64  std::string stringBuffer;
65 
66  std::fstream inputFile(fileName.c_str(), std::ios::in);
67  //check weather file has been opened successfully
68  if (!inputFile.is_open())
69  return false;
70 
71  //store content of the template in Vector lines
72  while (!inputFile.eof()) {
73  inputFile.getline(buffer, 2000);
74  stringBuffer = buffer;
75  //Remove DOS seperators (For example if the template file was created under NT)
76  if (stringBuffer[stringBuffer.length() - 1] == 13) {
77  stringBuffer.replace(stringBuffer.length() - 1, 1, "");
78  }
79  //the current buffer + a seperator to the vector lines
80  lines_.push_back(stringBuffer /*+"\n"*/);
81  }
82 
83  inputFile.close();
84 
85  if (internal) {
86  //Delete lines containing parameters after moving them to parameterMap_
87  std::vector<std::string>::iterator iter = lines_.begin();
88  while (iter != lines_.end()) {
89  while ((*iter)[0] == commentIndicator && (*iter)[1] == commentIndicator)
90  lines_.erase(iter);
91 
92  if ((*iter)[0] == paramIndicator) {
93  std::vector<std::string>::iterator iter2 = iter;
94 
95  // get the first line of content
96  iter2++;
97 
98  while (iter2 != lines_.end()) {
99  if ((*iter2)[0] == paramIndicator && (*iter2)[1] == paramIndicator) {
100  iter2++;
101  break;
102  }
103 
104  parameterMap_[(*iter).substr(1)] += (*iter2);
105 
106  // overtake the newlines
107  std::vector<std::string>::iterator tmpIter = iter2;
108  tmpIter++;
109 
110  // check weather the next line is the end of the block
111  if (!((*tmpIter)[0] == paramIndicator && (*tmpIter)[1] == paramIndicator))
112  parameterMap_[(*iter).substr(1)] += "\n";
113 
114  iter2++;
115  }
116 
117  // there has been a syntax error in the internal template
118  // stop the routine
119  if (iter2 == lines_.end())
120  return false;
121 
122  // deletes the content, thas has been added to parameter map before
123  // (iter one at the moment is at the beginnig of the block, iter2 at its end)
124  lines_.erase(iter, iter2);
125  }
126 
127  // just for security
128  if (iter != lines_.end())
129  iter++;
130  }
131 
132  //remove empty lines
133  iter = lines_.begin();
134  while (iter != lines_.end()) {
135  if ((*iter).empty() || (*iter).length() == 0 || (*iter) == " ")
136  lines_.erase(iter);
137  else
138  iter++;
139  }
140  }
141 
142  return true;
143 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
std::vector< std::string > lines_
containing the content of the VHDL file
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().

214  {
215  std::vector<std::string>::const_iterator iter = lines_.begin();
216  while (iter != lines_.end()) {
217  std::cout << *iter << std::endl;
218  iter++;
219  }
220 }
std::vector< std::string > lines_
containing the content of the VHDL file
tuple cout
Definition: gather_cfg.py:144
void L1GtVhdlTemplateFile::printParameterMap ( ) const

prints the parameter map

Definition at line 224 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and parameterMap_.

224  {
225  std::cout << "Enter parametermap" << std::endl;
226 
227  std::map<std::string, std::string>::const_iterator iter = parameterMap_.begin();
228 
229  while (iter != parameterMap_.end()) {
230  std::cout << (*iter).first << ": " << (*iter).second << std::endl;
231  iter++;
232  ;
233  }
234 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
tuple cout
Definition: gather_cfg.py:144
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(), and L1GtVmeWriterCore::writeVME().

304  {
305  std::vector<std::string>::iterator iter = lines_.begin();
306 
307  while (iter != lines_.end()) {
308  if ((*iter).empty() || (*iter).length() == 0 || (*iter) == " ")
309  lines_.erase(iter);
310  else
311  iter++;
312  }
313 
314  return true;
315 }
std::vector< std::string > lines_
containing the content of the VHDL file
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, and summarizeEdmComparisonLogfiles::success.

Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().

287  {
288  bool success = false;
289 
290  std::vector<std::string>::iterator iter = lines_.begin();
291  while (iter != lines_.end()) {
292  size_t position;
293  position = (*iter).find(str);
294 
295  if (position != std::string::npos) {
296  lines_.erase(iter);
297  success = true;
298  } else
299  iter++;
300  }
301  return success;
302 }
std::vector< std::string > lines_
containing the content of the VHDL file
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define str(s)
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_.

Referenced by insert(), and L1GtVmeWriterCore::writeVME().

222 { return lines_; }
std::vector< std::string > lines_
containing the content of the VHDL file
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().

236 { return parameterMap_; }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
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 lines_, and download_sqlite_cfg::outputFile.

Referenced by L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().

145  {
146  std::ofstream outputFile(fileName.c_str());
147  std::vector<std::string>::iterator iter = lines_.begin();
148 
149  //Write content of lines_ into the outputfile.
150  while (iter != lines_.end()) {
151  //std::cout<<"Last sign: "<<*iter[(*iter).length()-3];
152  outputFile << *iter << std::endl;
153  iter++;
154  }
155 
156  outputFile.close();
157 
158  return true;
159 }
std::vector< std::string > lines_
containing the content of the VHDL file
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().

323  {
324  unsigned int i = 0;
325  while (isBlank(param[i])) {
326  i++;
327  }
328 
329  std::string temp = param.substr(i);
330  std::size_t pos = temp.find(' ');
331 
332  if (pos != std::string::npos) {
333  std::string temp2 = temp.substr(0, pos);
334  result.push_back(temp2);
335  while (split(temp.substr(pos), result))
336  split(temp.substr(pos), result);
337 
338  } else if (!isBlank(temp[pos + 1])) {
339  result.push_back(temp);
340  return false;
341  } else
342  return false;
343 
344  return false;
345 }
bool split(const std::string &param, std::vector< std::string > &result) const
seperates a string at all blanks and saves the elements in result
tuple result
Definition: mps_fire.py:311
bool isBlank(const char &chr) const
checks weather a char is a blank
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_, 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().

161  {
162  bool success = false;
163 
164  std::vector<std::string>::iterator iter = lines_.begin();
165  while (iter != lines_.end()) {
166  //The substitution parameter always appears as follows: $(parameter)
167  while (findAndReplaceString(*iter, ("$(" + searchString + ")"), replaceString)) {
168  findAndReplaceString(*iter, ("$(" + searchString + ")"), replaceString);
169  success = true;
170  }
171  iter++;
172  }
173 
174  return success;
175 }
static const bool findAndReplaceString(std::string &paramString, const std::string &searchString, const std::string &replaceString)
replaces searchString with replaceString at it&#39;s first occurance in string
void replaceString(std::string &demangledName, std::string const &from, std::string const &to)
std::vector< std::string > lines_
containing the content of the VHDL file

Member Data Documentation

bool L1GtVhdlTemplateFile::intern_
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().

std::vector<std::string> L1GtVhdlTemplateFile::lines_
private
std::map<std::string, std::string> L1GtVhdlTemplateFile::parameterMap_
private

containing the header information of internal files

Definition at line 33 of file L1GtVhdlTemplateFile.h.

Referenced by getInternalParameter(), L1GtVhdlTemplateFile(), open(), printParameterMap(), and returnParameterMap().