CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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)
 
void getConditionsFromAlgo (std::string condString, std::vector< std::string > &result)
 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 ()
 returns a vector with all substitution parameters that are found in the template file More...
 
bool insert (const std::string &atLine, std::vector< std::string > content)
 replaces the whole line containing atLine and inserts content instead of it More...
 
bool insert (const std::string atLine, L1GtVhdlTemplateFile file)
 replaces the whole line containing atLine with the content of file More...
 
bool isBlank (const char &chr)
 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 ()
 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 ()
 prints the content of the VHDL File (only lines_) More...
 
void printParameterMap ()
 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 ()
 returns a string vector with the current content of the VHDL File More...
 
std::map< std::string,
std::string > 
returnParameterMap ()
 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)
 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

$Date$ $Revision$

Description: a class to deal with VHDL template files

Implementation: <TODO: enter implementation details>

Author
: Philipp Wagner

$Date$ $Revision$

Definition at line 27 of file L1GtVhdlTemplateFile.h.

Constructor & Destructor Documentation

L1GtVhdlTemplateFile::L1GtVhdlTemplateFile ( )

standard constructor

Definition at line 31 of file L1GtVhdlTemplateFile.cc.

References intern_.

32 {
33  intern_=false;
34 }
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile ( const std::string &  filename)

constructor with filename

Definition at line 38 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and open().

39 {
40  if (!open(filename,false)) std::cout<<"Error while opening file: "<<filename<<std::endl;
41 }
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:121
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 45 of file L1GtVhdlTemplateFile.cc.

References intern_, lines_, and parameterMap_.

46 {
47  lines_=rhs.lines_;
48  intern_=rhs.intern_;
50 
51 }
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 55 of file L1GtVhdlTemplateFile.cc.

56 {
57  // empty
58 }

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 342 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

343 {
344  lines_.push_back(str);
345 }
std::vector< std::string > lines_
containing the content of the VHDL file
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 348 of file L1GtVhdlTemplateFile.cc.

References i, and lines_.

Referenced by BeautifulSoup.Tag::setString().

