|
#include <ArmarXCore/observers/ConditionCheck.h>
Public Types | |
using | ChannelRegistry = armarx::ChannelRegistry |
Creates a new ConditionCheck instance. More... | |
Public Member Functions | |
virtual ConditionCheck * | clone () |
Clones the current check. More... | |
ConditionCheck () | |
Creates and initializes a ConditionCheck instance. More... | |
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. More... | |
bool | getFulFilled () |
Retrieve result of a condition evaluation initiated by evaluateCondition. More... | |
void | reset () |
Resets the status flags of the check such as check results. More... | |
~ConditionCheck () override | |
Destructor. More... | |
Protected Member Functions | |
void | addSupportedType (VariantTypeId dataFieldType=0, ParameterTypeList parameterTypes=ParameterTypeList()) |
Add a supported type for elementary condition check marks pairs of (dataFieldType,EvaluationTypes) More... | |
virtual bool | evaluate (const StringVariantMap &dataFields) |
Evaluate the condition based on the current data field values. More... | |
const Variant & | getParameter (int index) |
Retrieve parameters of check. More... | |
void | setNumberParameters (int numberParameters) |
Sets the number of paramaters required for this check. More... | |
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.
Definition at line 56 of file ConditionCheck.h.
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. |
Definition at line 83 of file ConditionCheck.h.
ConditionCheck | ( | ) |
Creates and initializes a ConditionCheck instance.
Definition at line 38 of file ConditionCheck.cpp.
|
inlineoverride |
Destructor.
Definition at line 68 of file ConditionCheck.h.
|
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 |
Definition at line 250 of file ConditionCheck.cpp.
|
inlinevirtual |
Clones the current check.
Implement this in each subclass of the check.
Reimplemented in ConditionCheckEquals, ConditionCheckMagnitudeInRange, ConditionCheckChanged, ConditionCheckEqualsWithTolerance, ConditionCheckInRange, ConditionCheckLarger, ConditionCheckSmaller, ConditionCheckUpdated, ConditionCheckValid, ConditionCheckMagnitudeSmaller, ConditionCheckApproxPose, ConditionCheckMagnitudeLarger, ConditionCheckStringContains, and ConditionCheckEqualsPose.
Definition at line 91 of file ConditionCheck.h.
|
virtual |
Definition at line 44 of file ConditionCheck.cpp.
|
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 ConditionCheckEquals, ConditionCheckChanged, ConditionCheckEqualsWithTolerance, ConditionCheckInRange, ConditionCheckMagnitudeInRange, ConditionCheckLarger, ConditionCheckSmaller, ConditionCheckUpdated, ConditionCheckValid, ConditionCheckApproxPose, ConditionCheckMagnitudeSmaller, ConditionCheckMagnitudeLarger, ConditionCheckStringContains, and ConditionCheckEqualsPose.
Definition at line 163 of file ConditionCheck.h.
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 |
Definition at line 82 of file ConditionCheck.cpp.
bool getFulFilled | ( | ) |
Retrieve result of a condition evaluation initiated by evaluateCondition.
Definition at line 146 of file ConditionCheck.cpp.
|
protected |
Retrieve parameters of check.
index | of the parameter |
Definition at line 151 of file ConditionCheck.cpp.
void reset | ( | ) |
Resets the status flags of the check such as check results.
Definition at line 75 of file ConditionCheck.cpp.
|
protected |
Sets the number of paramaters required for this check.
numberParameters | number of parameters |
Definition at line 245 of file ConditionCheck.cpp.
|
friend |
Definition at line 117 of file ConditionCheck.h.
|
friend |
Definition at line 123 of file ConditionCheck.h.