MRPT
1.9.9
|
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
A default list of parameters can be passed to the constructor as a sequence of pairs "name, value", which MUST end in a nullptr name string. Names MUST BE "const char*" (that is, "old plain strings" are OK), not std::string objects!. See this example:
VERY IMPORTANT: If you use the NULL-ended constructor above, make sure all the values are of the proper type or it will crash in runtime. For example, in a TParametersDouble all values must be double's, so if you type "10" the compiler will make it an "int". Instead, write "10.0".
Definition at line 54 of file TParameters.h.
#include <mrpt/system/TParameters.h>
Public Types | |
using | BASE = std::map< std::string, T > |
Public Member Functions | |
TParameters () | |
Default constructor (initializes empty) More... | |
TParameters (const char *nam1,...) | |
Constructor with a list of initial values (see the description and use example in mrpt::system::TParameters) More... | |
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. More... | |
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 usage as read-only). More... | |
T & | operator[] (const std::string &s) |
The write (non-const) version of the [] operator. More... | |
void | dumpToConsole () const |
Dumps to console the output from getAsString() More... | |
std::string | getAsString () const |
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'. More... | |
void | getAsString (std::string &s) const |
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'. More... | |
Public Attributes | |
K | keys |
STL member. More... | |
T | elements |
STL member. More... | |
using mrpt::system::TParameters< T >::BASE = std::map<std::string, T> |
Definition at line 56 of file TParameters.h.
|
inline |
Default constructor (initializes empty)
Definition at line 58 of file TParameters.h.
|
inline |
Constructor with a list of initial values (see the description and use example in mrpt::system::TParameters)
Definition at line 61 of file TParameters.h.
|
inline |
Dumps to console the output from getAsString()
Definition at line 114 of file TParameters.h.
|
inline |
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'.
Definition at line 121 of file TParameters.h.
Referenced by mrpt::system::TParameters< double >::dumpToConsole(), and mrpt::system::TParameters< double >::getAsString().
|
inline |
Returns a multi-line string representation of the parameters like : 'nam = val = val2...'.
Definition at line 130 of file TParameters.h.
|
inline |
A const version of the [] operator and with a default value in case the parameter is not set (for usage as read-only).
Definition at line 103 of file TParameters.h.
Referenced by mrpt::vision::bundle_adj_full(), mrpt::graphs::detail::CVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdgeRelPoses(), mrpt::graphs::detail::CVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdges(), mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdges(), mrpt::graphs::detail::CVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodeCorners(), mrpt::graphs::detail::CVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodePoints(), mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodePoints(), mrpt::graphs::detail::CVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::getAs3DObject(), and mrpt::opengl::graph_tools::graph_visualize().
|
inline |
Definition at line 83 of file TParameters.h.
Referenced by mrpt::comms::net::http_request().
|
inline |
A const version of the [] operator, for usage as read-only.
std::logic_error | On parameter not present. Please, check existence with "has" before reading. |
Definition at line 91 of file TParameters.h.
|
inline |
The write (non-const) version of the [] operator.
Definition at line 112 of file TParameters.h.
|
inherited |
STL member.
|
inherited |
STL member.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020 |