mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
use a subclass of TableType for incremental construction of compiled scripts
This commit is contained in:
parent
c0dd2b4e81
commit
a934acc4f1
3 changed files with 17 additions and 12 deletions
|
@ -16,6 +16,21 @@ using FuncValPtr = IntrusivePtr<zeek::FuncVal>;
|
|||
namespace detail
|
||||
{
|
||||
|
||||
// A version of TableType that allows us to first build a "stub" and
|
||||
// then fill in its actual index & yield later - necessary for dealing
|
||||
// with recursive types.
|
||||
class CPPTableType : public TableType
|
||||
{
|
||||
public:
|
||||
CPPTableType() : TableType(nullptr, nullptr){};
|
||||
|
||||
void SetIndexAndYield(TypeListPtr ind, TypePtr yield)
|
||||
{
|
||||
ind = std::move(indices);
|
||||
yield_type = std::move(yield);
|
||||
}
|
||||
};
|
||||
|
||||
// An initialization hook for a collection of compiled-to-C++ functions
|
||||
// (the result of a single invocation of the compiler on a set of scripts).
|
||||
using CPP_init_func = void (*)();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue