mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Change EventHandler to store IntrusivePtr<Func>
Also deprecates the LocalHandler() and SetLocalHandler() methods, replaced with GetFunc() and SetFunc().
This commit is contained in:
parent
3b6f60a810
commit
fbc7725278
4 changed files with 20 additions and 27 deletions
|
@ -14,17 +14,11 @@ EventHandler::EventHandler(std::string arg_name)
|
|||
{
|
||||
name = std::move(arg_name);
|
||||
used = false;
|
||||
local = nullptr;
|
||||
error_handler = false;
|
||||
enabled = true;
|
||||
generate_always = false;
|
||||
}
|
||||
|
||||
EventHandler::~EventHandler()
|
||||
{
|
||||
Unref(local);
|
||||
}
|
||||
|
||||
EventHandler::operator bool() const
|
||||
{
|
||||
return enabled && ((local && local->HasBodies())
|
||||
|
@ -52,15 +46,6 @@ const IntrusivePtr<FuncType>& EventHandler::GetType(bool check_export)
|
|||
return type;
|
||||
}
|
||||
|
||||
void EventHandler::SetLocalHandler(Func* f)
|
||||
{
|
||||
if ( local )
|
||||
Unref(local);
|
||||
|
||||
Ref(f);
|
||||
local = f;
|
||||
}
|
||||
|
||||
void EventHandler::Call(const zeek::Args& vl, bool no_remote)
|
||||
{
|
||||
#ifdef PROFILE_BRO_FUNCTIONS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue