mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes
* origin/master: (172 commits) GH-985: Fix descriptions of double_to_interval() return values Decrease number of CPUs/memory for Cirrus CI tasks Change CI script to compile from build/Makefile Add missing include in util.cc Remove Analyzer.h from bro-bif.h Remove IPAddr.h from Reporter.h Remove the inclusion of Func.h from NetVar.h, which reduces the inclusion of Func.h overall. Update submodule(s) Update submodule(s) Integrate review feedback Update submodule(s) Fix crash on using some deprecated environment variables Update NEWS Update test baselines for new Broker connection status/error strings Switch Broker Val converter visitor to return IntrusivePtr Change BroFunc ctor to take const-ref IntrusivePtr<ID> Add version of Frame::SetElement() taking IntrusivePtr<ID> Change Scope/Func inits from id_list* to vector<IntrusivePtr<ID>> Change Scope::GenerateTemporary() to return IntrusivePtr Deprecate Scope::ReturnType(), replace with GetReturnType() ...
This commit is contained in:
commit
d9de6c4522
359 changed files with 10146 additions and 6696 deletions
30
src/Attr.h
30
src/Attr.h
|
@ -2,6 +2,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Obj.h"
|
||||
#include "BroList.h"
|
||||
#include "IntrusivePtr.h"
|
||||
|
@ -37,15 +39,21 @@ typedef enum {
|
|||
|
||||
class Attr final : public BroObj {
|
||||
public:
|
||||
static inline const IntrusivePtr<Attr> nil;
|
||||
|
||||
Attr(attr_tag t, IntrusivePtr<Expr> e);
|
||||
explicit Attr(attr_tag t);
|
||||
~Attr() override;
|
||||
|
||||
attr_tag Tag() const { return tag; }
|
||||
|
||||
[[deprecated("Remove in v4.1. Use GetExpr().")]]
|
||||
Expr* AttrExpr() const { return expr.get(); }
|
||||
|
||||
template<typename E>
|
||||
void SetAttrExpr(E&& e) { expr = std::forward<E>(e); }
|
||||
const IntrusivePtr<Expr>& GetExpr() const
|
||||
{ return expr; }
|
||||
|
||||
void SetAttrExpr(IntrusivePtr<Expr> e);
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool shorten = false) const;
|
||||
|
@ -74,20 +82,32 @@ protected:
|
|||
// Manages a collection of attributes.
|
||||
class Attributes final : public BroObj {
|
||||
public:
|
||||
[[deprecated("Remove in v4.1. Construct using IntrusivePtrs instead.")]]
|
||||
Attributes(attr_list* a, IntrusivePtr<BroType> t, bool in_record, bool is_global);
|
||||
~Attributes() override;
|
||||
|
||||
Attributes(std::vector<IntrusivePtr<Attr>> a, IntrusivePtr<BroType> t,
|
||||
bool in_record, bool is_global);
|
||||
Attributes(IntrusivePtr<BroType> t, bool in_record, bool is_global);
|
||||
|
||||
void AddAttr(IntrusivePtr<Attr> a);
|
||||
|
||||
void AddAttrs(const IntrusivePtr<Attributes>& a);
|
||||
|
||||
[[deprecated("Remove in v4.1. Pass IntrusivePtr instead.")]]
|
||||
void AddAttrs(Attributes* a); // Unref's 'a' when done
|
||||
|
||||
[[deprecated("Remove in v4.1. Use Find().")]]
|
||||
Attr* FindAttr(attr_tag t) const;
|
||||
|
||||
const IntrusivePtr<Attr>& Find(attr_tag t) const;
|
||||
|
||||
void RemoveAttr(attr_tag t);
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool shorten = false) const;
|
||||
|
||||
attr_list* Attrs() { return attrs; }
|
||||
const std::vector<IntrusivePtr<Attr>>& Attrs() const
|
||||
{ return attrs; }
|
||||
|
||||
bool operator==(const Attributes& other) const;
|
||||
|
||||
|
@ -95,7 +115,7 @@ protected:
|
|||
void CheckAttr(Attr* attr);
|
||||
|
||||
IntrusivePtr<BroType> type;
|
||||
attr_list* attrs;
|
||||
std::vector<IntrusivePtr<Attr>> attrs;
|
||||
bool in_record;
|
||||
bool global_var;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue