Quick and easy key-value container that stringifies all values.
More...
#include <Options.h>
|
| void | enumVals (std::ostream &out, int level=1) const |
| | List all stored values. More...
|
| |
| bool | has (const std::string &key) const noexcept |
| | Does a key of the specified name exist? More...
|
| |
| template<class T > |
| T | get (const std::string &key, bool &result) const |
| | Retrieves an option. More...
|
| |
| template<class T > |
| T | get (const std::string &key, const T &defaultval, bool &result) const |
| | Retrieves an option. Returns defaultval if nonexistant. More...
|
| |
| template<class T > |
| Options & | set (const std::string &key, const T &value) |
| | Adds or replaces an option. More...
|
| |
| template<class T > |
| Options & | add (const std::string &key, const T &value) |
| | Adds an option. Throws if the same name already exists. More...
|
| |
|
| std::map< std::string, std::string > | mapStr_ |
| |
Quick and easy key-value container that stringifies all values.
Used in the ioda error system.
Definition at line 23 of file Options.h.
◆ add()
template<class T >
| Options& ioda::Options::add |
( |
const std::string & |
key, |
|
|
const T & |
value |
|
) |
| |
|
inline |
Adds an option. Throws if the same name already exists.
Definition at line 73 of file Options.h.
◆ enumVals()
| void ioda::Options::enumVals |
( |
std::ostream & |
out, |
|
|
int |
level = 1 |
|
) |
| const |
|
inline |
List all stored values.
Definition at line 28 of file Options.h.
◆ get() [1/2]
template<class T >
| T ioda::Options::get |
( |
const std::string & |
key, |
|
|
bool & |
result |
|
) |
| const |
|
inline |
Retrieves an option.
Definition at line 41 of file Options.h.
◆ get() [2/2]
template<class T >
| T ioda::Options::get |
( |
const std::string & |
key, |
|
|
const T & |
defaultval, |
|
|
bool & |
result |
|
) |
| const |
|
inline |
Retrieves an option. Returns defaultval if nonexistant.
Definition at line 55 of file Options.h.
◆ has()
| bool ioda::Options::has |
( |
const std::string & |
key | ) |
const |
|
inlinenoexcept |
Does a key of the specified name exist?
Definition at line 35 of file Options.h.
◆ set()
template<class T >
| Options& ioda::Options::set |
( |
const std::string & |
key, |
|
|
const T & |
value |
|
) |
| |
|
inline |
Adds or replaces an option.
Definition at line 64 of file Options.h.
◆ mapStr_
| std::map<std::string, std::string> ioda::Options::mapStr_ |
|
private |
The documentation for this class was generated from the following file: