+ Switched to std::vector in favor of BList

+ Added a few minor tweaks


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@532 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder
2002-07-29 07:03:23 +00:00
parent 4574a75fc5
commit 68faee1082
2 changed files with 26 additions and 13 deletions
+10 -5
View File
@@ -9,20 +9,25 @@
#ifndef _sk_sniffer_rule_h_ #ifndef _sk_sniffer_rule_h_
#define _sk_sniffer_rule_h_ #define _sk_sniffer_rule_h_
#include <List.h> #include <vector>
namespace Sniffer { namespace Sniffer {
class Expr; class Expr;
typedef std::vector<Expr*> ExprList;
class Rule { class Rule {
public: public:
Rule(); Rule();
Rule(const char *rule); ~Rule();
status_t SetTo(const char *rule);
private: private:
float fPriority; friend class Parser;
BList fExprList;
void Unset();
void SetTo(double priority, ExprList* list);
double fPriority;
ExprList *fExprList;
}; };
} }
+16 -8
View File
@@ -13,19 +13,27 @@ using namespace Sniffer;
Rule::Rule() Rule::Rule()
: fPriority(0.0) : fPriority(0.0)
, fExprList(NULL)
{ {
// Not implemented
} }
Rule::Rule(const char *rule) Rule::~Rule() {
: fPriority(0.0) Unset();
{
// Parse the rule here ???
} }
status_t void
Rule::SetTo(const char *rule) { Rule::Unset() {
return B_ERROR; // Not implemented if (fExprList){
delete fExprList;
fExprList = NULL;
}
}
void
Rule::SetTo(double priority, ExprList* list) {
Unset();
fPriority = priority;
fExprList = list;
} }