JeVois  1.3
JeVois Smart Embedded Machine Vision Toolkit
Share this page:

#include <jevois/Component/ParameterDef.H>

template<class T>
class jevois::ParameterDef< T >

A Parameter Definition.

ParameterDef is used to specify the name, description, default value, category, and optionally valid values for a Parameter. The value tye 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.

Inheritance diagram for jevois::ParameterDef< T >:
Collaboration diagram for jevois::ParameterDef< T >:

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. More...
 
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. More...
 
 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. More...
 
 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) More...
 
 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) More...
 
 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. More...
 
T const defaultValue () const
 Get the default value that was specified for this Parameter definition. More...
 
virtual std::string const defaultValueString () const
 Default value in string representation. More...
 
virtual std::string const validValuesString () const
 Valid values in string representation. More...
 
- Public Member Functions inherited from jevois::ParameterDefBase
 ParameterDefBase (std::string const &name, std::string const &description, ParameterCategory const &category=ParameterCategory())
 Construct a ParameterDefBase. More...
 
virtual ~ParameterDefBase ()
 Destructor. More...
 
std::string const & name () const
 The parameter name (without the leading "--") More...
 
std::string const & description () const
 Description of what the parameter does. More...
 
ParameterCategory const & category () const
 The Parameter category. More...
 

Friends

class ParameterCore< T >
 

Additional Inherited Members

- Protected Attributes inherited from jevois::ParameterDefBase
std::string itsName
 Our name. More...
 
std::string itsDescription
 Our description string. More...
 
ParameterCategory itsCategory
 Our category. More...
 

Constructor & Destructor Documentation

template<class T >
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
jevois::ParameterCategory const &  category 
)
inline

Construct a ParameterDef with no given valid values, valid values are whatever T can take.

Definition at line 71 of file ParameterDefImpl.H.

template<class T >
template<template< typename > class ValidValuesSpec>
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
ValidValuesSpec< T > const &  validValuesSpec,
jevois::ParameterCategory const &  category 
)
inline

Create a Parameter definition with specified valid values from a ValidValueSpec.

Definition at line 79 of file ParameterDefImpl.H.

template<class T >
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
std::vector< T > const &  validvalues,
jevois::ParameterCategory const &  category 
)
inline

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:

ParameterDef<int> KernelSizeDef("kernel_size", "The size of the convolution kernel", 3, { 3, 5, 7, 9} );

The list of valid values will be shown for this parameter in the help message.

Definition at line 90 of file ParameterDefImpl.H.

template<class T >
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
jevois::Range< T > const &  validrange,
jevois::ParameterCategory const &  category 
)
inline

Shorthand to create a Parameter definition with specified valid values from a range (bounds inclusive)

Definition at line 100 of file ParameterDefImpl.H.

template<class T >
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
jevois::StepRange< T > const &  validrange,
jevois::ParameterCategory const &  category 
)
inline

Shorthand to create a Parameter definition with specified valid values from a step range (bounds inclusive)

Definition at line 110 of file ParameterDefImpl.H.

template<class T >
jevois::ParameterDef< T >::ParameterDef ( std::string const &  name,
std::string const &  description,
T const &  defaultValue,
boost::regex const &  validregex,
jevois::ParameterCategory const &  category 
)
inline

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)$

Definition at line 121 of file ParameterDefImpl.H.

Member Function Documentation

template<class T >
T const jevois::ParameterDef< T >::defaultValue ( ) const
inline

Get the default value that was specified for this Parameter definition.

Definition at line 146 of file ParameterDefImpl.H.

Referenced by jevois::ParameterCore< T >::changeParameterDef().

template<class T >
std::string const jevois::ParameterDef< T >::defaultValueString ( ) const
inlinevirtual

Default value in string representation.

Implements jevois::ParameterDefBase.

Definition at line 151 of file ParameterDefImpl.H.

References jevois::detail::paramStringFromVal().

template<class T >
std::string const jevois::ParameterDef< T >::validValuesString ( ) const
inlinevirtual

Valid values in string representation.

Implements jevois::ParameterDefBase.

Definition at line 156 of file ParameterDefImpl.H.

Friends And Related Function Documentation

template<class T>
friend class ParameterCore< T >
friend

Definition at line 142 of file ParameterDef.H.


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