JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Component/ParameterDef.H>
A Parameter Definition.
ParameterDef is used to specify the name, description, default value, category, and optionally valid values for a Parameter. The value type of the parameter is specified by template parameter T.
See Specification of sets of valid values, e.g., that some Parameter may take for definitions of specifications for valid values, allowing any value, values from a list, values in a range, values that match a regex, etc.
Definition at line 88 of file ParameterDef.H.
Public Member Functions | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category) | |
Construct a ParameterDef with no given valid values, valid values are whatever T can take. | |
template<template< typename > class ValidValuesSpec> | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category) | |
Create a Parameter definition with specified valid values from a ValidValueSpec. | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, std::vector< T > const &validvalues, ParameterCategory const &category) | |
Shorthand to create a Parameter definition with specified valid values from a list. | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, jevois::Range< T > const &validrange, ParameterCategory const &category) | |
Shorthand to create a Parameter definition with specified valid values from a range (bounds inclusive) | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, jevois::StepRange< T > const &validrange, ParameterCategory const &category) | |
Shorthand to create a Parameter definition with specified valid values from a step range (bounds inclusive) | |
ParameterDef (std::string const &name, std::string const &description, T const &defaultValue, boost::regex const &validregex, ParameterCategory const &category) | |
Shorthand to create a Parameter definition with specified valid values in a regex. | |
T const | defaultValue () const |
Get the default value that was specified for this Parameter definition. | |
virtual std::string const | defaultValueString () const |
Default value in string representation. | |
virtual std::string const | validValuesString () const |
Valid values in string representation. | |
Public Member Functions inherited from jevois::ParameterDefBase | |
ParameterDefBase (std::string const &name, std::string const &description, ParameterCategory const &category=ParameterCategory()) | |
Construct a ParameterDefBase. | |
virtual | ~ParameterDefBase () |
Destructor. | |
std::string const & | name () const |
The parameter name (without the leading "--") | |
std::string const & | description () const |
Description of what the parameter does. | |
ParameterCategory const & | category () const |
The Parameter category. | |
Friends | |
class | ParameterCore< T > |
Additional Inherited Members | |
Protected Attributes inherited from jevois::ParameterDefBase | |
std::string | itsName |
Our name. | |
std::string | itsDescription |
Our description string. | |
ParameterCategory | itsCategory |
Our category. | |
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
ParameterCategory const & | category | ||
) |
Construct a ParameterDef with no given valid values, valid values are whatever T can take.
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
ValidValuesSpec< T > const & | validValuesSpec, | ||
ParameterCategory const & | category | ||
) |
Create a Parameter definition with specified valid values from a ValidValueSpec.
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
std::vector< T > const & | validvalues, | ||
ParameterCategory const & | category | ||
) |
Shorthand to create a Parameter definition with specified valid values from a list.
If your Parameter can only be set to a finite list of values, you can use this convenience constructor to specify them.
For example, if you want to create a Parameter for some kernel convolution for which you only have kernels of sizes 3, 5, 7 and 9 you could create a ParameterDef as follows:
The list of valid values will be shown for this parameter in the help message.
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
jevois::Range< T > const & | validrange, | ||
ParameterCategory const & | category | ||
) |
Shorthand to create a Parameter definition with specified valid values from a range (bounds inclusive)
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
jevois::StepRange< T > const & | validrange, | ||
ParameterCategory const & | category | ||
) |
Shorthand to create a Parameter definition with specified valid values from a step range (bounds inclusive)
jevois::ParameterDef< T >::ParameterDef | ( | std::string const & | name, |
std::string const & | description, | ||
T const & | defaultValue, | ||
boost::regex const & | validregex, | ||
ParameterCategory const & | category | ||
) |
Shorthand to create a Parameter definition with specified valid values in a regex.
This allows for highly flexible valid values definitions. For example, say you want an int parameter to be in range [0..59] but it could also have value 72, your regex would be:
^(([0-5]?[0-9])|72)$
T const jevois::ParameterDef< T >::defaultValue | ( | ) | const |
Get the default value that was specified for this Parameter definition.
|
virtual |
Default value in string representation.
Implements jevois::ParameterDefBase.
|
virtual |
Valid values in string representation.
Implements jevois::ParameterDefBase.
|
friend |
Definition at line 139 of file ParameterDef.H.