mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Deprecate Attributes::AddAttrs(Attributes*)
Replaced with version taking an IntrusivePtr parameter
This commit is contained in:
parent
ccd1cbbc54
commit
6daa33364b
3 changed files with 11 additions and 1 deletions
|
@ -201,6 +201,12 @@ void Attributes::AddAttr(IntrusivePtr<Attr> attr)
|
||||||
attrs.emplace_back(make_intrusive<Attr>(ATTR_OPTIONAL));
|
attrs.emplace_back(make_intrusive<Attr>(ATTR_OPTIONAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Attributes::AddAttrs(const IntrusivePtr<Attributes>& a)
|
||||||
|
{
|
||||||
|
for ( const auto& attr : a->Attrs() )
|
||||||
|
AddAttr(attr);
|
||||||
|
}
|
||||||
|
|
||||||
void Attributes::AddAttrs(Attributes* a)
|
void Attributes::AddAttrs(Attributes* a)
|
||||||
{
|
{
|
||||||
for ( const auto& attr : a->Attrs() )
|
for ( const auto& attr : a->Attrs() )
|
||||||
|
|
|
@ -87,6 +87,10 @@ public:
|
||||||
Attributes(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 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
|
void AddAttrs(Attributes* a); // Unref's 'a' when done
|
||||||
|
|
||||||
Attr* FindAttr(attr_tag t) const;
|
Attr* FindAttr(attr_tag t) const;
|
||||||
|
|
|
@ -308,7 +308,7 @@ std::string ID::GetDeprecationWarning() const
|
||||||
void ID::AddAttrs(IntrusivePtr<Attributes> a)
|
void ID::AddAttrs(IntrusivePtr<Attributes> a)
|
||||||
{
|
{
|
||||||
if ( attrs )
|
if ( attrs )
|
||||||
attrs->AddAttrs(a.release());
|
attrs->AddAttrs(a);
|
||||||
else
|
else
|
||||||
attrs = std::move(a);
|
attrs = std::move(a);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue