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:
2008/02/27 18:51:17
Revision:
1.4

Description: a class to deal with VHDL template files

Implementation: <TODO: enter implementation details>

Author
: Philipp Wagner
Date:
2008/02/27 18:46:18
Revision:
1.4

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:41
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 343 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

344 {
345  lines_.push_back(str);
346 }
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 349 of file L1GtVhdlTemplateFile.cc.

References i, and lines_.

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

Definition at line 250 of file L1GtVhdlTemplateFile.cc.

Referenced by python.Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and python.Vispa.Gui.FindDialog.FindDialog::keyPressEvent().

251 {
252  //empty
253  return true;
254 }
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 295 of file L1GtVhdlTemplateFile.cc.

References ExpressReco_HICollisions_FallBack::parameters.

Referenced by getSubstitutionParametersFromTemplate().

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

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

Referenced by L1GtVhdlWriterCore::processAlgorithmMap().

429 {
430  std::vector<std::string> operators;
431 
432  operators.push_back("AND");
433  operators.push_back("OR");
434  operators.push_back("NOT");
435  operators.push_back("(");
436  operators.push_back(")");
437 
438  for (unsigned int i =0; i<operators.size(); i++)
439  {
440  while (findAndReplaceString(condString, operators.at(i), "")) findAndReplaceString(condString, operators.at(i), "");
441  }
442 
443  split(condString,result);
444 
445 }
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 464 of file L1GtVhdlTemplateFile.cc.

References parameterMap_.

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

465 {
466  return parameterMap_[indentifier];
467 }
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 326 of file L1GtVhdlTemplateFile.cc.

References extractParametersFromString(), lines_, and cond::rpcobtemp::temp.

Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().

327 {
328  std::vector<std::string> temp;
329  std::vector<std::string>::iterator iter = lines_.begin();
330 
331  // loop until the substitution parameter is discovered the first time
332  while( iter != lines_.end() )
333  {
334  extractParametersFromString((*iter), temp);
335  iter++;
336  }
337 
338  return temp;
339 
340 }
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 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(), lines_, returnLines(), and cond::rpcobtemp::temp.

240 {
241  std::vector<std::string>::iterator iter = lines_.begin();
242  std::vector<std::string> temp = file.returnLines();
243 
244  if (insert(atLine,temp)) return true;
245 
246  return false;
247 }
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
std::vector< std::string > lines_
containing the content of the VHDL file
bool L1GtVhdlTemplateFile::isBlank ( const char &  chr)

checks weather a char is a blank

Definition at line 392 of file L1GtVhdlTemplateFile.cc.

Referenced by split().

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

returns a string with the content of vector lines

Definition at line 448 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

References gather_cfg::cout, and lines_.

Referenced by L1GtVhdlWriterCore::printCommonHeader().

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

prints the parameter map

Definition at line 275 of file L1GtVhdlTemplateFile.cc.

References gather_cfg::cout, and parameterMap_.

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

deletes all empty lines in a template file

Definition at line 378 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

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

References lines_, position, and summarizeEdmComparisonLogfiles::success.

Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().

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

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

Definition at line 269 of file L1GtVhdlTemplateFile.cc.

References lines_.

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

270 {
271  return lines_;
272 }
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 289 of file L1GtVhdlTemplateFile.cc.

References parameterMap_.

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

290 {
291  return parameterMap_;
292 }
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 400 of file L1GtVhdlTemplateFile.cc.

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

Referenced by getConditionsFromAlgo().

401 {
402  unsigned int i = 0;
403  while (isBlank(param[i]))
404  {
405  i++;
406  }
407 
408  std::string temp = param.substr(i);
409  std::size_t pos = temp.find(" ");
410 
411  if (pos != std::string::npos)
412  {
413  std::string temp2 = temp.substr(0, pos);
414  result.push_back(temp2);
415  while (split(temp.substr(pos),result)) split(temp.substr(pos),result);
416 
417  } else if (!isBlank(temp[pos+1]))
418  {
419  result.push_back(temp);
420  return false;
421  } else
422  return false;
423 
424  return false;
425 }
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().