mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Deprecate attr_tag in a different way, rename to AttrTag
This commit is contained in:
parent
a5a51de3c4
commit
a280bfa0b1
9 changed files with 67 additions and 137 deletions
36
src/Attr.cc
36
src/Attr.cc
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace zeek::detail {
|
namespace zeek::detail {
|
||||||
|
|
||||||
const char* attr_name(attr_tag t)
|
const char* attr_name(AttrTag t)
|
||||||
{
|
{
|
||||||
static const char* attr_names[int(NUM_ATTRS)] = {
|
static const char* attr_names[int(NUM_ATTRS)] = {
|
||||||
"&optional", "&default", "&redef",
|
"&optional", "&default", "&redef",
|
||||||
|
@ -25,29 +25,18 @@ const char* attr_name(attr_tag t)
|
||||||
return attr_names[int(t)];
|
return attr_names[int(t)];
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr::Attr(attr_tag t, IntrusivePtr<Expr> e)
|
Attr::Attr(AttrTag t, IntrusivePtr<Expr> e)
|
||||||
: expr(std::move(e))
|
: expr(std::move(e))
|
||||||
{
|
{
|
||||||
tag = t;
|
tag = t;
|
||||||
SetLocationInfo(&start_location, &end_location);
|
SetLocationInfo(&start_location, &end_location);
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr::Attr(attr_tag t)
|
Attr::Attr(AttrTag t)
|
||||||
: Attr(t, nullptr)
|
: Attr(t, nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
Attr::Attr(::attr_tag t, IntrusivePtr<Expr> e) : Attr(static_cast<attr_tag>(t), e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Attr::Attr(::attr_tag t) : Attr(static_cast<attr_tag>(t))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
Attr::~Attr() = default;
|
Attr::~Attr() = default;
|
||||||
|
|
||||||
void Attr::SetAttrExpr(IntrusivePtr<zeek::detail::Expr> e)
|
void Attr::SetAttrExpr(IntrusivePtr<zeek::detail::Expr> e)
|
||||||
|
@ -228,7 +217,7 @@ void Attributes::AddAttrs(Attributes* a)
|
||||||
Unref(a);
|
Unref(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr* Attributes::FindAttr(attr_tag t) const
|
Attr* Attributes::FindAttr(AttrTag t) const
|
||||||
{
|
{
|
||||||
for ( const auto& a : attrs )
|
for ( const auto& a : attrs )
|
||||||
if ( a->Tag() == t )
|
if ( a->Tag() == t )
|
||||||
|
@ -237,7 +226,7 @@ Attr* Attributes::FindAttr(attr_tag t) const
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const IntrusivePtr<Attr>& Attributes::Find(attr_tag t) const
|
const IntrusivePtr<Attr>& Attributes::Find(AttrTag t) const
|
||||||
{
|
{
|
||||||
for ( const auto& a : attrs )
|
for ( const auto& a : attrs )
|
||||||
if ( a->Tag() == t )
|
if ( a->Tag() == t )
|
||||||
|
@ -246,7 +235,7 @@ const IntrusivePtr<Attr>& Attributes::Find(attr_tag t) const
|
||||||
return Attr::nil;
|
return Attr::nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Attributes::RemoveAttr(attr_tag t)
|
void Attributes::RemoveAttr(AttrTag t)
|
||||||
{
|
{
|
||||||
for ( auto it = attrs.begin(); it != attrs.end(); )
|
for ( auto it = attrs.begin(); it != attrs.end(); )
|
||||||
{
|
{
|
||||||
|
@ -257,19 +246,6 @@ void Attributes::RemoveAttr(attr_tag t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
Attr* Attributes::FindAttr(::attr_tag t) const
|
|
||||||
{
|
|
||||||
return FindAttr(static_cast<attr_tag>(t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Attributes::RemoveAttr(::attr_tag t)
|
|
||||||
{
|
|
||||||
RemoveAttr(static_cast<attr_tag>(t));
|
|
||||||
}
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
void Attributes::Describe(ODesc* d) const
|
void Attributes::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( attrs.empty() )
|
if ( attrs.empty() )
|
||||||
|
|
96
src/Attr.h
96
src/Attr.h
|
@ -14,31 +14,9 @@ ZEEK_FORWARD_DECLARE_NAMESPACED(Expr, zeek::detail);
|
||||||
// modify expressions or supply metadata on types, and the kind that
|
// modify expressions or supply metadata on types, and the kind that
|
||||||
// are extra metadata on every variable instance.
|
// are extra metadata on every variable instance.
|
||||||
|
|
||||||
enum [[deprecated("Remove in v4.1. Use zeek::detail::attr_tag instead.")]] attr_tag {
|
|
||||||
ATTR_OPTIONAL,
|
|
||||||
ATTR_DEFAULT,
|
|
||||||
ATTR_REDEF,
|
|
||||||
ATTR_ADD_FUNC,
|
|
||||||
ATTR_DEL_FUNC,
|
|
||||||
ATTR_EXPIRE_FUNC,
|
|
||||||
ATTR_EXPIRE_READ,
|
|
||||||
ATTR_EXPIRE_WRITE,
|
|
||||||
ATTR_EXPIRE_CREATE,
|
|
||||||
ATTR_RAW_OUTPUT,
|
|
||||||
ATTR_PRIORITY,
|
|
||||||
ATTR_GROUP,
|
|
||||||
ATTR_LOG,
|
|
||||||
ATTR_ERROR_HANDLER,
|
|
||||||
ATTR_TYPE_COLUMN, // for input framework
|
|
||||||
ATTR_TRACKED, // hidden attribute, tracked by NotifierRegistry
|
|
||||||
ATTR_ON_CHANGE, // for table change tracking
|
|
||||||
ATTR_DEPRECATED,
|
|
||||||
NUM_ATTRS // this item should always be last
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace zeek::detail {
|
namespace zeek::detail {
|
||||||
|
|
||||||
enum attr_tag {
|
enum AttrTag {
|
||||||
ATTR_OPTIONAL,
|
ATTR_OPTIONAL,
|
||||||
ATTR_DEFAULT,
|
ATTR_DEFAULT,
|
||||||
ATTR_REDEF,
|
ATTR_REDEF,
|
||||||
|
@ -64,21 +42,12 @@ class Attr final : public BroObj {
|
||||||
public:
|
public:
|
||||||
static inline const IntrusivePtr<zeek::detail::Attr> nil;
|
static inline const IntrusivePtr<zeek::detail::Attr> nil;
|
||||||
|
|
||||||
Attr(attr_tag t, IntrusivePtr<zeek::detail::Expr> e);
|
Attr(AttrTag t, IntrusivePtr<zeek::detail::Expr> e);
|
||||||
explicit Attr(attr_tag t);
|
explicit Attr(AttrTag t);
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
Attr(::attr_tag t, IntrusivePtr<zeek::detail::Expr> e);
|
|
||||||
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
explicit Attr(::attr_tag t);
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
~Attr() override;
|
~Attr() override;
|
||||||
|
|
||||||
attr_tag Tag() const { return tag; }
|
AttrTag Tag() const { return tag; }
|
||||||
|
|
||||||
[[deprecated("Remove in v4.1. Use GetExpr().")]]
|
[[deprecated("Remove in v4.1. Use GetExpr().")]]
|
||||||
zeek::detail::Expr* AttrExpr() const { return expr.get(); }
|
zeek::detail::Expr* AttrExpr() const { return expr.get(); }
|
||||||
|
@ -108,7 +77,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void AddTag(ODesc* d) const;
|
void AddTag(ODesc* d) const;
|
||||||
|
|
||||||
attr_tag tag;
|
AttrTag tag;
|
||||||
IntrusivePtr<Expr> expr;
|
IntrusivePtr<Expr> expr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -130,19 +99,11 @@ public:
|
||||||
void AddAttrs(Attributes* a); // Unref's 'a' when done
|
void AddAttrs(Attributes* a); // Unref's 'a' when done
|
||||||
|
|
||||||
[[deprecated("Remove in v4.1. Use Find().")]]
|
[[deprecated("Remove in v4.1. Use Find().")]]
|
||||||
Attr* FindAttr(attr_tag t) const;
|
Attr* FindAttr(AttrTag t) const;
|
||||||
|
|
||||||
const IntrusivePtr<Attr>& Find(attr_tag t) const;
|
const IntrusivePtr<Attr>& Find(AttrTag t) const;
|
||||||
|
|
||||||
void RemoveAttr(attr_tag t);
|
void RemoveAttr(AttrTag t);
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
Attr* FindAttr(::attr_tag t) const;
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
void RemoveAttr(::attr_tag t);
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
void Describe(ODesc* d) const override;
|
void Describe(ODesc* d) const override;
|
||||||
void DescribeReST(ODesc* d, bool shorten = false) const;
|
void DescribeReST(ODesc* d, bool shorten = false) const;
|
||||||
|
@ -165,3 +126,44 @@ protected:
|
||||||
|
|
||||||
using Attr [[deprecated("Remove in v4.1. Use zeek::detail::Attr instead.")]] = zeek::detail::Attr;
|
using Attr [[deprecated("Remove in v4.1. Use zeek::detail::Attr instead.")]] = zeek::detail::Attr;
|
||||||
using Attributes [[deprecated("Remove in v4.1. Use zeek::detail::Attr instead.")]] = zeek::detail::Attributes;
|
using Attributes [[deprecated("Remove in v4.1. Use zeek::detail::Attr instead.")]] = zeek::detail::Attributes;
|
||||||
|
|
||||||
|
using AttrTag [[deprecated("Remove in v4.1. Use zeek::detail::AttrTag instead.")]] = zeek::detail::AttrTag;
|
||||||
|
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_OPTIONAL instead.")]]
|
||||||
|
constexpr auto ATTR_OPTIONAL = zeek::detail::ATTR_OPTIONAL;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_DEFAULT instead.")]]
|
||||||
|
constexpr auto ATTR_DEFAULT = zeek::detail::ATTR_DEFAULT;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_REDEF instead.")]]
|
||||||
|
constexpr auto ATTR_REDEF = zeek::detail::ATTR_REDEF;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_ADD_FUNC instead.")]]
|
||||||
|
constexpr auto ATTR_ADD_FUNC = zeek::detail::ATTR_ADD_FUNC;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_DEL_FUNC instead.")]]
|
||||||
|
constexpr auto ATTR_DEL_FUNC = zeek::detail::ATTR_DEL_FUNC;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_EXPIRE_FUNC instead.")]]
|
||||||
|
constexpr auto ATTR_EXPIRE_FUNC = zeek::detail::ATTR_EXPIRE_FUNC;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_EXPIRE_READ instead.")]]
|
||||||
|
constexpr auto ATTR_EXPIRE_READ = zeek::detail::ATTR_EXPIRE_READ;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_EXPIRE_WRITE instead.")]]
|
||||||
|
constexpr auto ATTR_EXPIRE_WRITE = zeek::detail::ATTR_EXPIRE_WRITE;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_EXPIRE_CREATE instead.")]]
|
||||||
|
constexpr auto ATTR_EXPIRE_CREATE = zeek::detail::ATTR_EXPIRE_CREATE;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_RAW_OUTPUT instead.")]]
|
||||||
|
constexpr auto ATTR_RAW_OUTPUT = zeek::detail::ATTR_RAW_OUTPUT;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_PRIORITY instead.")]]
|
||||||
|
constexpr auto ATTR_PRIORITY = zeek::detail::ATTR_PRIORITY;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_GROUP instead.")]]
|
||||||
|
constexpr auto ATTR_GROUP = zeek::detail::ATTR_GROUP;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_LOG instead.")]]
|
||||||
|
constexpr auto ATTR_LOG = zeek::detail::ATTR_LOG;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_ERROR_HANDLER instead.")]]
|
||||||
|
constexpr auto ATTR_ERROR_HANDLER = zeek::detail::ATTR_ERROR_HANDLER;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_TYPE_COLUMN instead.")]]
|
||||||
|
constexpr auto ATTR_TYPE_COLUMN = zeek::detail::ATTR_TYPE_COLUMN;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_TRACKED instead.")]]
|
||||||
|
constexpr auto ATTR_TRACKED = zeek::detail::ATTR_TRACKED;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_ON_CHANGE instead.")]]
|
||||||
|
constexpr auto ATTR_ON_CHANGE = zeek::detail::ATTR_ON_CHANGE;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::ATTR_DEPRECATED instead.")]]
|
||||||
|
constexpr auto ATTR_DEPRECATED = zeek::detail::ATTR_DEPRECATED;
|
||||||
|
[[deprecated("Remove in v4.1. Use zeek::detail::NUM_ATTRS instead.")]]
|
||||||
|
constexpr auto NUM_ATTRS = zeek::detail::NUM_ATTRS;
|
||||||
|
|
12
src/ID.cc
12
src/ID.cc
|
@ -287,7 +287,7 @@ void ID::UpdateValAttrs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const IntrusivePtr<Attr>& ID::GetAttr(attr_tag t) const
|
const IntrusivePtr<Attr>& ID::GetAttr(AttrTag t) const
|
||||||
{
|
{
|
||||||
return attrs ? attrs->Find(t) : Attr::nil;
|
return attrs ? attrs->Find(t) : Attr::nil;
|
||||||
}
|
}
|
||||||
|
@ -337,20 +337,12 @@ void ID::AddAttrs(IntrusivePtr<Attributes> a)
|
||||||
UpdateValAttrs();
|
UpdateValAttrs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ID::RemoveAttr(attr_tag a)
|
void ID::RemoveAttr(AttrTag a)
|
||||||
{
|
{
|
||||||
if ( attrs )
|
if ( attrs )
|
||||||
attrs->RemoveAttr(a);
|
attrs->RemoveAttr(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
void ID::RemoveAttr(::attr_tag a)
|
|
||||||
{
|
|
||||||
RemoveAttr(static_cast<attr_tag>(a));
|
|
||||||
}
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
void ID::SetOption()
|
void ID::SetOption()
|
||||||
{
|
{
|
||||||
if ( is_option )
|
if ( is_option )
|
||||||
|
|
16
src/ID.h
16
src/ID.h
|
@ -124,12 +124,7 @@ public:
|
||||||
|
|
||||||
void SetAttrs(IntrusivePtr<Attributes> attr);
|
void SetAttrs(IntrusivePtr<Attributes> attr);
|
||||||
void AddAttrs(IntrusivePtr<Attributes> attr);
|
void AddAttrs(IntrusivePtr<Attributes> attr);
|
||||||
void RemoveAttr(attr_tag a);
|
void RemoveAttr(zeek::detail::AttrTag a);
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag")]]
|
|
||||||
void RemoveAttr(::attr_tag a);
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
void UpdateValAttrs();
|
void UpdateValAttrs();
|
||||||
|
|
||||||
const IntrusivePtr<Attributes>& GetAttrs() const
|
const IntrusivePtr<Attributes>& GetAttrs() const
|
||||||
|
@ -138,14 +133,7 @@ public:
|
||||||
[[deprecated("Remove in 4.1. Use GetAttrs().")]]
|
[[deprecated("Remove in 4.1. Use GetAttrs().")]]
|
||||||
Attributes* Attrs() const { return attrs.get(); }
|
Attributes* Attrs() const { return attrs.get(); }
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::AttrTag t) const;
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in 4.1. Use GetAttr().")]]
|
|
||||||
Attr* FindAttr(::attr_tag t) const
|
|
||||||
{ return GetAttr(static_cast<zeek::detail::attr_tag>(t)).get(); }
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::attr_tag t) const;
|
|
||||||
|
|
||||||
bool IsDeprecated() const;
|
bool IsDeprecated() const;
|
||||||
|
|
||||||
|
|
20
src/Type.h
20
src/Type.h
|
@ -638,14 +638,7 @@ public:
|
||||||
TypeDecl(const TypeDecl& other);
|
TypeDecl(const TypeDecl& other);
|
||||||
~TypeDecl();
|
~TypeDecl();
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::AttrTag a) const
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use GetAttr().")]]
|
|
||||||
const zeek::detail::Attr* FindAttr(::attr_tag a) const
|
|
||||||
{ return attrs ? attrs->Find(static_cast<zeek::detail::attr_tag>(a)).get() : nullptr; }
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::attr_tag a) const
|
|
||||||
{ return attrs ? attrs->Find(a) : zeek::detail::Attr::nil; }
|
{ return attrs ? attrs->Find(a) : zeek::detail::Attr::nil; }
|
||||||
|
|
||||||
void DescribeReST(ODesc* d, bool roles_only = false) const;
|
void DescribeReST(ODesc* d, bool roles_only = false) const;
|
||||||
|
@ -746,21 +739,12 @@ public:
|
||||||
return decl && decl->GetAttr(zeek::detail::ATTR_DEPRECATED) != nullptr;
|
return decl && decl->GetAttr(zeek::detail::ATTR_DEPRECATED) != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FieldHasAttr(int field, zeek::detail::attr_tag at) const
|
bool FieldHasAttr(int field, zeek::detail::AttrTag at) const
|
||||||
{
|
{
|
||||||
const TypeDecl* decl = FieldDecl(field);
|
const TypeDecl* decl = FieldDecl(field);
|
||||||
return decl && decl->GetAttr(at) != nullptr;
|
return decl && decl->GetAttr(at) != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
bool FieldHasAttr(int field, ::attr_tag at) const
|
|
||||||
{
|
|
||||||
return FieldHasAttr(field, static_cast<zeek::detail::attr_tag>(at));
|
|
||||||
}
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
std::string GetFieldDeprecationWarning(int field, bool has_check) const;
|
std::string GetFieldDeprecationWarning(int field, bool has_check) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -1481,7 +1481,7 @@ void TableVal::SetAttrs(IntrusivePtr<zeek::detail::Attributes> a)
|
||||||
change_func = cf->GetExpr();
|
change_func = cf->GetExpr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TableVal::CheckExpireAttr(zeek::detail::attr_tag at)
|
void TableVal::CheckExpireAttr(zeek::detail::AttrTag at)
|
||||||
{
|
{
|
||||||
const auto& a = attrs->Find(at);
|
const auto& a = attrs->Find(at);
|
||||||
|
|
||||||
|
@ -2194,7 +2194,7 @@ ListVal* TableVal::ConvertToPureList() const
|
||||||
return ToPureListVal().release();
|
return ToPureListVal().release();
|
||||||
}
|
}
|
||||||
|
|
||||||
const IntrusivePtr<zeek::detail::Attr>& TableVal::GetAttr(zeek::detail::attr_tag t) const
|
const IntrusivePtr<zeek::detail::Attr>& TableVal::GetAttr(zeek::detail::AttrTag t) const
|
||||||
{
|
{
|
||||||
return attrs ? attrs->Find(t) : zeek::detail::Attr::nil;
|
return attrs ? attrs->Find(t) : zeek::detail::Attr::nil;
|
||||||
}
|
}
|
||||||
|
|
16
src/Val.h
16
src/Val.h
|
@ -957,14 +957,7 @@ public:
|
||||||
|
|
||||||
void SetAttrs(IntrusivePtr<zeek::detail::Attributes> attrs);
|
void SetAttrs(IntrusivePtr<zeek::detail::Attributes> attrs);
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::AttrTag t) const;
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use GetAttr().")]]
|
|
||||||
Attr* FindAttr(::attr_tag t) const
|
|
||||||
{ return GetAttr(static_cast<zeek::detail::attr_tag>(t)).get(); }
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::attr_tag t) const;
|
|
||||||
|
|
||||||
[[deprecated("Remove in v4.1. Use GetAttrs().")]]
|
[[deprecated("Remove in v4.1. Use GetAttrs().")]]
|
||||||
zeek::detail::Attributes* Attrs() { return attrs.get(); }
|
zeek::detail::Attributes* Attrs() { return attrs.get(); }
|
||||||
|
@ -1035,12 +1028,7 @@ protected:
|
||||||
ParseTimeTableState DumpTableState();
|
ParseTimeTableState DumpTableState();
|
||||||
void RebuildTable(ParseTimeTableState ptts);
|
void RebuildTable(ParseTimeTableState ptts);
|
||||||
|
|
||||||
void CheckExpireAttr(zeek::detail::attr_tag at);
|
void CheckExpireAttr(zeek::detail::AttrTag at);
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
|
||||||
void CheckExpireAttr(::attr_tag at);
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
bool ExpandCompoundAndInit(ListVal* lv, int k, IntrusivePtr<Val> new_val);
|
bool ExpandCompoundAndInit(ListVal* lv, int k, IntrusivePtr<Val> new_val);
|
||||||
bool CheckAndAssign(IntrusivePtr<Val> index, IntrusivePtr<Val> new_val);
|
bool CheckAndAssign(IntrusivePtr<Val> index, IntrusivePtr<Val> new_val);
|
||||||
|
|
||||||
|
|
|
@ -415,7 +415,7 @@ static void transfer_arg_defaults(zeek::RecordType* args, zeek::RecordType* recv
|
||||||
}
|
}
|
||||||
|
|
||||||
static zeek::detail::Attr* find_attr(const std::vector<IntrusivePtr<zeek::detail::Attr>>* al,
|
static zeek::detail::Attr* find_attr(const std::vector<IntrusivePtr<zeek::detail::Attr>>* al,
|
||||||
zeek::detail::attr_tag tag)
|
zeek::detail::AttrTag tag)
|
||||||
{
|
{
|
||||||
if ( ! al )
|
if ( ! al )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -251,7 +251,7 @@ static bool expr_is_table_type_name(const zeek::detail::Expr* expr)
|
||||||
zeek::detail::case_list* case_l;
|
zeek::detail::case_list* case_l;
|
||||||
zeek::detail::Attr* attr;
|
zeek::detail::Attr* attr;
|
||||||
std::vector<IntrusivePtr<zeek::detail::Attr>>* attr_l;
|
std::vector<IntrusivePtr<zeek::detail::Attr>>* attr_l;
|
||||||
zeek::detail::attr_tag attrtag;
|
zeek::detail::AttrTag attrtag;
|
||||||
}
|
}
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue