Mercurial > hg > vamp-live-host
view host/Rule.h @ 9:10715d2b3069
* Make it possible for a rule to have more than one action; update test file
author | cannam |
---|---|
date | Mon, 27 Nov 2006 13:34:22 +0000 |
parents | b30fcffc5000 |
children |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ #ifndef _RULE_H_ #define _RULE_H_ #include <vector> #include "Action.h" class Condition { public: enum Type { EqualTo, GreaterThan, LessThan, NotEqualTo, Present, Changed, GapGreaterThan, GapLessThan }; Condition(int pluginIndex, int outputNumber, Type type, float argument = 0.f) : m_pluginIndex(pluginIndex), m_outputNumber(outputNumber), m_type(type), m_argument(argument) { } int getPluginIndex() const { return m_pluginIndex; } int getOutputNumber() const { return m_outputNumber; } Type getType() const { return m_type; } float getArgument() const { return m_argument; } protected: int m_pluginIndex; int m_outputNumber; Type m_type; float m_argument; }; class Rule { public: Rule() { } virtual ~Rule(); void addCondition(Condition condition); void addAction(Action *action); // I take ownership of action typedef std::vector<Condition> ConditionList; const ConditionList &getConditions() const { return m_conditions; } typedef std::vector<Action *> ActionList; const ActionList &getActions() const { return m_actions; } protected: ConditionList m_conditions; ActionList m_actions; }; #endif