mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
&on_change working for removals from tables.
Insertions and changes are still noops.
This commit is contained in:
parent
5b5d36cd83
commit
b343cf9bb7
2 changed files with 73 additions and 11 deletions
14
src/Val.h
14
src/Val.h
|
@ -879,10 +879,10 @@ public:
|
|||
void InitTimer(double delay);
|
||||
void DoExpire(double t);
|
||||
|
||||
// If the &default attribute is not a function, or the functon has
|
||||
// already been initialized, this does nothing. Otherwise, evaluates
|
||||
// the function in the frame allowing it to capture its closure.
|
||||
void InitDefaultFunc(Frame* f);
|
||||
// If the &default attribute is not a function, or the functon has
|
||||
// already been initialized, this does nothing. Otherwise, evaluates
|
||||
// the function in the frame allowing it to capture its closure.
|
||||
void InitDefaultFunc(Frame* f);
|
||||
|
||||
unsigned int MemoryAllocation() const override;
|
||||
|
||||
|
@ -922,6 +922,12 @@ protected:
|
|||
// takes ownership of the reference.
|
||||
double CallExpireFunc(Val *idx);
|
||||
|
||||
// Enum for the different kinds of changes an &on_change handler can see
|
||||
enum OnChangeType { element_new, element_changed, element_removed };
|
||||
|
||||
// Calls &change_func. Takes ownership of old_value.
|
||||
void CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe);
|
||||
|
||||
Val* DoClone(CloneState* state) override;
|
||||
|
||||
TableType* table_type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue