19 #include <mrpt/config.h> 56 using BASE = std::map<std::string, T>;
68 val = va_arg(args, T);
74 nam = va_arg(args,
const char*);
77 val = va_arg(args, T);
95 throw std::logic_error(
132 size_t maxStrLen = 10;
133 for (
const auto& e : *
this)
134 maxStrLen = std::max(maxStrLen, e.first.size());
136 std::stringstream str;
137 for (
const auto& e : *
this)
138 str << e.first <<
std::string(maxStrLen - e.first.size(),
' ')
139 <<
" = " << e.second << std::endl;
const_iterator find(const KEY &key) const
TParameters()
Default constructor (initializes empty)
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
bool has(const std::string &s) const
std::map< std::string, double > BASE
std::string getAsString() const
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'.
GLsizei const GLchar ** string
T & operator[](const std::string &s)
The write (non-const) version of the [] operator.
T operator[](const std::string &s) const
A const version of the [] operator, for usage as read-only.
void dumpToConsole() const
Dumps to console the output from getAsString()
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
TParameters(const char *nam1,...)
Constructor with a list of initial values (see the description and use example in mrpt::system::TPara...
const Scalar * const_iterator
T getWithDefaultVal(const std::string &s, const T &defaultVal) const
A const version of the [] operator and with a default value in case the parameter is not set (for usa...
void getAsString(std::string &s) const
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'.