JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
|
The concept of parameter in the JeVois framework embodies wrappers around a single value of any type, with associated documentation (description), default values, possible specification of valid values, accessor functions to obtain or change the value, and optional callback functions that are triggered when the value is changed. Parameters are intended to be used in objects that inherit from Component. The goal of parameters is to expose parameters of a given vision algorithm in such a way that any piece of code that is using that algorithm will automatically inherit and expose these parameters.
How to explore this documentation module:
The other classes in this documentation module are mainly for support of the above ones.
JEVOIS_DECLARE_PARAMETER(ParamName, ParamType, ...)
ParamName is the name chosen for the parameter. A new class type will be created with that name, so it must be syntactically correct as a class name. ParamType is the type of the parameter value. The remaining arguments are passed to the constructor of jevois::ParameterDef<T> with T=ParamType.
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(ParamName, ParamType, ...)
ParamName is the name chosen for the parameter. A new class type will be created with that name, so it must be syntactically correct as a class name. ParamType is the type of the parameter value. The remaining arguments are passed to the constructor of jevois::ParameterDef<T> with T=ParamType.
In this version with callback, a pure virtual method is included in the new class that is defined, with the following signature:
The host class (typically, a Component) that inherits from Parameter<ParamName> must implement an override of this function. A compile-time error will be issued if that override has not been implemented.
Classes | |
class | jevois::ParameterSummary |
ParameterSummary provides a summary about a parameter. More... | |
class | jevois::ParameterBase |
Base class for Parameter. More... | |
class | jevois::ParameterCore< T > |
A changeable parameter for a Component, core class. More... | |
class | jevois::Parameter< Param, Tail ... > |
A set of Parameters attached to a component. More... | |
class | jevois::DynamicParameter< T > |
Dynamic parameter added to a component at runtime. More... | |
struct | jevois::ParameterCategory |
A category to which multiple ParameterDef definitions can belong. More... | |
class | jevois::ParameterDefBase |
Base class for a Parameter definition. More... | |
class | jevois::ParameterDef< T > |
A Parameter Definition. More... | |
class | jevois::ParameterRegistry |
A simple registry of all parameters associated with a Component. More... | |
Modules | |
String conversions for Parameter | |
Specification of sets of valid values, e.g., that some Parameter may take | |
This is used by ParameterDef to specify valid values that a Parameter may take as unrestricted, from a given list, in a range, matching a regex, etc. | |
Functions | |
jevois::ParameterBase::ParameterBase () | |
Constructor. More... | |
virtual | jevois::ParameterBase::~ParameterBase () |
Destructor, will remove the parameter from its owner component. More... | |
virtual const std::string & | jevois::ParameterBase::name () const =0 |
Get the parameter name. More... | |
virtual std::string | jevois::ParameterBase::descriptor () const =0 |
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all parents. More... | |
virtual void | jevois::ParameterBase::strset (std::string const &valstring)=0 |
Set the value from a string representation of it. More... | |
virtual const std::string | jevois::ParameterBase::strget () const =0 |
Get the value as a string. More... | |
virtual const ParameterSummary | jevois::ParameterBase::summary () const =0 |
Get summary info about this parameter. More... | |
void | jevois::ParameterBase::freeze () |
Freeze this parameter, it becomes read-only and will not show up in the help message. More... | |
void | jevois::ParameterBase::unFreeze () |
Unfreeze this parameter, it becomes read-write and will show up in the help message. More... | |
void | jevois::ParameterBase::freeze (bool doit) |
Alternate syntax that can be used instead of freeze()/unFreeze(), useful for programmatic freezing. More... | |
virtual void | jevois::ParameterBase::reset ()=0 |
Reset this parameter to its default value. More... | |
Variables | |
std::string | jevois::ParameterSummary::descriptor |
Descriptor. This is the name of the parameter, qualified by a chain of component names. More... | |
std::string | jevois::ParameterSummary::name |
Plain name of the parameter. More... | |
std::string | jevois::ParameterSummary::description |
Description of the parameter. More... | |
std::string | jevois::ParameterSummary::valuetype |
Parameter value type, as a string. More... | |
std::string | jevois::ParameterSummary::defaultvalue |
Default value of the parameter, as a string. More... | |
std::string | jevois::ParameterSummary::value |
Current value of the parameter, as a string. More... | |
std::string | jevois::ParameterSummary::validvalues |
Description of the parameter's valid values specification, as a string. More... | |
std::string | jevois::ParameterSummary::category |
Category of the parameter, as a string. More... | |
std::string | jevois::ParameterSummary::categorydescription |
Category description. More... | |
bool | jevois::ParameterSummary::frozen |
Flag that indicates whether parameter is frozen. More... | |
boost::shared_mutex | jevois::ParameterBase::itsMutex |
Mutex to protect the parameter value. More... | |
volatile bool | jevois::ParameterBase::itsFrozen |
When true, parameter is frozen (read-only, does not show up in help message) More... | |
bool | jevois::ParameterBase::itsVirgin |
Param has not yet been explicitly set, need to call the callback (if any) at init time. More... | |
Friends | |
class | jevois::ParameterBase::ParameterRegistry |
|
pure virtual |
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all parents.
Implemented in jevois::ParameterCore< T >.
void jevois::ParameterBase::freeze | ( | ) |
Freeze this parameter, it becomes read-only and will not show up in the help message.
Referenced by jevois::Component::freezeParam().
void jevois::ParameterBase::freeze | ( | bool | doit | ) |
Alternate syntax that can be used instead of freeze()/unFreeze(), useful for programmatic freezing.
|
pure virtual |
Get the parameter name.
Implemented in jevois::ParameterCore< T >.
Referenced by jevois::ParameterRegistry::addParameter(), and jevois::ParameterRegistry::removeParameter().
jevois::ParameterBase::ParameterBase | ( | ) |
Constructor.
|
pure virtual |
Reset this parameter to its default value.
Implemented in jevois::ParameterCore< T >.
|
pure virtual |
Get the value as a string.
Implemented in jevois::ParameterCore< T >.
Referenced by jevois::Component::getParamString().
|
pure virtual |
Set the value from a string representation of it.
std::range_error | if the given string cannot be converted to a Parameter value, or the value is invalid according to our valid values spec or rejected by the Parameter's callback (if any). |
Implemented in jevois::ParameterCore< T >.
Referenced by jevois::Component::setParamString().
|
pure virtual |
Get summary info about this parameter.
Implemented in jevois::ParameterCore< T >.
Referenced by jevois::GUIhelper::drawParameters().
void jevois::ParameterBase::unFreeze | ( | ) |
Unfreeze this parameter, it becomes read-write and will show up in the help message.
Referenced by jevois::Component::unFreezeParam().
|
virtual |
Destructor, will remove the parameter from its owner component.
std::string jevois::ParameterSummary::category |
Category of the parameter, as a string.
Definition at line 108 of file Parameter.H.
Referenced by jevois::GUIhelper::drawParameters(), and jevois::Component::paramInfo().
std::string jevois::ParameterSummary::categorydescription |
Category description.
Definition at line 111 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
std::string jevois::ParameterSummary::defaultvalue |
Default value of the parameter, as a string.
Definition at line 99 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
std::string jevois::ParameterSummary::description |
Description of the parameter.
Definition at line 93 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
std::string jevois::ParameterSummary::descriptor |
Descriptor. This is the name of the parameter, qualified by a chain of component names.
Definition at line 87 of file Parameter.H.
bool jevois::ParameterSummary::frozen |
Flag that indicates whether parameter is frozen.
Definition at line 114 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
|
protected |
When true, parameter is frozen (read-only, does not show up in help message)
Definition at line 161 of file Parameter.H.
|
mutableprotected |
Mutex to protect the parameter value.
Definition at line 160 of file Parameter.H.
|
protected |
Param has not yet been explicitly set, need to call the callback (if any) at init time.
Definition at line 162 of file Parameter.H.
std::string jevois::ParameterSummary::name |
Plain name of the parameter.
Definition at line 90 of file Parameter.H.
Referenced by jevois::GUIhelper::drawParameters(), and jevois::Component::paramInfo().
std::string jevois::ParameterSummary::validvalues |
Description of the parameter's valid values specification, as a string.
Definition at line 105 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
std::string jevois::ParameterSummary::value |
Current value of the parameter, as a string.
Definition at line 102 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
std::string jevois::ParameterSummary::valuetype |
Parameter value type, as a string.
Definition at line 96 of file Parameter.H.
Referenced by jevois::Component::paramInfo().
|
friend |
Definition at line 165 of file Parameter.H.