7.8.5. Parameters - Meta Information¶
Every parameter of type ito::Param can contain meta information that describe some boundary values, value ranges, allowed values… of the parameter. Once a parameter has its valid meta information, itom is able to check given input values with respect to the meta information as well as adapt any auto-created input masks to simplify the input with respect to the given constraints.
Most possible types of class ito::Param have their respective meta information structure.
The base class of all kind of meta information classes is the class ito::ParamMeta. Any instance of class ito::ParamMeta can contain a pointer to an instance of this base class. If you know the type of parameter (e.g. char, string or int), you can savely cast this ito::ParamMeta base instance to the right meta information class that fits to the type.
7.8.5.1. Class ParamMeta¶
The class ParamMeta is the base class for all meta information classes. Parameters of class Param may contain pointers of that class, which then must be cast to the final implementation.
-
class
ito
::
ParamMeta
¶ Base class for all meta-information classes.
Parameters of type ito::Param can have a pointer to this class. Consider this base class to be abstract, such that it is only allowed to pass the right implementation (derived from this class) that fits to the type of the parameter. The runtime type information value m_type indicates the real type of this pointer, such that a direct cast can be executed.
- See
ito::CharMeta, ito::IntMeta, ito::DoubleMeta, ito::StringMeta, ito::HWMeta, ito::DObjMeta, ito::CharArrayMeta, ito::IntArrayMeta, ito::DoubleArrayMeta
Subclassed by ito::CharMeta, ito::DObjMeta, ito::DoubleMeta, ito::HWMeta, ito::IntMeta, ito::RectMeta, ito::StringMeta
Public Types
-
enum
MetaRtti
¶ Runtime type information.
MetaRtti is used to cast param meta objects, without having to enable runtime type information of the compiler.
Values:
-
enumerator
rttiUnknown
¶ unknown parameter
-
enumerator
rttiCharMeta
¶ meta for a char parameter
-
enumerator
rttiIntMeta
¶ meta for an integer parameter
-
enumerator
rttiDoubleMeta
¶ meta for a double parameter
-
enumerator
rttiStringMeta
¶ meta for a string parameter
-
enumerator
rttiHWMeta
¶ meta for a hardware plugin parameter
-
enumerator
rttiDObjMeta
¶ meta for a data object parameter
-
enumerator
rttiIntArrayMeta
¶ meta for an integer array parameter
-
enumerator
rttiDoubleArrayMeta
¶ meta for a double array parameter
-
enumerator
rttiCharArrayMeta
¶ meta for a char array parameter
-
enumerator
rttiIntervalMeta
¶ meta for an integer array with two values that represent an interval [value1, value2] parameter
-
enumerator
rttiDoubleIntervalMeta
¶ meta for a double array with two values that represent an interval [value1, value2] parameter (size of the interval is value2-value1)
-
enumerator
rttiRangeMeta
¶ meta for an integer array with two values that represent a range [value1, value2] parameter (size of a range is 1+value2-value1)
-
enumerator
rttiRectMeta
¶ meta for an integer array with four values that consists of two ranges (vertical and horizontal, e.g. for ROIs of cameras)
-
enumerator
-
enum
tRepresentation
¶ The representation of number types indicates the type of widget that is suited best to display and change the value.
Not all representations can be applied to all types of number values, e.g. IPV4 can not be used for char-types. e.g. - Char, CharArray: Linear, Boolean, Logarithmic, PureNumber
IntegerArray, Range, Interval: Linear, Boolean, Logarithmic, PureNumber
Integer: Linear, Boolean, Logarithmic, PureNumber, HexNumber, IPV4Address, MACAddress
Double, DoubleArray: Linear, Boolean, Logarithmic, PureNumber
Values:
-
enumerator
Linear
¶ Slider with linear behavior.
-
enumerator
Logarithmic
¶ Slider with logarithmic behaviour.
-
enumerator
Boolean
¶ Check box.
-
enumerator
PureNumber
¶ Decimal number in an edit control.
-
enumerator
HexNumber
¶ Hex number in an edit control.
-
enumerator
IPV4Address
¶ IP-Address.
-
enumerator
MACAddress
¶ MAC-Address.
-
enumerator
UnknownRepresentation
¶
Public Functions
-
ParamMeta
(ito::ByteArray category = ito::ByteArray())¶ default constructor with an unknown meta information type
-
ParamMeta
(MetaRtti type, ito::ByteArray category = ito::ByteArray())¶ constructor used by derived classes to indicate their real type
-
inline virtual
~ParamMeta
()¶ destructor
-
inline ito::ByteArray
getCategory
() const¶ returns category name of this parameter (default: empty ByteArray)
7.8.5.2. Class CharMeta, IntMeta and DoubleMeta¶
The classes CharMeta, IntMeta and DoubleMeta provide meta information for parameters of single numeric types.
-
class
ito
::
CharMeta
: public ito::ParamMeta¶ meta-information for Param of type Char.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::Char. If set, the given char number can be limited with respect to given minimum and maximum values as well as an optional step size (default: 1).
Subclassed by ito::CharArrayMeta
Public Functions
-
explicit
CharMeta
(char minVal, char maxVal, char stepSize = 1, ito::ByteArray category = ito::ByteArray())¶ constructor with minimum and maximum value
constructor with minimum and maximum value as well as optional step size (default: 1)
-
inline char
getMin
() const¶ returns minimum value
-
inline char
getMax
() const¶ returns maximum value
-
inline char
getStepSize
() const¶ returns step size
-
inline ito::ByteArray
getUnit
() const¶ returns unit
-
inline void
setUnit
(const ito::ByteArray &unit)¶ sets unit string of this parameter
-
inline ParamMeta::tRepresentation
getRepresentation
() const¶ returns display representation
-
void
setRepresentation
(ParamMeta::tRepresentation representation)¶ sets display representation
-
void
setMin
(char val)¶ sets the minimum value
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setMax
(char val)¶ sets the maximum value
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setStepSize
(char val)¶ sets the step size
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
-
explicit
-
class
ito
::
IntMeta
: public ito::ParamMeta¶ Meta-information for Param of type Int.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::Int. If set, the given integer number can be limited with respect to given minimum and maximum values as well as an optional step size (default: 1).
Subclassed by ito::IntArrayMeta, ito::IntervalMeta
Public Functions
-
explicit
IntMeta
(int32 minVal, int32 maxVal, int32 stepSize = 1, ito::ByteArray category = ito::ByteArray())¶ constructor with minimum and maximum value as well as optional step size (default: 1)
-
inline int32
getMin
() const¶ returns minimum value
-
inline int32
getMax
() const¶ returns maximum value
-
inline int32
getStepSize
() const¶ returns step size
-
inline ito::ByteArray
getUnit
() const¶ returns unit
-
inline void
setUnit
(const ito::ByteArray &unit)¶ sets unit string of this parameter
-
inline ParamMeta::tRepresentation
getRepresentation
() const¶ returns display representation
-
void
setRepresentation
(ParamMeta::tRepresentation behaviour)¶ sets display representation
-
void
setMin
(int32 val)¶ sets the minimum value
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setMax
(int32 val)¶ sets the maximum value
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setStepSize
(int32 val)¶ sets the step size
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
-
explicit
-
class
ito
::
DoubleMeta
: public ito::ParamMeta¶ Meta-information for ito::Param of type Double.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::Double. If set, the given double number can be limited with respect to given minimum and maximum values as well as an optional step size (default: 0.0 -> no step size).
Subclassed by ito::DoubleArrayMeta, ito::DoubleIntervalMeta
Public Types
-
enum
tDisplayNotation
¶ Display notation style if the related parameters is displayed in any widget.
Values:
-
enumerator
Automatic
¶ double number is automatically rendered in any GUI element
-
enumerator
Fixed
¶ if possible, the double number should be shown as fixed number, e.g. 1000.00
-
enumerator
Scientific
¶ if possible, the double number should be rendered in a scientific notation, e.g. 1.0E3
-
enumerator
Public Functions
-
explicit
DoubleMeta
(float64 minVal, float64 maxVal, float64 stepSize = 0.0, ito::ByteArray category = ito::ByteArray())¶ constructor with minimum and maximum value
-
inline float64
getMin
() const¶ returns minimum value
-
inline float64
getMax
() const¶ returns maximum value
-
inline float64
getStepSize
() const¶ returns step size
-
inline ito::ByteArray
getUnit
() const¶ returns unit
-
inline void
setUnit
(const ito::ByteArray &unit)¶ sets unit string of this parameter
-
inline int
getDisplayPrecision
() const¶ returns display precision
-
inline void
setDisplayPrecision
(int displayPrecision)¶ sets display precision
-
inline DoubleMeta::tDisplayNotation
getDisplayNotation
() const¶ returns display notation
-
inline void
setDisplayNotation
(DoubleMeta::tDisplayNotation displayNotation)¶ sets display notation
-
inline ParamMeta::tRepresentation
getRepresentation
() const¶ returns display representation
-
void
setRepresentation
(ParamMeta::tRepresentation representation)¶ sets display representation
-
void
setMin
(float64 val)¶ sets the minimum value
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setMax
(float64 val)¶ sets the maximum value
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setStepSize
(float64 val)¶ sets the step size
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
Public Static Functions
-
static DoubleMeta *
all
(ito::ByteArray category = ito::ByteArray())¶ returns a new instance of DoubleMeta, where the min and max are set to the full range available for double. The caller has to take care of memory.
-
enum
7.8.5.3. Class CharArrayMeta, IntArrayMeta and DoubleArrayMeta¶
The classes CharArrayMeta, IntArrayMeta and DoubleArrayMeta provide meta information for array-based parameters of numeric types. These classes are derived from CharArray, IntArray or DoubleArray, such that the minimum and maximum value as well as the step size for each single value is given by the features of their base class. Additionally, it is possible to set a min, max and stepSize constraint concerning the number of elements of the arrays.
-
class
ito
::
CharArrayMeta
: public ito::CharMeta¶ Meta-information for Param of type CharArrayMeta.
Meta-information for Param of type IntArrayMeta.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::CharArray. Since this meta information class is derived from ito::CharMeta, it is possible to restrict each value to the single value contraints of ito::CharMeta. Furthermore, this class allows restricting the minimum and maximum length of the array as well as the optional step size of the array’s length.
An object of this class can be used to parametrize a parameter whose type is
ito::ParamBase::IntArray. Since this meta information class is derived from ito::IntMeta, it is possible to restrict each value to the single value contraints of ito::IntMeta. Furthermore, this class allows restricting the minimum and maximum length of the array as well as the optional step size of the array’s length.- See
ito::Param, ito::ParamMeta, ito::IntArray
Public Functions
-
inline size_t
getNumMin
() const¶ returns minimum number of values
-
inline size_t
getNumMax
() const¶ returns maximum number of values
-
inline size_t
getNumStepSize
() const¶ returns step size of number of values
-
void
setNumMin
(size_t val)¶ sets the minimum number of values
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setNumMax
(size_t val)¶ sets the maximum number of values
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setNumStepSize
(size_t val)¶ sets the step size of the number of values
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
-
class
ito
::
IntArrayMeta
: public ito::IntMeta¶ Public Functions
-
inline size_t
getNumMin
() const¶ returns minimum number of values
-
inline size_t
getNumMax
() const¶ returns maximum number of values
-
inline size_t
getNumStepSize
() const¶ returns step size of number of values
-
void
setNumMin
(size_t val)¶ sets the minimum number of values
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setNumMax
(size_t val)¶ sets the maximum number of values
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setNumStepSize
(size_t val)¶ sets the step size of the number of values
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
-
inline size_t
-
class
ito
::
DoubleArrayMeta
: public ito::DoubleMeta¶ Meta-information for Param of type DoubleArrayMeta.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::DoubleArray. Since this meta information class is derived from ito::DoubleArray, it is possible to restrict each value to the single value contraints of ito::DoubleArray. Furthermore, this class allows restricting the minimum and maximum length of the array as well as the optional step size of the array’s length.
Public Functions
-
inline size_t
getNumMin
() const¶ returns minimum number of values
-
inline size_t
getNumMax
() const¶ returns maximum number of values
-
inline size_t
getNumStepSize
() const¶ returns step size of number of values
-
void
setNumMin
(size_t val)¶ sets the minimum number of values
- Parameters
val
: is the new minimum value, if this is bigger than the current maximum value, the maximum value is changed to val, too
-
void
setNumMax
(size_t val)¶ sets the maximum number of values
- Parameters
val
: is the new maximum value, if this is smaller than the current minimum value, the minimum value is changed to val, too
-
void
setNumStepSize
(size_t val)¶ sets the step size of the number of values
- Parameters
val
: is the new step size, hence only discrete values [minVal, minVal+stepSize, minVal+2*stepSize…,maxVal] are allowed
-
inline size_t
7.8.5.4. Class StringMeta¶
By this meta information you can give information about restrictions of strings to different strings. These strings can be interpreted as pure strings, as wildcard-expressions or regular expressions. The corresponding checks must be defined manually. If a string-parameter has an enumeration defined, where the strings are interpreted as strings, and if this parameter will automatically be parsed by any input mask in the GUI, the corresponding input text box becomes a drop-down menu with the given enumeration elements.
-
class
ito
::
StringMeta
: public ito::ParamMeta¶ Meta-information for Param of type String.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::String. If set, it is possible to restrict the a given string to fit to a given list of strings. This list of strings might be interpreted in an exact way (tType::String), as wildcard expressions (tType::Wildcard) or as regular expressions (tType::RegExp).
Public Functions
-
StringMeta
(tType type, ito::ByteArray category = ito::ByteArray())¶ constructor
Returns a meta information class for string-types.
- See
tType
- Parameters
type
: indicates how the string elements should be considered
-
StringMeta
(tType type, const char *val, ito::ByteArray category = ito::ByteArray())¶ constructor
Returns a meta information class for string-types.
- See
tType
- Parameters
type
: indicates how the string elements should be consideredval
: adds a first string to the element list
-
StringMeta
(tType type, const ito::ByteArray &val, ito::ByteArray category = ito::ByteArray())¶ constructor
Returns a meta information class for string-types.
- See
tType
- Parameters
type
: indicates how the string elements should be consideredval
: adds a first string to the element list
-
StringMeta
(const StringMeta &cpy)¶ copy constructor
-
virtual
~StringMeta
()¶ destructor
-
tType
getStringType
() const¶ returns the type how strings in list should be considered.
- See
tType
-
void
setStringType
(tType type)¶ sets the type how strings in pattern list should be considered.
- See
tType
-
int
getLen
() const¶ returns the number of string elements in meta information class.
-
const char *
getString
(int idx = 0) const¶ returns string from list at index position or NULL, if index is out of range.
-
bool
addItem
(const char *val)¶ adds another element to the list of patterns.
-
bool
addItem
(const ito::ByteArray &val)¶ adds another element to the list of patterns.
-
void
clearItems
()¶ clear all elements from the pattern list.
-
StringMeta &
operator+=
(const char *val)¶ add another pattern string to the list of patterns.
-
7.8.5.5. Class DObjMeta¶
This meta information class provides further information about allowed types and boundaries concerning the dimension of a data object.
7.8.5.6. Class HWMeta¶
By that implementation of a meta information class you can provide information about references to other instantiated plugins. Every plugin is defined by a bitmask of enumeration ito::tPluginType (defined in addInActuator.h). You can either add a minimum bitmask, that is required, to the HWMeta-instance or you can define an exact name of a plugin, which must be met.
-
class
ito
::
HWMeta
: public ito::ParamMeta¶ Meta-information for Param of type HWPtr.
An object of this class can be used to parametrize a parameter whose type is ito::ParamBase::HWPtr, that is an instance of another hardware plugin. If set, it is possible to restrict the given hardware plugin to a specific type (e.g. dataIO, dataIO + grabber, actuator…) and/or to limit it to a specific name of the plugin (e.g. SerialIO).
Public Functions
-
inline explicit
HWMeta
(uint32 minType, ito::ByteArray category = ito::ByteArray())¶ constructor
creates HWMeta-information struct where you can pass a bitmask which consists of values of the enumeration ito::tPluginType. The plugin reference of the corresponding Param should then only accept plugins, where all bits are set, too.
- See
ito::Plugin, ito::tPluginType
-
inline explicit
HWMeta
(const char *HWAddInName, ito::ByteArray category = ito::ByteArray())¶ constructor
creates HWMeta-information struct where you can pass a specific name of a plugin, which only is allowed by the corresponding plugin-instance.
- See
ito::Plugin
-
inline uint32
getMinType
() const¶ returns type-bitmask which is minimally required by plugin-reference. Default 0.
- See
ito::tPluginType
-
inline ito::ByteArray
getHWAddInName
() const¶ returns name of specific hardware plugin
-
inline explicit