NOMAD Source  Version 4.0.0 Beta
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParameterEntry Class Reference

Parameter entry. More...

#include <ParameterEntry.hpp>

Collaboration diagram for ParameterEntry:

Public Member Functions

 ParameterEntry (const std::string &entry, bool removeComments=true)
 Constructor. More...
 
virtual ~ParameterEntry (void)
 Destructor. More...
 
const std::string & getName (void) const
 Access to the name of the parameter. More...
 
const std::list< std::string > & getValues (void) const
 Access to the parameter values. More...
 
std::string getAllValues (void) const
 
size_t getNbValues (void) const
 Access to the number of values of the parameter. More...
 
bool isOk (void) const
 Access to the _ok flag. More...
 
bool isUnique (void) const
 Access to the _unique flag. More...
 
std::shared_ptr< ParameterEntrygetNext (void) const
 Access to another ParameterEntry. More...
 
bool hasBeenInterpreted (void) const
 Access to the _hasBeenInterpreted flag. More...
 
const std::string & getParamFile (void) const
 Access to the parameter file of the parameter. More...
 
const int & getLine (void) const
 Access to the line number for this parameter in the parameter file. More...
 
void setNext (std::shared_ptr< ParameterEntry > p)
 Set the _next pointer. More...
 
void setUnique (bool u)
 Set the _unique flag. More...
 
void setHasBeenInterpreted (void)
 Set the _hasBeenInterpreted flag. to true. More...
 
void setParamFile (const std::string &paramFile)
 Set the name of the parameter file _paramFile. More...
 
void setLine (int line)
 Set the line _line for this parameter in the parameter file. More...
 
bool operator< (const ParameterEntry &p) const
 Comparison with another entry. More...
 
void display (std::ostream &out) const
 Display. More...
 

Private Attributes

std::string _name
 Name of the parameter. More...
 
std::list< std::string > _values
 List of values for the parameter. More...
 
bool _ok
 If the parameter is valid. More...
 
bool _unique
 If the parameter is unique. More...
 
std::shared_ptr< ParameterEntry_next
 Acces to the next parameter. More...
 
std::string _paramFile
 File from which this parameter was read. More...
 
int _line
 Line for this parameter in _paramFile. More...
 
bool _hasBeenInterpreted
 If the parameter has been interpreted. More...
 

Detailed Description

Parameter entry.

  • Describes the data relative to a parameter in a parameters file.
  • Objects of this class are stored in a ParameterEntries object.

Definition at line 22 of file ParameterEntry.hpp.

Constructor & Destructor Documentation

ParameterEntry::ParameterEntry ( const std::string &  entry,
bool  removeComments = true 
)
explicit

Constructor.

Ignores all entries after '#'.

Parameters
entryA string describing the parameter entry – IN.
removeCommentsA boolean equal to true if entries after '#' are ignored – IN (Opt) (default = true).
virtual ParameterEntry::~ParameterEntry ( void  )
inlinevirtual

Destructor.

Definition at line 51 of file ParameterEntry.hpp.

51 {}

Member Function Documentation

void ParameterEntry::display ( std::ostream &  out) const

Display.

Parameters
outThe std::ostream object – IN.
std::string ParameterEntry::getAllValues ( void  ) const
const int& ParameterEntry::getLine ( void  ) const
inline

Access to the line number for this parameter in the parameter file.

Returns
The line number at which this parameter can be found in the parameter file.

Definition at line 118 of file ParameterEntry.hpp.

118 { return _line; }
int _line
Line for this parameter in _paramFile.
const std::string& ParameterEntry::getName ( void  ) const
inline

Access to the name of the parameter.

Returns
The name.

Definition at line 61 of file ParameterEntry.hpp.

61 { return _name; }
std::string _name
Name of the parameter.
size_t ParameterEntry::getNbValues ( void  ) const
inline

Access to the number of values of the parameter.

Returns
The number of values.

Definition at line 75 of file ParameterEntry.hpp.

75 { return _values.size(); }
std::list< std::string > _values
List of values for the parameter.
std::shared_ptr<ParameterEntry> ParameterEntry::getNext ( void  ) const
inline

Access to another ParameterEntry.

ParameterEntry objects are stored in a ParameterEntries object. The link between elements is assumed by the _next member returned by this function.

Returns
A pointer to the next entry.

Definition at line 99 of file ParameterEntry.hpp.

99 { return _next; }
std::shared_ptr< ParameterEntry > _next
Acces to the next parameter.
const std::string& ParameterEntry::getParamFile ( void  ) const
inline

