BALL
1.4.79
|
#include <BALL/FORMAT/parameterSection.h>
Public Types | |
Enums | |
enum | { MAX_FIELDS = 20 } |
Public Member Functions | |
Constructors and Destructors | |
ParameterSection () | |
ParameterSection (const ParameterSection ¶meter_section) | |
virtual | ~ParameterSection () |
Extracting Data from the Section | |
bool | extractSection (Parameters ¶meters, const String §ion_name) |
const String & | getSectionName () const |
const String & | getValue (const String &key, const String &variable) const |
bool | has (const String &key, const String &variable) const |
bool | has (const String &key) const |
bool | hasVariable (const String &variable) const |
Position | getColumnIndex (const String &variable) const |
Size | getNumberOfVariables () const |
Size | getNumberOfKeys () const |
const String & | getValue (Position key_index, Position variable_index) const |
const String & | getKey (Position key_index) const |
Assignment | |
virtual void | clear () |
const ParameterSection & | operator= (const ParameterSection §ion) |
Predicates | |
virtual bool | isValid () const |
bool | operator== (const ParameterSection ¶meter_section) const |
Public Attributes | |
Public Members | |
Options | options |
Static Public Attributes | |
static const String | UNDEFINED |
Protected Attributes | |
String | section_name_ |
String | format_line_ |
StringHashMap< Index > | section_entries_ |
StringHashMap< Index > | variable_names_ |
std::vector< String > | entries_ |
std::vector< String > | keys_ |
Size | number_of_variables_ |
std::vector< float > | version_ |
bool | valid_ |
General Parameter Section Class. It is similar to INIFile , but a little bit more sophisticated. Just as in a INIFile there can be comment lines starting with either "<b>;</b>", "<b>!</b>" or "<b>\#</b>" and it is divided in sections. A section-line looks like "<b>[ElectricFieldEffect]</b>". The first non-comment line in a section is the format-line. It defines the sort of values stored in the section and their order:
Each value line may contain version information, indicated by a variable definition named "ver"; thus only the latest version will be version will be accessed.
Definition at line 39 of file parameterSection.h.
anonymous enum |
Enumerator | |
---|---|
MAX_FIELDS |
Definition at line 56 of file parameterSection.h.
BALL::ParameterSection::ParameterSection | ( | ) |
Default constructor.
BALL::ParameterSection::ParameterSection | ( | const ParameterSection & | parameter_section | ) |
Copy constructor
|
virtual |
Destructor.
|
virtual |
Clear method.
Reimplemented in BALL::CosineTorsion, BALL::LennardJones, BALL::ResidueTorsions, BALL::AtomTypes, BALL::QuadraticImproperTorsion, BALL::CharmmEEF1, BALL::SolventParameter, BALL::RDFParameter, BALL::ClaverieParameter, BALL::Potential1210, BALL::RDFSection, BALL::QuadraticAngleBend, BALL::QuadraticBondStretch, BALL::Templates, and BALL::SpaceGroupParameters.
bool BALL::ParameterSection::extractSection | ( | Parameters & | parameters, |
const String & | section_name | ||
) |
Reads a parameter section from an INI file. This method reads the section given in section_name from ini_file, interprets (if given) a format line, reads the data from this section according to the format, and builds some datastructures for fast and easy acces to the data.
parameters | the parameters defining the inifile to be read from |
section_name | the name of the section to be read (without the squared brackets) |
Return the column index of a variable. If section doesn't have the variable, INVALID_POSITION is returned.
Fast access to the key array. The first key has the index 0. If the key is undefined, UNDEFINED is returned.
Size BALL::ParameterSection::getNumberOfKeys | ( | ) | const |
Returns the number of different keys defined.
Size BALL::ParameterSection::getNumberOfVariables | ( | ) | const |
Returns the number of defined variables.
const String& BALL::ParameterSection::getSectionName | ( | ) | const |
Return the name of the section read. The section name is empty before extractSection was called.
const String& BALL::ParameterSection::getValue | ( | const String & | key, |
const String & | variable | ||
) | const |
Returns the value associated with the key and returns the value of the given variable. If the requested variable is not defined in the format line, an empty string is returned.
const String& BALL::ParameterSection::getValue | ( | Position | key_index, |
Position | variable_index | ||
) | const |
Fast access to the value array. If the value is undefined, UNDEFINED is returned.
Query for a pair of key and variable. False is returned if
Query for a key. False is returned if the key could not be found.
key | the key to serch in the hash table |
Query whether a specified variable was defined in the format line.
|
virtual |
Validity predicate
const ParameterSection& BALL::ParameterSection::operator= | ( | const ParameterSection & | section | ) |
Assignment operator
bool BALL::ParameterSection::operator== | ( | const ParameterSection & | parameter_section | ) | const |
Equality operator
|
protected |
Definition at line 220 of file parameterSection.h.
|
protected |
Definition at line 205 of file parameterSection.h.
|
protected |
Definition at line 224 of file parameterSection.h.
|
protected |
Definition at line 229 of file parameterSection.h.
Options BALL::ParameterSection::options |
The options read in from options lines contained in this section. Remember: options lines start with "@" as the first character and must be of the form "@name=value".
Definition at line 193 of file parameterSection.h.
|
protected |
Definition at line 210 of file parameterSection.h.
|
protected |
Definition at line 201 of file parameterSection.h.
|
static |
Result Type for unknown items.
Definition at line 48 of file parameterSection.h.
|
protected |
Definition at line 237 of file parameterSection.h.
|
protected |
Definition at line 214 of file parameterSection.h.
|
protected |
Definition at line 233 of file parameterSection.h.