Represents a setting in the configuration.
More...
#include <Configuration.hpp>
|
| Setting (const libconfig::Setting &s) |
| The constructor. More...
|
|
bool | hasName () const |
| Returns whether the setting has a name. More...
|
|
const std::string | getName () const |
| Returns the name of the setting. More...
|
|
bool | has (const std::string &settingName) const |
| Returns whether a setting with the given name exists. More...
|
|
template<typename ValueType > |
void | read (const std::string &name, ValueType *const value) const |
| Reads the specified setting and stores it at the given location. More...
|
|
void | read (const std::string &name, std::size_t *const value) const |
| Reads the specified setting and stores it at the given location. More...
|
|
template<typename ValueType > |
ValueType | read (const std::string &name) const |
| Returns the specified setting. More...
|
|
std::size_t | getChildCount () const |
| Returns the number of direct child settings in this setting. More...
|
|
const Setting | getChild (const std::size_t childIndex) const |
| Returns the child setting with the given index. More...
|
|
const Setting | getSetting (const std::string &name) const |
| Returns the setting object with the given name. More...
|
|
const List | getList (const std::string &name) const |
| Returns the list object with the given name. More...
|
|
bool | childrenHaveNamesInCollection (const std::set< std::string > &names, std::string *const offender=NULL) const |
| Returns whether all children in this setting have names that are in the given set. More...
|
|
Represents a setting in the configuration.
Definition at line 36 of file Configuration.hpp.
◆ Setting()
OpenMPCD::Configuration::Setting::Setting |
( |
const libconfig::Setting & |
s | ) |
|
|
inline |
The constructor.
The instance is only valid as long as the Configuration instance it originated from is valid.
- Parameters
-
Definition at line 46 of file Configuration.hpp.
◆ childrenHaveNamesInCollection()
bool OpenMPCD::Configuration::Setting::childrenHaveNamesInCollection |
( |
const std::set< std::string > & |
names, |
|
|
std::string *const |
offender = NULL |
|
) |
| const |
Returns whether all children in this setting have names that are in the given set.
- Parameters
-
[in] | names | The names against to compare the children's names to. |
[out] | offender | If not NULL and if true is returned, the pointee is set to the name of the first child encountered whose name is not in the given set names . |
Definition at line 12 of file Configuration.cpp.
◆ getChild()
const Setting OpenMPCD::Configuration::Setting::getChild |
( |
const std::size_t |
childIndex | ) |
const |
|
inline |
Returns the child setting with the given index.
- Parameters
-
[in] | childIndex | The index of the child setting, which must be less than getChildCount() . |
- Exceptions
-
Definition at line 250 of file Configuration.hpp.
◆ getChildCount()
std::size_t OpenMPCD::Configuration::Setting::getChildCount |
( |
| ) |
const |
|
inline |
Returns the number of direct child settings in this setting.
This function does not count children of children.
Definition at line 235 of file Configuration.hpp.
◆ getList()
const Configuration::List OpenMPCD::Configuration::Setting::getList |
( |
const std::string & |
name | ) |
const |
|
inline |
Returns the list object with the given name.
- Exceptions
-
- Parameters
-
[in] | name | The setting name. |
Definition at line 812 of file Configuration.hpp.
◆ getName()
const std::string OpenMPCD::Configuration::Setting::getName |
( |
| ) |
const |
|
inline |
◆ getSetting()
const Setting OpenMPCD::Configuration::Setting::getSetting |
( |
const std::string & |
name | ) |
const |
|
inline |
Returns the setting object with the given name.
- Exceptions
-
- Parameters
-
[in] | name | The setting name. |
Definition at line 275 of file Configuration.hpp.
◆ has()
bool OpenMPCD::Configuration::Setting::has |
( |
const std::string & |
settingName | ) |
const |
|
inline |
Returns whether a setting with the given name exists.
- Exceptions
-
- Parameters
-
[in] | settingName | The setting name. |
Definition at line 82 of file Configuration.hpp.
◆ hasName()
bool OpenMPCD::Configuration::Setting::hasName |
( |
| ) |
const |
|
inline |
◆ read() [1/3]
template<typename ValueType >
ValueType OpenMPCD::Configuration::Setting::read |
( |
const std::string & |
name | ) |
const |
|
inline |
Returns the specified setting.
- Exceptions
-
- Template Parameters
-
ValueType | The type of the settings value. |
- Parameters
-
[in] | name | The setting name, relative to this setting. |
Definition at line 223 of file Configuration.hpp.
◆ read() [2/3]
void OpenMPCD::Configuration::Setting::read |
( |
const std::string & |
name, |
|
|
std::size_t *const |
value |
|
) |
| const |
|
inline |
Reads the specified setting and stores it at the given location.
- Exceptions
-
- Parameters
-
[in] | name | The setting name, relative to this setting. |
[out] | value | The location to read the setting value into. |
Definition at line 203 of file Configuration.hpp.
◆ read() [3/3]
template<typename ValueType >
void OpenMPCD::Configuration::Setting::read |
( |
const std::string & |
name, |
|
|
ValueType *const |
value |
|
) |
| const |
|
inline |
Reads the specified setting and stores it at the given location.
- Exceptions
-
- Template Parameters
-
ValueType | The type of the settings value. |
- Parameters
-
[in] | name | The setting name, relative to this setting. |
[out] | value | The location to read the setting value into. |
Definition at line 131 of file Configuration.hpp.
The documentation for this class was generated from the following files: