This is a helper class that instantiates parameters with different data types. More...
#include <ompl/base/GenericParam.h>

Public Types | |
using | SetterFn = std::function<void(T)> |
The type for the 'setter' function for this parameter. | |
using | GetterFn = std::function<T()> |
The type for the 'getter' function for this parameter. | |
Public Member Functions | |
SpecificParam (const std::string &name, SetterFn setter, GetterFn getter=GetterFn()) | |
An explicit instantiation of a parameter name requires the setter function and optionally the getter function. | |
bool | setValue (const std::string &value) override |
Set the value of the parameter. The value is taken in as a string, but converted to the type of that parameter. | |
std::string | getValue () const override |
Retrieve the value of the parameter, as a string. | |
std::string | getValue () const |
Retrieve the value of the parameter, as a string. | |
std::string | getValue () const |
Retrieve the value of the parameter, as a string. | |
std::string | getValue () const |
Retrieve the value of the parameter, as a string. | |
std::string | getValue () const |
Retrieve the value of the parameter, as a string. | |
![]() | |
GenericParam (std::string name) | |
The constructor of a parameter takes the name of the parameter (name) | |
const std::string & | getName () const |
Get the name of the parameter. | |
void | setName (const std::string &name) |
Set the name of the parameter. | |
template<typename T> | |
GenericParam & | operator= (const T &value) |
Assignment operator by type. This is just for convenience, as it just calls setValue() | |
void | setRangeSuggestion (const std::string &rangeSuggestion) |
Set a suggested range. | |
const std::string & | getRangeSuggestion () const |
Get the suggested range of values. | |
Protected Member Functions | |
T | lexical_cast (const std::string &value) const |
Helper function to convert strings into objects of type T. | |
bool | lexical_cast (const std::string &value) const |
int | lexical_cast (const std::string &value) const |
long | lexical_cast (const std::string &value) const |
long long | lexical_cast (const std::string &value) const |
unsigned int | lexical_cast (const std::string &value) const |
unsigned long | lexical_cast (const std::string &value) const |
unsigned long long | lexical_cast (const std::string &value) const |
float | lexical_cast (const std::string &value) const |
double | lexical_cast (const std::string &value) const |
long double | lexical_cast (const std::string &value) const |
char | lexical_cast (const std::string &value) const |
std::string | lexical_cast (const std::string &value) const |
Protected Attributes | |
SetterFn | setter_ |
The setter function for this parameter. | |
GetterFn | getter_ |
The getter function for this parameter. | |
![]() | |
std::string | name_ |
The name of the parameter. | |
std::string | rangeSuggestion_ |
Suggested range for the parameter. | |
Detailed Description
class ompl::base::SpecificParam< T >
This is a helper class that instantiates parameters with different data types.
Definition at line 136 of file GenericParam.h.
Member Typedef Documentation
◆ GetterFn
using ompl::base::SpecificParam< T >::GetterFn = std::function<T()> |
The type for the 'getter' function for this parameter.
Definition at line 143 of file GenericParam.h.
◆ SetterFn
using ompl::base::SpecificParam< T >::SetterFn = std::function<void(T)> |
The type for the 'setter' function for this parameter.
Definition at line 140 of file GenericParam.h.
Constructor & Destructor Documentation
◆ SpecificParam()
|
inline |
An explicit instantiation of a parameter name requires the setter function and optionally the getter function.
Definition at line 148 of file GenericParam.h.
Member Function Documentation
◆ getValue() [1/5]
|
inlinevirtual |
Retrieve the value of the parameter, as a string.
Implements ompl::base::GenericParam.
Definition at line 199 of file GenericParam.h.
◆ getValue() [2/5]
|
inlinevirtual |
Retrieve the value of the parameter, as a string.
Implements ompl::base::GenericParam.
Definition at line 204 of file GenericParam.h.
◆ getValue() [3/5]
|
inlinevirtual |
Retrieve the value of the parameter, as a string.
Implements ompl::base::GenericParam.
Definition at line 209 of file GenericParam.h.
◆ getValue() [4/5]
|
inlinevirtual |
Retrieve the value of the parameter, as a string.
Implements ompl::base::GenericParam.
Definition at line 214 of file GenericParam.h.
◆ getValue() [5/5]
|
inlineoverridevirtual |
Retrieve the value of the parameter, as a string.
Implements ompl::base::GenericParam.
Definition at line 178 of file GenericParam.h.
◆ lexical_cast() [1/13]
|
protected |
Helper function to convert strings into objects of type T.
Supported types are: bool, int, long, long long, unsigned int, unsigned long, unsigned long long, float, double, long double, char, std::string.
◆ lexical_cast() [2/13]
|
protected |
Definition at line 46 of file GenericParam.cpp.
◆ lexical_cast() [3/13]
|
protected |
Definition at line 52 of file GenericParam.cpp.
◆ lexical_cast() [4/13]
|
protected |
Definition at line 57 of file GenericParam.cpp.
◆ lexical_cast() [5/13]
|
protected |
Definition at line 62 of file GenericParam.cpp.
◆ lexical_cast() [6/13]
|
protected |
Definition at line 67 of file GenericParam.cpp.
◆ lexical_cast() [7/13]
|
protected |
Definition at line 72 of file GenericParam.cpp.
◆ lexical_cast() [8/13]
|
protected |
Definition at line 77 of file GenericParam.cpp.
◆ lexical_cast() [9/13]
|
protected |
Definition at line 82 of file GenericParam.cpp.
◆ lexical_cast() [10/13]
|
protected |
Definition at line 87 of file GenericParam.cpp.
◆ lexical_cast() [11/13]
|
protected |
Definition at line 92 of file GenericParam.cpp.
◆ lexical_cast() [12/13]
|
protected |
Definition at line 97 of file GenericParam.cpp.
◆ lexical_cast() [13/13]
|
protected |
Definition at line 106 of file GenericParam.cpp.
◆ setValue()
|
inlineoverridevirtual |
Set the value of the parameter. The value is taken in as a string, but converted to the type of that parameter.
Implements ompl::base::GenericParam.
Definition at line 157 of file GenericParam.h.
Member Data Documentation
◆ getter_
|
protected |
The getter function for this parameter.
Definition at line 195 of file GenericParam.h.
◆ setter_
|
protected |
The setter function for this parameter.
Definition at line 192 of file GenericParam.h.
The documentation for this class was generated from the following file:
- ompl/base/GenericParam.h