• Rule
  • Rule Class

    (nymeaserver::Rule)

    This class represents a rule. More...

    Header: #include <Rule>

    Public Functions

    Rule()
    QList<RuleAction> actions() const
    bool active() const
    bool enabled() const
    QList<EventDescriptor> eventDescriptors() const
    bool executable() const
    QList<RuleAction> exitActions() const
    RuleId id() const
    bool isConsistent() const
    bool isValid() const
    QString name() const
    void setActions(const QList<RuleAction> actions)
    void setEnabled(const bool & enabled)
    void setEventDescriptors(const QList<EventDescriptor> & eventDescriptors)
    void setExecutable(const bool & executable)
    void setExitActions(const QList<RuleAction> exitActions)
    void setId(const RuleId & ruleId)
    void setName(const QString & name)
    void setStateEvaluator(const StateEvaluator & stateEvaluator)
    void setTimeDescriptor(const TimeDescriptor & timeDescriptor)
    StateEvaluator stateEvaluator() const
    bool statesActive() const
    bool timeActive() const
    TimeDescriptor timeDescriptor() const

    Detailed Description

    This class represents a rule.

    A Rule is always triggered by an EventDescriptor, has States to be compared and RuleActions to be executed.

    See also EventDescriptor, State, and RuleAction.

    Member Function Documentation

    Rule::Rule()

    Constructs an empty, invalid Rule.

    QList<RuleAction> Rule::actions() const

    Returns the RuleActions to be executed when this Rule is matched and states match.

    See also setActions().

    bool Rule::active() const

    Returns true if the rule is active.

    bool Rule::enabled() const

    Returns true if the rule is enabled.

    See also setEnabled().

    QList<EventDescriptor> Rule::eventDescriptors() const

    Returns the EventDescriptor for this Rule.

    See also setEventDescriptors().

    bool Rule::executable() const

    Returns true if the rule is executable.

    See also setExecutable().

    QList<RuleAction> Rule::exitActions() const

    Returns the RuleActions to be executed when this Rule leaves the active state.

    See also setExitActions().

    RuleId Rule::id() const

    Returns the id of this Rule.

    See also setId().

    bool Rule::isConsistent() const

    Returns true if this Rule is consistent.

    bool Rule::isValid() const

    Returns true if this Rule is valid. A Rule with a valid id() is valid.

    QString Rule::name() const

    Returns the name of this rule.

    See also setName().

    void Rule::setActions(const QList<RuleAction> actions)

    Sets the actions of this Rule.

    See also actions().

    void Rule::setEnabled(const bool & enabled)

    Set the enabled flag of this rule. In order to actually enable/disable the rule you still need to update the RuleEngine

    See also enabled().

    void Rule::setEventDescriptors(const QList<EventDescriptor> & eventDescriptors)

    Sets the eventDescriptors of this Rule.

    See also eventDescriptors().

    void Rule::setExecutable(const bool & executable)

    Set the rule executable.

    See also executable().

    void Rule::setExitActions(const QList<RuleAction> exitActions)

    Sets the exitActions of this Rule.

    See also exitActions().

    void Rule::setId(const RuleId & ruleId)

    Sets the ruleId of this Rule.

    See also id().

    void Rule::setName(const QString & name)

    Sets the name of this Rule.

    See also name().

    void Rule::setStateEvaluator(const StateEvaluator & stateEvaluator)

    Sets the stateEvaluator of this Rule.

    See also stateEvaluator().

    void Rule::setTimeDescriptor(const TimeDescriptor & timeDescriptor)

    Sets the timeDescriptor of this Rule.

    See also timeDescriptor().

    StateEvaluator Rule::stateEvaluator() const

    Returns the StateEvaluator that needs to evaluate successfully in order for this to Rule apply.

    See also setStateEvaluator().

    bool Rule::statesActive() const

    Returns true if the rule is active regarding the StateEvaluator evaluation.

    bool Rule::timeActive() const

    Returns true if the rule is active regarding the TimeDescriptor evaluation.

    TimeDescriptor Rule::timeDescriptor() const

    Returns the TimeDescriptor or this Rule.

    See also setTimeDescriptor().