00001 #ifndef _RTREE_H_ 00002 #define _RTREE_H_ 00003 00004 #include "stree.h" 00005 #include "streeconstant.h" 00006 #include "prioritylist.h" 00007 00008 class RuleContext; 00009 00011 class Rule{ 00012 public: 00014 00025 virtual bool execute(RuleContext* context, List* phpIn, List* phpOut, List* tplOut, Node::Assignment& assign) const = 0; 00026 00028 virtual Rule* copy() = 0; 00030 virtual Rule* substitute(const Node::Assignment &assign) = 0; 00031 00033 virtual ostream& print(ostream& os) const = 0; 00035 friend ostream& operator<<(ostream& os, const Rule* rule){ 00036 return rule->print(os); 00037 }; 00038 }; 00039 00041 00044 typedef PriorityPair<Rule> PriorityRulePair; 00045 00047 typedef PriorityList<Rule> RuleList; 00048 00050 class RunRuleList : public map<int,RuleList>{ 00051 public: 00052 }; 00053 00055 class NamedRuleList{ 00056 public: 00057 string name; 00058 int runTime; 00059 RuleList* rules; 00060 00061 NamedRuleList(Constant *icontextName, Constant *irunTime, RuleList *iruleList) : 00062 name(icontextName->getValue()), runTime(irunTime->toInt()), rules(iruleList) 00063 { 00064 delete icontextName; 00065 delete irunTime; 00066 }; 00067 }; 00068 00069 00070 #endif 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080