+ 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

View File

@ -9,20 +9,25 @@
#ifndef _sk_sniffer_rule_h_
#define _sk_sniffer_rule_h_
#include <List.h>
#include <vector>
namespace Sniffer {
class Expr;
typedef std::vector<Expr*> ExprList;
class Rule {
public:
Rule();
Rule(const char *rule);
status_t SetTo(const char *rule);
~Rule();
private:
float fPriority;
BList fExprList;
friend class Parser;
void Unset();
void SetTo(double priority, ExprList* list);
double fPriority;
ExprList *fExprList;
};
}

View File

@ -13,19 +13,27 @@ using namespace Sniffer;
Rule::Rule()
: fPriority(0.0)
, fExprList(NULL)
{
// Not implemented
}
Rule::Rule(const char *rule)
: fPriority(0.0)
{
// Parse the rule here ???
Rule::~Rule() {
Unset();
}
status_t
Rule::SetTo(const char *rule) {
return B_ERROR; // Not implemented
void
Rule::Unset() {
if (fExprList){
delete fExprList;
fExprList = NULL;
}
}
void
Rule::SetTo(double priority, ExprList* list) {
Unset();
fPriority = priority;
fExprList = list;
}