mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
changed function_ingredients struct to FunctionIngredients class with accessors
This commit is contained in:
parent
5718046b96
commit
0c434ca4f8
11 changed files with 63 additions and 53 deletions
19
src/Func.h
19
src/Func.h
|
@ -334,16 +334,27 @@ struct CallInfo
|
|||
|
||||
// Struct that collects all the specifics defining a Func. Used for ScriptFuncs
|
||||
// with closures.
|
||||
struct function_ingredients
|
||||
class FunctionIngredients
|
||||
{
|
||||
|
||||
public:
|
||||
// Gathers all of the information from a scope and a function body needed
|
||||
// to build a function.
|
||||
function_ingredients(ScopePtr scope, StmtPtr body, const std::string& module_name);
|
||||
FunctionIngredients(ScopePtr scope, StmtPtr body, const std::string& module_name);
|
||||
|
||||
const IDPtr& GetID() const { return id; }
|
||||
|
||||
const StmtPtr& Body() const { return body; }
|
||||
void SetBody(StmtPtr _body) { body = std::move(_body); }
|
||||
|
||||
const auto& Inits() const { return inits; }
|
||||
size_t FrameSize() const { return frame_size; }
|
||||
int Priority() const { return priority; }
|
||||
const ScopePtr& Scope() const { return scope; }
|
||||
const auto& Groups() const { return groups; }
|
||||
|
||||
private:
|
||||
IDPtr id;
|
||||
StmtPtr body;
|
||||
std::string module_name; // current module name where function body is defined
|
||||
std::vector<IDPtr> inits;
|
||||
size_t frame_size = 0;
|
||||
int priority = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue