Go to the documentation of this file.
19 #include <mrpt/config.h>
58 using BASE = std::map<std::string, T>;
70 val = va_arg(args, T);
76 nam = va_arg(args,
const char*);
79 val = va_arg(args, T);
97 throw std::logic_error(
134 size_t maxStrLen = 10;
135 for (
const auto& e : *
this)
136 maxStrLen = std::max(maxStrLen, e.first.size());
138 std::stringstream str;
139 for (
const auto& e : *
this)
140 str << e.first <<
std::string(maxStrLen - e.first.size(),
' ')
141 <<
" = " << e.second << std::endl;
bool has(const std::string &s) const
T operator[](const std::string &s) const
A const version of the [] operator, for usage as read-only.
const Scalar * const_iterator
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.
void dumpToConsole() const
Dumps to console the output from getAsString()
const_iterator find(const KEY &key) const
void getAsString(std::string &s) const
Returns a multi-line string representation of the parameters like : 'nam = val\nnam2 = val2....
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::map< std::string, double > BASE
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
std::string getAsString() const
Returns a multi-line string representation of the parameters like : 'nam = val\nnam2 = val2....
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...
GLsizei const GLchar ** string
T & operator[](const std::string &s)
The write (non-const) version of the [] operator.
TParameters(const char *nam1,...)
Constructor with a list of initial values (see the description and use example in mrpt::system::TPara...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |