mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
RemoveGlobal() method for Scope class + simplifying interfaces
This commit is contained in:
parent
222f604452
commit
9aff0287f0
2 changed files with 19 additions and 3 deletions
|
@ -37,12 +37,15 @@ public:
|
|||
|
||||
const IDPtr& Find(std::string_view name) const;
|
||||
|
||||
template <typename N, typename I> void Insert(N&& name, I&& id)
|
||||
void Insert(std::string name, IDPtr id)
|
||||
{
|
||||
local[std::forward<N>(name)] = std::forward<I>(id);
|
||||
ordered_vars.push_back(std::forward<I>(id));
|
||||
local[name] = id;
|
||||
ordered_vars.push_back(id);
|
||||
}
|
||||
|
||||
// Must only be called for the global scope.
|
||||
void RemoveGlobal(std::string name, IDPtr gid);
|
||||
|
||||
const IDPtr& GetID() const { return scope_id; }
|
||||
|
||||
const std::unique_ptr<std::vector<AttrPtr>>& Attrs() const { return attrs; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue