31 #if defined(Parameters_RECURSES)
32 #error Recursive header files inclusion detected in Parameters.h
33 #else // defined(Parameters_RECURSES)
35 #define Parameters_RECURSES
37 #if !defined Parameters_h
47 #include "DGtal/base/Common.h"
55 template <
typename X,
typename Y>
58 static Y
cast(
const X& value )
61 &&
"[ValueConverter<X,Y>::cast] there is no such generic type converter." );
69 static double cast(
const std::string& value )
73 std::istringstream iss( value );
82 static float cast(
const std::string& value )
86 std::istringstream iss( value );
95 static int cast(
const std::string& value )
99 std::istringstream iss( value );
105 template <
typename X >
107 static std::string
cast(
const X& value )
109 std::ostringstream ss;
126 template <
typename X>
128 template <
typename T>
176 bool count( std::string name )
const;
215 #include "DGtal/helpers/Parameters.ih"
220 #endif // !defined Parameters_h
222 #undef Parameters_RECURSES
223 #endif // else defined(Parameters_RECURSES)
static std::string cast(const X &value)
static float cast(const std::string &value)
void selfDisplay(std::ostream &out) const
ParameterValue operator[](std::string name) const
Parameters()=default
Default constructor.
Self operator|(const Self &other) const
bool count(std::string name) const
Self & operator=(const Self &v)=default
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Self & operator()(std::string name, ParameterValue pv=ParameterValue())
~Parameters()=default
Default destructor.
Generic definition of a class for converting type X toward type Y.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::map< std::string, ParameterValue > myParameters
void selfDisplay(std::ostream &out) const
static int cast(const std::string &value)
Parameters Self
The type of *this.
Self & operator=(const Self &other)=default
Default assignment operator.
static double cast(const std::string &value)
static Y cast(const X &value)
By default, it is impossible to do such conversions.