Access to the parameter file of the parameter.

Returns
The parameter file where this parameter was read.

Definition at line 112 of file ParameterEntry.hpp.

112 { return _paramFile; }
std::string _paramFile
File from which this parameter was read.
const std::list<std::string>& ParameterEntry::getValues ( void  ) const
inline

Access to the parameter values.

Returns
The parameter values as a list of strings.

Definition at line 67 of file ParameterEntry.hpp.

67 { return _values; }
std::list< std::string > _values
List of values for the parameter.
bool ParameterEntry::hasBeenInterpreted ( void  ) const
inline

Access to the _hasBeenInterpreted flag.

Returns
A boolean equal to true if the parameter has already been interpreted.

Definition at line 106 of file ParameterEntry.hpp.

106 { return _hasBeenInterpreted; }
bool _hasBeenInterpreted
If the parameter has been interpreted.
bool ParameterEntry::isOk ( void  ) const
inline

Access to the _ok flag.

This flag is equal to true if the parameter entry is well defined.

Returns
A boolean equal to true if the parameter is valid.

Definition at line 82 of file ParameterEntry.hpp.

82 { return _ok; }
bool _ok
If the parameter is valid.
bool ParameterEntry::isUnique ( void  ) const
inline

Access to the _unique flag.

This flag is decided when a parameters file is read.

Returns
A boolean equal to true if the parameter is unique in a parameters file.

Definition at line 90 of file ParameterEntry.hpp.

90 { return _unique; }
bool _unique
If the parameter is unique.
bool ParameterEntry::operator< ( const ParameterEntry p) const
inline

Comparison with another entry.

The comparison is based on the parameter name.

Parameters
pThe right-hand side object – IN.
Returns
A boolean equal to true if this->_name < p._name.

Definition at line 151 of file ParameterEntry.hpp.

151 { return _name < p._name; }
std::string _name
Name of the parameter.
void ParameterEntry::setHasBeenInterpreted ( void  )
inline

Set the _hasBeenInterpreted flag. to true.

Definition at line 137 of file ParameterEntry.hpp.

137 { _hasBeenInterpreted = true; }
bool _hasBeenInterpreted
If the parameter has been interpreted.
void ParameterEntry::setLine ( int  line)
inline

Set the line _line for this parameter in the parameter file.

Definition at line 143 of file ParameterEntry.hpp.

143 { _line = line; }
int _line
Line for this parameter in _paramFile.
void ParameterEntry::setNext ( std::shared_ptr< ParameterEntry p)
inline

Set the _next pointer.

Parameters
pA pointer to the next ParameterEntry to be inserted – IN.

Definition at line 128 of file ParameterEntry.hpp.

128 { _next = p; }
std::shared_ptr< ParameterEntry > _next
Acces to the next parameter.
void ParameterEntry::setParamFile ( const std::string &  paramFile)
inline

Set the name of the parameter file _paramFile.

Definition at line 140 of file ParameterEntry.hpp.

140 { _paramFile = paramFile; }
std::string _paramFile
File from which this parameter was read.
void ParameterEntry::setUnique ( bool  u)
inline

Set the _unique flag.

Parameters
uValue of the flag – IN.

Definition at line 134 of file ParameterEntry.hpp.

134 { _unique = u; }
bool _unique
If the parameter is unique.

Member Data Documentation

bool ParameterEntry::_hasBeenInterpreted
private

If the parameter has been interpreted.

Definition at line 36 of file ParameterEntry.hpp.

int ParameterEntry::_line
private

Line for this parameter in _paramFile.

Definition at line 33 of file ParameterEntry.hpp.

std::string ParameterEntry::_name
private

Name of the parameter.

Definition at line 26 of file ParameterEntry.hpp.

std::shared_ptr<ParameterEntry> ParameterEntry::_next
private

Acces to the next parameter.

Definition at line 30 of file ParameterEntry.hpp.

bool ParameterEntry::_ok
private

If the parameter is valid.

Definition at line 28 of file ParameterEntry.hpp.

std::string ParameterEntry::_paramFile
private

File from which this parameter was read.

Definition at line 32 of file ParameterEntry.hpp.

bool ParameterEntry::_unique
private

If the parameter is unique.

Definition at line 29 of file ParameterEntry.hpp.

std::list<std::string> ParameterEntry::_values
private

List of values for the parameter.

Definition at line 27 of file ParameterEntry.hpp.


The documentation for this class was generated from the following file: