8.7.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.

../../_images/paramMeta.png

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.

8.7.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

Public Type

MetaRtti enum

Runtime type information.

MetaRtti is used to cast param meta objects, without having to enable runtime type information of the compiler.

Values:

  • rttiUnknown = = 0 -

    unknown parameter

  • rttiCharMeta = = 1 -

    meta for a char parameter

  • rttiIntMeta = = 2 -

    meta for an integer parameter

  • rttiDoubleMeta = = 3 -

    meta for a double parameter

  • rttiStringMeta = = 4 -

    meta for a string parameter

  • rttiHWMeta = = 5 -

    meta for a hardware plugin parameter

  • rttiDObjMeta = = 6 -

    meta for a data object parameter

  • rttiIntArrayMeta = = 7 -

    meta for an integer array parameter

  • rttiDoubleArrayMeta = = 8 -

    meta for a double array parameter

  • rttiCharArrayMeta = = 9 -

    meta for a char array parameter

  • rttiIntervalMeta = = 10 -

    meta for an integer array with two values that represent an interval [value1, value2] parameter

  • rttiDoubleIntervalMeta = = 11 -

    meta for a double array with two values that represent an interval [value1, value2] parameter (size of the interval is value2-value1)

  • rttiRangeMeta = = 12 -

    meta for an integer array with two values that represent a range [value1, value2] parameter (size of a range is 1+value2-value1)

  • rttiRectMeta = = 13 -

    meta for an integer array with four values that consists of two ranges (vertical and horizontal, e.g. for ROIs of cameras)

tRepresentation enum

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:

  • Linear = = 0x0001 -

    Slider with linear behavior.

  • Logarithmic = = 0x0002 -

    Slider with logarithmic behaviour.

  • Boolean = = 0x0004 -

    Check box.

  • PureNumber = = 0x0008 -

    Decimal number in an edit control.

  • HexNumber = = 0x0010 -

    Hex number in an edit control.

  • IPV4Address = = 0x0020 -

    IP-Address.

  • MACAddress = = 0x0040 -

    MAC-Address.

  • UnknownRepresentation = = 0x0080 -

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

virtual ~ParamMeta()

destructor

MetaRtti getType() const

returns runtime type information value

ito::ByteArray getCategory() const

returns category name of this parameter (default: empty ByteArray)

8.7.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

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

See
ito::Param, ito::ParamMeta

Public Functions

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)

char getMin() const

returns minimum value

char getMax() const

returns maximum value

char getStepSize() const

returns step size

ito::ByteArray getUnit() const

returns unit

void setUnit(const ito::ByteArray & unit)

sets unit string of this parameter

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

Public Static Functions

CharMeta * all(ito::ByteArray category = ito::ByteArray())

returns a new instance of CharMeta, where the min and max are set to the full range available for char. The caller has to take care of memory.

class ito::IntMeta

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

See
ito::Param, ito::ParamMeta

Public Functions

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)

int32 getMin() const

returns minimum value

int32 getMax() const

returns maximum value

int32 getStepSize() const

returns step size

ito::ByteArray getUnit() const

returns unit

void setUnit(const ito::ByteArray & unit)

sets unit string of this parameter

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

Public Static Functions

IntMeta * all(ito::ByteArray category = ito::ByteArray())

returns a new instance of IntMeta, where the min and max are set to the full range available for integers. The caller has to take care of memory.

class ito::DoubleMeta

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

See
ito::Param, ito::ParamMeta

Public Type

tDisplayNotation enum

Display notation style if the related parameters is displayed in any widget.

Values:

  • Automatic -

    double number is automatically rendered in any GUI element

  • Fixed -

    if possible, the double number should be shown as fixed number, e.g. 1000.00

  • Scientific -

    if possible, the double number should be rendered in a scientific notation, e.g. 1.0E3

Public Functions

DoubleMeta(float64 minVal, float64 maxVal, float64 stepSize = 0.0, ito::ByteArray category = ito::ByteArray())

constructor with minimum and maximum value

float64 getMin() const

returns minimum value

float64 getMax() const

returns maximum value

float64 getStepSize() const

returns step size

ito::ByteArray getUnit() const

returns unit

void setUnit(const ito::ByteArray & unit)

sets unit string of this parameter

int getDisplayPrecision() const

returns display precision

void setDisplayPrecision(int displayPrecision)

sets display precision

DoubleMeta::tDisplayNotation getDisplayNotation() const

returns display notation

void setDisplayNotation(DoubleMeta::tDisplayNotation displayNotation)

sets display notation

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

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.

8.7.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

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::CharMeta

See
ito::Param, ito::ParamMeta, ito::IntArray

Public Functions

size_t getNumMin() const

returns minimum number of values

size_t getNumMax() const

returns maximum number of values

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 Functions

size_t getNumMin() const

returns minimum number of values

size_t getNumMax() const

returns maximum number of values

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::DoubleArrayMeta

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.

See
ito::Param, ito::ParamMeta, ito::DoubleMeta

Public Functions

size_t getNumMin() const

returns minimum number of values

size_t getNumMax() const

returns maximum number of values

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

8.7.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

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

See
ito::Param, ito::ParamMeta

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 considered

  • val -

    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 considered

  • val -

    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.

8.7.5.5. Class DObjMeta

This meta information class provides further information about allowed types and boundaries concerning the dimension of a data object.

class ito::DObjMeta

Meta-information for Param of type DObjPtr.

(not used yet)

See
ito::Param, ito::ParamMeta

Public Functions

int getMinDim() const

returns maximum allowed dimensions of data object

int getMaxDim() const

returns minimum number of dimensions of data object

8.7.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

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

See
ito::Param, ito::ParamMeta

Public Functions

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

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

uint32 getMinType() const

returns type-bitmask which is minimally required by plugin-reference. Default 0.

See
ito::tPluginType

ito::ByteArray getHWAddInName() const

returns name of specific hardware plugin