349 {
350  for (unsigned int i=0; i<file.lines_.size(); i++)
351  {
352  lines_.push_back(file.lines_.at(i));
353  }
354 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > lines_
containing the content of the VHDL file
bool L1GtVhdlTemplateFile::close ( void  )
bool L1GtVhdlTemplateFile::extractParametersFromString ( const std::string &  str,
std::vector< std::string > &  parameters 
)

finds all substitution parameters in str and collects them in the vector parameters. This routine is used by getSubstitutionParametersFromTemplate();

Definition at line 294 of file L1GtVhdlTemplateFile.cc.

References Parameters::parameters.

Referenced by getSubstitutionParametersFromTemplate().

295 {
296  // check, weather the current line is containing a substitution parameter
297  // the routine is making sure, that it's not extracting a parameter from
298  // a comment
299  if (int pos1=str.find("$(")!=std::string::npos && str.substr(0,2)!="--")
300  {
301  int pos2=str.find(")");
302  // get the substituion parameter
303  std::string tempStr=(str.substr(pos1+1,(pos2-pos1-1)));
304  // return a pair with the substitution parameter and the
305  // the rest of the string after the substitution parameter
306 
307  // here a should be checked, weather the vector is already containing
308  // the parameter befor adding it.
309 
310  parameters.push_back(tempStr);
311  //recursive call
312  while (extractParametersFromString(str.substr(pos2), parameters)) extractParametersFromString(str.substr(pos2), parameters);
313 
314  return true;
315  }
316  else
317  {
318  return false;
319  }
320 
321  return true;
322 }
dictionary parameters
Definition: Parameters.py:2
bool extractParametersFromString(const std::string &str, std::vector< std::string > &parameters)
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 61 of file L1GtVhdlTemplateFile.cc.

References position.

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().

62 {
63  size_t position;
64  position = paramString.find(searchString);
65  if (position == std::string::npos) return false;
66  paramString.replace(position,searchString.length(),replaceString);
67  return true;
68 }
static int position[264][3]
Definition: ReadPGInfo.cc:509
void L1GtVhdlTemplateFile::getConditionsFromAlgo ( std::string  condString,
std::vector< std::string > &  result 
)

extracts all conditions from a algorithm

Definition at line 427 of file L1GtVhdlTemplateFile.cc.

References findAndReplaceString(), i, and split().

Referenced by L1GtVhdlWriterCore::processAlgorithmMap().

428 {
429  std::vector<std::string> operators;
430 
431  operators.push_back("AND");
432  operators.push_back("OR");
433  operators.push_back("NOT");
434  operators.push_back("(");
435  operators.push_back(")");
436 
437  for (unsigned int i =0; i<operators.size(); i++)
438  {
439  while (findAndReplaceString(condString, operators.at(i), "")) findAndReplaceString(condString, operators.at(i), "");
440  }
441 
442  split(condString,result);
443 
444 }
int i
Definition: DBlmapReader.cc:9
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: query.py:137
bool split(const std::string &param, std::vector< std::string > &result)
seperates a string at all blanks and saves the elements in result
std::string L1GtVhdlTemplateFile::getInternalParameter ( const std::string &  indentifier)

returns a parameter of a internal template file

Definition at line 463 of file L1GtVhdlTemplateFile.cc.

References parameterMap_.

Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore::writeDefValPkg().

464 {
465  return parameterMap_[indentifier];
466 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
std::vector< std::string > L1GtVhdlTemplateFile::getSubstitutionParametersFromTemplate ( )

returns a vector with all substitution parameters that are found in the template file

Definition at line 325 of file L1GtVhdlTemplateFile.cc.

References extractParametersFromString(), lines_, and groupFilesInBlocks::temp.

Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().

326 {
327  std::vector<std::string> temp;
328  std::vector<std::string>::iterator iter = lines_.begin();
329 
330  // loop until the substitution parameter is discovered the first time
331  while( iter != lines_.end() )
332  {
333  extractParametersFromString((*iter), temp);
334  iter++;
335  }
336 
337  return temp;
338 
339 }
std::vector< std::string > lines_
containing the content of the VHDL file
bool extractParametersFromString(const std::string &str, std::vector< std::string > &parameters)
bool L1GtVhdlTemplateFile::insert ( const std::string &  atLine,
std::vector< std::string >  content 
)

replaces the whole line containing atLine and inserts content instead of it

Definition at line 212 of file L1GtVhdlTemplateFile.cc.

References lines_, and summarizeEdmComparisonLogfiles::success.

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

213 {
214  bool success = false;
215  std::vector<std::string>::iterator iter = lines_.begin();
216 
217  //Loop until the substitution parameter is discovered the first time
218  while( iter != lines_.end() )
219  {
220  //check, weather the current line is containing the substitution parameter
221  if ((*iter).find(atLine)!=std::string::npos)
222  {
223  //Delete the line with the subsitution parameter
224  iter = lines_.erase(iter);
225  //insert the content of file
226  lines_.insert(iter,content.begin(),content.end());
227 
228  success=true;
229  break;
230  }
231 
232  iter++;
233  }
234 
235  return success;
236 }
std::vector< std::string > lines_
containing the content of the VHDL file
bool L1GtVhdlTemplateFile::insert ( const std::string  atLine,
L1GtVhdlTemplateFile  file 
)

replaces the whole line containing atLine with the content of file

Definition at line 239 of file L1GtVhdlTemplateFile.cc.

References insert(), returnLines(), and groupFilesInBlocks::temp.

Referenced by BeautifulSoup.PageElement::_invert().

240 {
241  std::vector<std::string> temp = file.returnLines();
242 
243  if (insert(atLine,temp)) return true;
244 
245  return false;
246 }
bool insert(const std::string &atLine, std::vector< std::string > content)
replaces the whole line containing atLine and inserts content instead of it
std::vector< std::string > returnLines()
returns a string vector with the current content of the VHDL File
bool L1GtVhdlTemplateFile::isBlank ( const char &  chr)

checks weather a char is a blank

Definition at line 391 of file L1GtVhdlTemplateFile.cc.

Referenced by split().

392 {
393  if (chr==' ') return true;
394  return false;
395 
396 }
std::string L1GtVhdlTemplateFile::lines2String ( )

returns a string with the content of vector lines

Definition at line 447 of file L1GtVhdlTemplateFile.cc.

References lines_.

448 {
449  std::vector<std::string>::iterator iter = lines_.begin();
450  std::ostringstream buffer;
451 
452  while( iter != lines_.end() )
453  {
454  buffer<<(*iter)<<std::endl;
455  iter++;
456 
457  }
458 
459  return buffer.str();
460 }
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 71 of file L1GtVhdlTemplateFile.cc.

References recoMuon::in, analyzePatCOC_cfg::inputFile, lines_, and parameterMap_.

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

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

prints the content of the VHDL File (only lines_)

Definition at line 256 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and lines_.

Referenced by L1GtVhdlWriterCore::printCommonHeader().

257 {
258  std::vector<std::string>::iterator iter = lines_.begin();
259  while( iter != lines_.end())
260  {
261  std::cout<<*iter<<std::endl;
262  iter++;
263  }
264 
265 }
std::vector< std::string > lines_
containing the content of the VHDL file
tuple cout
Definition: gather_cfg.py:121
void L1GtVhdlTemplateFile::printParameterMap ( )

prints the parameter map

Definition at line 274 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and parameterMap_.

275 {
276  std::cout<<"Enter parametermap"<<std::endl;
277 
278  std::map<std::string,std::string>::iterator iter = parameterMap_.begin();
279 
280  while( iter != parameterMap_.end())
281  {
282  std::cout<<(*iter).first<<": "<<(*iter).second<<std::endl;
283  iter++;;
284  }
285 }
std::map< std::string, std::string > parameterMap_
containing the header information of internal files
tuple cout
Definition: gather_cfg.py:121
bool L1GtVhdlTemplateFile::removeEmptyLines ( )

deletes all empty lines in a template file

Definition at line 377 of file L1GtVhdlTemplateFile.cc.

References lines_.

Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVmeWriterCore::writeVME().

378 {
379  std::vector<std::string>::iterator iter = lines_.begin();
380 
381  while( iter != lines_.end() )
382  {
383  if ((*iter)=="" || (*iter).length()==0 || (*iter)==" ") lines_.erase(iter); else
384  iter++;
385  }
386 
387  return true;
388 }
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 357 of file L1GtVhdlTemplateFile.cc.

References lines_, position, and summarizeEdmComparisonLogfiles::success.

Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().

358 {
359  bool success = false;
360 
361  std::vector<std::string>::iterator iter = lines_.begin();
362  while( iter != lines_.end())
363  {
364  size_t position;
365  position = (*iter).find(str);
366 
367  if (position != std::string::npos)
368  {
369  lines_.erase(iter);
370  success=true;
371  } else iter++;
372  }
373  return success;
374 }
std::vector< std::string > lines_
containing the content of the VHDL file
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::vector< std::string > L1GtVhdlTemplateFile::returnLines ( )

returns a string vector with the current content of the VHDL File

Definition at line 268 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

269 {
270  return lines_;
271 }
std::vector< std::string > lines_
containing the content of the VHDL file
std::map< std::string, std::string > L1GtVhdlTemplateFile::returnParameterMap ( )

returns parameter map

Definition at line 288 of file L1GtVhdlTemplateFile.cc.

References parameterMap_.

Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().

289 {
290  return parameterMap_;
291 }
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 170 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().

171 {
172  std::ofstream outputFile(fileName.c_str());
173  std::vector<std::string>::iterator iter = lines_.begin();
174 
175  //Write content of lines_ into the outputfile.
176  while( iter != lines_.end() )
177  {
178  //std::cout<<"Last sign: "<<*iter[(*iter).length()-3];
179  outputFile << *iter<<std::endl;
180  iter++;
181  }
182 
183  outputFile.close();
184 
185  return true;
186 
187 }
std::vector< std::string > lines_
containing the content of the VHDL file
bool L1GtVhdlTemplateFile::split ( const std::string &  param,
std::vector< std::string > &  result 
)

seperates a string at all blanks and saves the elements in result

Definition at line 399 of file L1GtVhdlTemplateFile.cc.

References i, isBlank(), pos, query::result, and groupFilesInBlocks::temp.

Referenced by getConditionsFromAlgo().

400 {
401  unsigned int i = 0;
402  while (isBlank(param[i]))
403  {
404  i++;
405  }
406 
407  std::string temp = param.substr(i);
408  std::size_t pos = temp.find(" ");
409 
410  if (pos != std::string::npos)
411  {
412  std::string temp2 = temp.substr(0, pos);
413  result.push_back(temp2);
414  while (split(temp.substr(pos),result)) split(temp.substr(pos),result);
415 
416  } else if (!isBlank(temp[pos+1]))
417  {
418  result.push_back(temp);
419  return false;
420  } else
421  return false;
422 
423  return false;
424 }
int i
Definition: DBlmapReader.cc:9
bool isBlank(const char &chr)
checks weather a char is a blank
tuple result
Definition: query.py:137
bool split(const std::string &param, std::vector< std::string > &result)
seperates a string at all blanks and saves the elements in result
bool L1GtVhdlTemplateFile::substitute ( const std::string &  searchString,
const std::string &  replaceString 
)

replaces searchString with replaceString

Definition at line 190 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().

191 {
192 
193  bool success = false;
194 
195  std::vector<std::string>::iterator iter = lines_.begin();
196  while( iter != lines_.end())
197  {
198  //The substitution parameter always appears as follows: $(parameter)
199  while (findAndReplaceString(*iter,("$("+searchString+")"), replaceString))
200  {
201  findAndReplaceString(*iter,("$("+searchString+")"), replaceString);
202  success = true;
203  }
204  iter++;
205  }
206 
207  return success;
208 
209 }
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
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 33 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 37 of file L1GtVhdlTemplateFile.h.

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