The class AlgoInterfaceValidator provides validators and checks in order to verify that a certain filter or algoWidget that pretends to implement a certain interface really fits to the requirements and conditions of this interface.
More...
|
| AlgoInterfaceValidator (ito::RetVal &retValue) |
| constructor
|
|
| ~AlgoInterfaceValidator () |
| destructor
|
|
ito::RetVal | addInterface (ito::AddInAlgo::tAlgoInterface iface, QVector< ito::Param > &mandParams, QVector< ito::Param > &outParams, int maxNumMand, int maxNumOpt, int maxNumOut) |
| addInterface
|
|
bool | isValidFilter (const ito::AddInAlgo::FilterDef &filter, ito::RetVal &ret, QStringList &tags) const |
| verifies a given filter with respect to its indicated interface
|
|
bool | isValidWidget (const ito::AddInAlgo::AlgoWidgetDef &widget, ito::RetVal &ret, QStringList &tags) const |
| verifies a given algo-widget with respect to its indicated interface
|
|
ito::RetVal | getInterfaceParameters (ito::AddInAlgo::tAlgoInterface iface, QVector< ito::ParamBase > &mandParams, QVector< ito::ParamBase > &outParams) const |
|
The class AlgoInterfaceValidator provides validators and checks in order to verify that a certain filter or algoWidget that pretends to implement a certain interface really fits to the requirements and conditions of this interface.
In the current implementation this class is instantiated once by the class AddInManager, hence, it can be considered as singleton class.
- See also
- AddInManager, AddInAlgo::tAlgoInterface, AddInAlgo::FilterDef, AddInAlgo::AlgoWidgetDef
◆ AlgoInterfaceValidator()
ito::AlgoInterfaceValidator::AlgoInterfaceValidator |
( |
ito::RetVal & | retValue | ) |
|
constructor
Calls method init in order to load the requirements and conditions for each interface, defined in the enumeration tAlgoInterface
- See also
- AddInAlgo::tAlgoInterface
◆ addInterface()
addInterface
Registers the requirements for any interface given by the enumeration value AddInAlgo::tAlgoInterface.
- Parameters
-
[in] | iface | is the interface enumeration value whose requirements should be registered |
[in] | mandParams | is a vector indicating the first m mandatory parameters every filter that implements this interface must provide, too. |
[in] | outParams | is a vector indicating the fist n output parameters every filter that implements this interface must provide, too. Remember that every parameter in this vector must have the Out-flag set and no In-flag. |
[in] | maxNumMand | is the maximum number of mandatory parameters |
[in] | maxNumOpt | is the maximum number of optional parameters |
[in] | maxNumOut | is the maximum number of output parameters |
- See also
- AddInAlgo::tAlgoInterface
◆ getTags()
verifies and parses the meta information string of any filter or algoWidget
Sometimes a certain algorithm interface needs that the user gives additional information about the filter when creating this filter in the plugin. This additional information can be given by the meta information string in the structs FilterDef and AlgoWidgetDef. In the filter or algoWidget pretends to fit to a certain algorithm interface, this method is called with the interface number and the meta information string. Then, this string is checked if it fits the requirements of the interface and if so it can be parsed. The parsed elements are then returned in form of a string list. The meaning and definition of the content of this string list must be interpreted by the method which wishes to use filters of a certain interface type.
- Parameters
-
[in] | iface | is the interface number |
[in] | metaInformation | is the meta information string connected to the filter in any plugin |
[out] | tags | is the parsed string list (or empty in case of an error) |
- Returns
- true if the meta information string has been valid and could be parsed, else false
- See also
- AddInAlgo::tAlgoInterface
◆ init()
loads the requirements for every interface defined in the enumeration AddInAlgo::tAlgoInterface
The requirements of every interface can be given by several things:
- You can indicate the first n mandatory parameters. This is done by filling a vector of class ito::Param.
- You can define the first m output parameters.
- You can indicate a maximum number of mandatory, optional and output parameters. must be greater or equal than the previously indicated vectors.
If any mandatory, optional or output parameters are defined, the corresponding filter, that pretends to fit to this interface, must have a parameter at the same position whose type is equal to the given parameter and if the indicated parameter of the interface has any restricitions given in form of a meta information instance, the corresponding parameter of the filter must have a restriction which is equal or "stricter" than the restriction defined in this method.
For every interface defined in the enumeration AddInAlgo::tAlgoInterface, you should call the method addInInterface in this method in order to create the requirements. The last requirement of every interface is the possible structure or content of the meta information string, that can or sometimes must be appended when creating the FilterDef-instance in any plugin. This meta information string is checked and parsed in the method getTags.
- See also
- AddInAlgo::tAlgoInterface, ito::Param, addInterface, getTags
◆ isValid()
- Parameters
-
iface | |
filterParamFunc | |
ret | |
- Returns
- bool
- See also
- isValid, getTags
◆ isValidFilter()
verifies a given filter with respect to its indicated interface
If the given filter pretends to implement a certain interface, the parameters of the filter are checked with respect to the requirements of the interface and the additional meta information string is checked and parsed.
- Parameters
-
[in] | filter | is the filter-definition struct of the filter to check |
| [in/out] | ret is the result of the check |
[out] | tags | are an optional string list containing tags extracted from the meta information string |
- Returns
- true if filter is valid with respect to the interface
- See also
- isValid, getTags
◆ isValidWidget()
verifies a given algo-widget with respect to its indicated interface
If the given algo-widget pretends to implement a certain interface, the parameters of the algo-widget are checked with respect to the requirements of the interface and the additional meta information string is checked and parsed.
- Parameters
-
[in] | widget | is the algo-widget-definition struct of the algo-widget to check |
| [in/out] | ret is the result of the check |
[out] | tags | are an optional string list containing tags extracted from the meta information string |
- Returns
- true if the algo-widget is valid with respect to the interface
- See also
- isValid, getTags
◆ Q_DECLARE_PRIVATE()
self-managed pointer to the private class container (deletes itself if d_ptr is destroyed)
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/AddInManager/algoInterfaceValidator.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/AddInManager/algoInterfaceValidator.cpp