This class helps to evaluate a State and . More...
Header: | #include <StateEvaluator> |
StateEvaluator(const StateDescriptor & stateDescriptor) | |
StateEvaluator(QList<StateEvaluator> childEvaluators = QList<StateEvaluator> (), Types::StateOperator stateOperator = Types::StateOperatorAnd) | |
void | appendEvaluator(const StateEvaluator & stateEvaluator) |
QList<StateEvaluator> | childEvaluators() const |
QList<DeviceId> | containedDevices() const |
bool | containsDevice(const DeviceId & deviceId) const |
void | dumpToSettings(NymeaSettings & settings, const QString & groupName) const |
bool | evaluate() const |
bool | isEmpty() const |
bool | isValid() const |
Types::StateOperator | operatorType() const |
void | removeDevice(const DeviceId & deviceId) |
void | setChildEvaluators(const QList<StateEvaluator> & stateEvaluators) |
void | setOperatorType(Types::StateOperator operatorType) |
StateDescriptor | stateDescriptor() const |
StateEvaluator | loadFromSettings(NymeaSettings & settings, const QString & groupName) |
This class helps to evaluate a State and .
The StateEvaluator class helps to evaluate a StateDescriptor and check if all States from the given StateDescriptor are valid. A StateDescriptor is valid if conditions of the StateDescriptor are true.
See also StateDescriptor, State, and RuleEngine.
Constructs a new StateEvaluator for the given stateDescriptor.
Constructs a new StateEvaluator for the given childEvaluators and stateOperator.
Appends the given stateEvaluator to the child evaluators of this StateEvaluator.
See also childEvaluators().
Returns the list of child StateEvaluators of this StateEvaluator.
See also setChildEvaluators().
Returns a list of DeviceIds of this StateEvaluator.
Returns true if this StateEvaluator has a Device in it with the given deviceId.
This method will be used to save this StateEvaluator to the given settings. The groupName will normally be the corresponding Rule.
Returns true, if all child evaluator conditions are true depending on the StateOperator.
Returns true if the StateEvaluator is empty, that is, has no StateDescriptor and no ChildEvaluators
Returns true, if all child evaluators are valid, the devices exist and all descriptors are in allowed paramerters.
[static]
StateEvaluator StateEvaluator::loadFromSettings(NymeaSettings & settings, const QString & groupName)This method will be used to load a StateEvaluator from the given settings. The groupName will be the corresponding RuleId. Returns the loaded StateEvaluator.
Returns the StateOperator for this StateEvaluator.
See also setOperatorType().
Removes a Device with the given deviceId from this StateEvaluator.
Sets the list of child evaluators of this StateEvaluator to the given stateEvaluators.
See also childEvaluators().
Sets the StateOperator for this StateEvaluator to the given. operatorType. This operator will be used to evaluate the child evaluator list.
See also operatorType().
Returns the StateDescriptor of this StateEvaluator.