dynrules
|
00001 /* 00002 * dynrules - Python dynamic rules engine 00003 * 00004 * Authors: Marcus von Appen 00005 * 00006 * This file is distributed under the Public Domain. 00007 */ 00008 00009 #ifndef _RULE_H_ 00010 #define _RULE_H_ 00011 00012 #include <string> 00013 00014 namespace dynrules 00015 { 00023 class Rule 00024 { 00025 public: 00029 Rule (); 00030 00036 Rule (int id); 00037 00044 Rule (int id, std::string code); 00045 00052 Rule (int id, double weight); 00053 00061 Rule (int id, std::string code, double weight); 00062 00066 virtual ~Rule (); 00067 00073 double getWeight () const; 00074 00080 void setWeight (double weight); 00081 00087 bool getUsed () const; 00088 00094 void setUsed (bool used); 00095 00101 int getId () const; 00102 00108 void setId (int id); 00109 00115 std::string getCode () const; 00116 00122 void setCode (const std::string& code); 00123 00134 bool operator ==(const Rule& rule); 00135 00136 protected: 00137 00141 int _id; 00142 00146 double _weight; 00147 00151 bool _used; 00152 00156 std::string _code; 00157 }; 00158 00167 bool operator ==(const Rule& a, const Rule& b); 00168 00169 } //namespace 00170 00171 #endif /* _RULE_H_ */