ompl::base::SpecificParam< T > Class Template Reference

This is a helper class that instantiates parameters with different data types. More...

#include <ompl/base/GenericParam.h>

Inheritance diagram for ompl::base::SpecificParam< T >:

Public Types

typedef std::function< void(T)> SetterFn
 The type for the 'setter' function for this parameter.
 
typedef std::function< T()> GetterFn
 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.
 
template<>
std::string getValue () const
 Retrieve the value of the parameter, as a string.
 
template<>
std::string getValue () const
 Retrieve the value of the parameter, as a string.
 
- Public Member Functions inherited from ompl::base::GenericParam
 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 >
GenericParamoperator= (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

lexical_cast (const std::string &value) const
 Helper function to convert strings into objects of type T. More...
 
template<>
bool lexical_cast (const std::string &value) const
 
template<>
int lexical_cast (const std::string &value) const
 
template<>
long lexical_cast (const std::string &value) const
 
template<>
long long lexical_cast (const std::string &value) const
 
template<>
unsigned int lexical_cast (const std::string &value) const
 
template<>
unsigned long lexical_cast (const std::string &value) const
 
template<>
unsigned long long lexical_cast (const std::string &value) const
 
template<>
float lexical_cast (const std::string &value) const
 
template<>
double lexical_cast (const std::string &value) const
 
template<>
long double lexical_cast (const std::string &value) const
 
template<>
char lexical_cast (const std::string &value) const
 
template<>
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.
 
- Protected Attributes inherited from ompl::base::GenericParam
std::string name_
 The name of the parameter.
 
std::string rangeSuggestion_
 Suggested range for the parameter. More...
 

Detailed Description

template<typename T>
class ompl::base::SpecificParam< T >

This is a helper class that instantiates parameters with different data types.

Definition at line 134 of file GenericParam.h.

Member Function Documentation

◆ lexical_cast()

template<typename T>
T ompl::base::SpecificParam< T >::lexical_cast ( const std::string &  value) const
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.


The documentation for this class was generated from the following file: