Add a method to register an event handler to a std::function via C++

This commit is contained in:
Tim Wojtulewicz 2024-03-07 17:01:23 -07:00
parent aac723cfe5
commit 39890fda5e
9 changed files with 65 additions and 2 deletions

View file

@ -143,6 +143,11 @@ void Func::AddBody(detail::StmtPtr /* new_body */, const std::vector<detail::IDP
Internal("Func::AddBody called");
}
void Func::AddBody(detail::StdFunctionStmt::FunctionVariant body, int priority) {
auto stmt = zeek::make_intrusive<detail::StdFunctionStmt>(std::move(body));
AddBody(stmt, {}, priority);
}
void Func::SetScope(detail::ScopePtr newscope) { scope = std::move(newscope); }
FuncPtr Func::DoClone() {