/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This file is part of guh. *
* *
* Guh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, version 2 of the License. *
* *
* Guh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with guh. If not, see . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef RULE_H
#define RULE_H
#include "types/state.h"
#include "types/ruleaction.h"
#include "types/eventdescriptor.h"
#include "stateevaluator.h"
#include
class Rule
{
public:
Rule();
Rule(const RuleId &id, const QString &name, const QList &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList &actions);
Rule(const RuleId &id, const QString &name, const QList &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList &actions, const QList &exitActions);
Rule(const RuleId &id, const QString &name, const StateEvaluator &stateEvaluator, const QList &actions, const QList &exitActions);
RuleId id() const;
QList eventDescriptors() const;
StateEvaluator stateEvaluator() const;
QList actions() const;
QList exitActions() const;
QString name() const;
bool enabled() const;
void setEnabled(bool enabled);
bool active() const;
private:
friend class RuleEngine;
void setName(const QString &name);
void setActive(bool active);
private:
RuleId m_id;
QString m_name;
QList m_eventDescriptors;
StateEvaluator m_stateEvaluator;
QList m_actions;
QList m_exitActions;
bool m_enabled;
bool m_active;
};
#endif // RULE_H