64 if (dataFields.size() != 1)
67 throw InvalidConditionException(
68 "Wrong number of datafields for condition changed ");
70 const Variant& value = dataFields.begin()->second;
75 lastValue = value.clone();
81 if (!lastValue->getInitialized() && !value.getInitialized())
86 if (lastValue->getInitialized() != value.getInitialized())
93 result = value.getString() != lastValue->getString();
98 result = value.getBool() != lastValue->getBool();
103 result = value.getInt() != lastValue->getInt();
108 result = value.getLong() != lastValue->getLong();
113 result = value.getFloat() != lastValue->getFloat();
118 result = value.getDouble() != lastValue->getDouble();
120 lastValue = value.clone();
#define ARMARXCORE_IMPORT_EXPORT
ConditionCheck * clone() override
Clones the current check.
bool evaluate(const StringVariantMap &dataFields) override
Evaluate the condition based on the current data field values.
A ConditionCheck implements a check on the sensor data stream of a Sensor-Actor Unit.
static ParameterTypeList createParameterTypeList(int numberTypes,...)
void setNumberParameters(int numberParameters)
Sets the number of paramaters required for this check.
ConditionCheck()
Creates and initializes a ConditionCheck instance.
void addSupportedType(VariantTypeId dataFieldType=0, ParameterTypeList parameterTypes=ParameterTypeList())
Add a supported type for elementary condition check marks pairs of (dataFieldType,...
The Variant class is described here: Variants.
const VariantTypeId String
const VariantTypeId Double
const VariantTypeId Float
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Variant > VariantPtr
std::map< std::string, Variant > StringVariantMap