|
|
A ConditionCheck implements a check on the sensor data stream of a Sensor-Actor Unit. More...
#include <ArmarXCore/observers/ConditionCheck.h>
Inheritance diagram for ConditionCheck:Public Types | |
| using | ChannelRegistry = armarx::ChannelRegistry |
| Creates a new ConditionCheck instance. | |
Public Member Functions | |
| virtual ConditionCheck * | clone () |
| Clones the current check. | |
| ConditionCheck () | |
| Creates and initializes a ConditionCheck instance. | |
| virtual ConditionCheckPtr | createInstance (const CheckConfiguration &configuration, const ChannelRegistry &channelRegistry) |
| void | evaluateCondition (const DataFieldRegistry &dataFields) |
| Evaluates the condition based on the given registry of data fields. | |
| bool | getFulFilled () |
| Retrieve result of a condition evaluation initiated by evaluateCondition. | |
| void | reset () |
| Resets the status flags of the check such as check results. | |
| ~ConditionCheck () override | |
| Destructor. | |
Protected Member Functions | |
| void | addSupportedType (VariantTypeId dataFieldType=0, ParameterTypeList parameterTypes=ParameterTypeList()) |
| Add a supported type for elementary condition check marks pairs of (dataFieldType,EvaluationTypes) | |
| virtual bool | evaluate (const StringVariantMap &dataFields) |
| Evaluate the condition based on the current data field values. | |
| const Variant & | getParameter (int index) |
| Retrieve parameters of check. | |
| void | setNumberParameters (int numberParameters) |
| Sets the number of paramaters required for this check. | |
Static Protected Member Functions | |
| static ParameterTypeList | createParameterTypeList (int numberTypes,...) |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const ConditionCheck &rhs) |
| std::ostream & | operator<< (std::ostream &stream, const ConditionCheckPtr &rhs) |
A ConditionCheck implements a check on the sensor data stream of a Sensor-Actor Unit.
ConditionCheck instances can be arbitrarily combined to complex Terms.
All custom condition checks should inherit from this base class.
| using ChannelRegistry = armarx::ChannelRegistry |
Creates a new ConditionCheck instance.
It checks if channel and datafield named in configuration are availabel and if the type of the datafield is supported by the check.
| configuration | The configuration of the check to instantiate |
| channelRegistry | The current registry of available channels |
| InvalidConditionException | if the requested channel or datafield could not be found. |
| ConditionCheck | ( | ) |
Creates and initializes a ConditionCheck instance.
|
inlineoverride |
Destructor.
|
protected |
Add a supported type for elementary condition check marks pairs of (dataFieldType,EvaluationTypes)
| dataFieldType | valid type for the dataField variant. Set to 0 for: all types are supported. |
| parameterTypes | types of the parameters |
|
inlinevirtual |
Clones the current check.
Implement this in each subclass of the check.
Reimplemented in ConditionCheckApproxPose, ConditionCheckChanged, ConditionCheckEquals, ConditionCheckEqualsPose, ConditionCheckEqualsWithTolerance, ConditionCheckInRange, ConditionCheckLarger, ConditionCheckMagnitudeInRange, ConditionCheckMagnitudeLarger, ConditionCheckMagnitudeSmaller, ConditionCheckSmaller, ConditionCheckStringContains, ConditionCheckUpdated, and ConditionCheckValid.
|
virtual |
|
staticprotected |
|
inlineprotectedvirtual |
Evaluate the condition based on the current data field values.
This method should be overwritten in order to create a custom condition check.
| dataFields | The values of the relevant data fields to check against |
Reimplemented in ConditionCheckApproxPose, ConditionCheckChanged, ConditionCheckEquals, ConditionCheckEqualsPose, ConditionCheckEqualsWithTolerance, ConditionCheckInRange, ConditionCheckLarger, ConditionCheckMagnitudeInRange, ConditionCheckMagnitudeLarger, ConditionCheckMagnitudeSmaller, ConditionCheckSmaller, ConditionCheckStringContains, ConditionCheckUpdated, and ConditionCheckValid.
| void evaluateCondition | ( | const DataFieldRegistry & | dataFields | ) |
Evaluates the condition based on the given registry of data fields.
The result of the evaluation can be accessed by calling getFulFilled.
| dataFields | The registry of data fields to consider |
| bool getFulFilled | ( | ) |
Retrieve result of a condition evaluation initiated by evaluateCondition.
|
protected |
Retrieve parameters of check.
| index | of the parameter |
| void reset | ( | ) |
Resets the status flags of the check such as check results.
|
protected |
Sets the number of paramaters required for this check.
| numberParameters | number of parameters |
|
friend |
|
friend |