mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Redo API for notifiers.
There's now an notifier::Modifiable interface class that class supposed to signal modifications are to be derived from. This takes the place of the former MutableValue class and also unifies how Val and IDs signal modifications.
This commit is contained in:
parent
f8262b65c4
commit
062a1ee6b3
8 changed files with 126 additions and 163 deletions
|
@ -13,7 +13,7 @@
|
|||
class TriggerTimer;
|
||||
class TriggerTraversalCallback;
|
||||
|
||||
class Trigger : public NotifierRegistry::Notifier, public BroObj {
|
||||
class Trigger : public notifier::Notifier, public BroObj {
|
||||
public:
|
||||
// Don't access Trigger objects; they take care of themselves after
|
||||
// instantiation. Note that if the condition is already true, the
|
||||
|
@ -61,9 +61,7 @@ public:
|
|||
{ d->Add("<trigger>"); }
|
||||
// Overidden from Notifier. We queue the trigger and evaluate it
|
||||
// later to avoid race conditions.
|
||||
void Modified(ID* id) override
|
||||
{ QueueTrigger(this); }
|
||||
void Modified(Val* val) override
|
||||
void Modified(notifier::Modifiable* m) override
|
||||
{ QueueTrigger(this); }
|
||||
|
||||
const char* Name() const override;
|
||||
|
@ -104,8 +102,7 @@ private:
|
|||
bool delayed; // true if a function call is currently being delayed
|
||||
bool disabled;
|
||||
|
||||
val_list vals;
|
||||
id_list ids;
|
||||
std::vector<BroObj *> objs;
|
||||
|
||||
typedef map<const CallExpr*, Val*> ValCache;
|
||||
ValCache cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue