knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <OptionList.h>
Public Member Functions | |
OptionList (const TermPtr &t) | |
const std::map< std::string, TermPtr > & | options () const |
bool | contains (const std::string &key) const |
const TermPtr & | get (const std::string &key, const TermPtr &defaultValue) const |
std::string_view | getString (const std::string &key, const std::string &defaultValue) const |
long | getLong (const std::string &key, long defaultValue) const |
std::optional< double > | getDouble (const std::string &key) const |
OptionList (const TermPtr &t) | |
const std::map< std::string, TermPtr > & | options () const |
bool | contains (const std::string &key) const |
const TermPtr & | get (const std::string &key, const TermPtr &defaultValue) const |
std::string_view | getString (const std::string &key, const std::string &defaultValue) const |
long | getLong (const std::string &key, long defaultValue) const |
std::optional< double > | getDouble (const std::string &key) const |
Protected Member Functions | |
void | readOption (const TermPtr &option) |
void | readOption (const TermPtr &option) |
Protected Attributes | |
std::map< std::string, TermPtr > | options_ |
A list of options, where each option is represented as a term.
Definition at line 18 of file OptionList.h.
|
explicit |
Constructs an option list from a term. The term may be a list of options, or a single option value. Option terms have either the form Key = Value
or Key(Value)
.
t | a term from which options are read. |
Definition at line 13 of file OptionList.cpp.
|
explicit |
Constructs an option list from a term. The term may be a list of options, or a single option value. Option terms have either the form Key = Value
or Key(Value)
.
t | a term from which options are read. |
bool OptionList::contains | ( | const std::string & | key | ) | const |
key | key of option. |
Definition at line 49 of file OptionList.cpp.
bool knowrob::OptionList::contains | ( | const std::string & | key | ) | const |
key | key of option. |
key | an option key |
defaultValue | a default value |
Definition at line 53 of file OptionList.cpp.
const TermPtr& knowrob::OptionList::get | ( | const std::string & | key, |
const TermPtr & | defaultValue | ||
) | const |
key | an option key |
defaultValue | a default value |
std::optional< double > OptionList::getDouble | ( | const std::string & | key | ) | const |
Read option value as a double.
key | an option key |
Definition at line 89 of file OptionList.cpp.
std::optional<double> knowrob::OptionList::getDouble | ( | const std::string & | key | ) | const |
Read option value as a double.
key | an option key |
long OptionList::getLong | ( | const std::string & | key, |
long | defaultValue | ||
) | const |
Read option value as a long.
key | an option key |
defaultValue | a default value |
Definition at line 79 of file OptionList.cpp.
long knowrob::OptionList::getLong | ( | const std::string & | key, |
long | defaultValue | ||
) | const |
Read option value as a long.
key | an option key |
defaultValue | a default value |
std::string_view OptionList::getString | ( | const std::string & | key, |
const std::string & | defaultValue | ||
) | const |
Read option value as a string.
key | an option key |
defaultValue | a default value |
Definition at line 62 of file OptionList.cpp.
std::string_view knowrob::OptionList::getString | ( | const std::string & | key, |
const std::string & | defaultValue | ||
) | const |
Read option value as a string.
key | an option key |
defaultValue | a default value |
|
inline |
|
inline |
|
protected |
Definition at line 29 of file OptionList.cpp.
|
protected |
|
protected |
Definition at line 70 of file OptionList.h.