ra4_draw
4bd0201e3d922d42bd545d4b045ed44db33454a4
|
#include <string>
#include <map>
#include <set>
Go to the source code of this file.
Classes | |
class | SimpleVariable |
Pairs a type and name of a variable accessible via Baby. More... | |
class | Variable |
A variable to be accessible in Baby classes. More... | |
Functions | |
std::set< Variable > | GetVariables (const std::set< std::string > &files) |
bool | IsComment (const std::string &line) |
Check if line in variable list file is a comment (blank) More... | |
SimpleVariable | GetVariable (std::string line) |
Extracts variable type and name from line from variable text files. More... | |
void | RemoveExtraSpaces (std::string &line) |
Removes leading, trailing, and double spaced from a text line. More... | |
void | WriteBaseHeader (const std::set< Variable > &vars, const std::set< std::string > &types) |
Writes inc/baby.hpp. More... | |
void | WriteBaseSource (const std::set< Variable > &vars) |
Writes src/baby.cpp. More... | |
void | WriteSpecializedHeader (const std::set< Variable > &vars, const std::string &type) |
Writes a derived Baby header file. More... | |
void | WriteSpecializedSource (const std::set< Variable > &vars, const std::string &type) |
Writes a derived Baby source file. More... | |
void | WriteMergedHeader (const std::set< Variable > &vars, const std::set< std::string > &types) |
SimpleVariable GetVariable | ( | string | line | ) |
Extracts variable type and name from line from variable text files.
[in] | line | The line to be parsed |
Definition at line 344 of file generate_baby.cxx.
References ERROR, and RemoveExtraSpaces().
Referenced by GetVariables().
std::set<Variable> GetVariables | ( | const set< string > & | files | ) |
/brief Reads files to get variable names and associated types
[in] | files | Set of files to be read. Typically everything in txt/variables |
Definition at line 285 of file generate_baby.cxx.
References GetVariable(), IsComment(), Variable::Name(), SimpleVariable::name_, Variable::SetEntry(), and SimpleVariable::type_.
Referenced by main().
bool IsComment | ( | const string & | line | ) |
Check if line in variable list file is a comment (blank)
Not very robust. Currently, a line is a "comment" if is is less than 3 characters long or contains neither letters nor underscores. Should add support for "#" starting a comment line and more robust checking.
Definition at line 325 of file generate_baby.cxx.
Referenced by GetVariables().
void RemoveExtraSpaces | ( | string & | line | ) |
Removes leading, trailing, and double spaced from a text line.
[in,out] | line | Line of text from which spaces are to be removed |
Definition at line 361 of file generate_baby.cxx.
Referenced by GetVariable().
void WriteBaseHeader | ( | const set< Variable > & | vars, |
const set< string > & | types | ||
) |
Writes inc/baby.hpp.
[in] | vars | All variables for all Baby classes, with type information |
[in] | types | Names of derived Baby classes (basic, full, etc.) |
Definition at line 410 of file generate_baby.cxx.
Referenced by main().
void WriteBaseSource | ( | const set< Variable > & | vars | ) |
Writes src/baby.cpp.
[in] | vars | All variables for all Baby classes, with type information |
Definition at line 524 of file generate_baby.cxx.
Referenced by main().
void WriteMergedHeader | ( | const std::set< Variable > & | vars, |
const std::set< std::string > & | types | ||
) |
void WriteSpecializedHeader | ( | const set< Variable > & | vars, |
const string & | type | ||
) |
void WriteSpecializedSource | ( | const set< Variable > & | vars, |
const string & | type | ||
) |