Go to the documentation of this file.
10 #ifndef mrpt_utils_parameters_H
11 #define mrpt_utils_parameters_H
48 typedef std::map<std::string,T>
BASE;
59 BASE::operator[](std::string(nam1)) = val;
63 nam = va_arg(args,
const char*);
66 BASE::operator[](std::string(nam)) = val;
78 throw std::logic_error(std::string(
"Parameter '")+s+std::string(
"' is not present.").c_str());
87 else return it->second;
90 inline T &
operator[](
const std::string &s) {
return BASE::operator[](s); }
100 size_t maxStrLen = 10;
103 std::stringstream str;
105 str << it->first << std::string(maxStrLen-it->first.size(),
' ') <<
" = " << it->second << std::endl;
EIGEN_STRONG_INLINE iterator begin()
void dumpToConsole() const
Dumps to console the output from getAsString()
T & operator[](const std::string &s)
The write (non-const) version of the [] operator.
bool has(const std::string &s) const
EIGEN_STRONG_INLINE iterator end()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TParameters()
Default constructor (initializes empty)
const typedef Scalar * const_iterator
TParameters< double > TParametersDouble
See the generic template mrpt::utils::TParameters.
TParameters(const char *nam1,...)
Constructor with a list of initial values (see the description and use example in mrpt::utils::TParam...
T operator[](const std::string &s) const
A const version of the [] operator, for usage as read-only.
TParameters< std::string > TParametersString
See the generic template mrpt::utils::TParameters.
std::map< std::string, T > BASE
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
void getAsString(std::string &s) const
Returns a multi-like string representation of the parameters like : 'nam = val\nnam2 = val2....
std::string getAsString() const
Returns a multi-like 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...
Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Sat Jan 18 22:37:07 UTC 2020 | | |