Move IntrusivePtr and utility methods to the zeek namespace

This commit is contained in:
Tim Wojtulewicz 2020-06-24 16:40:00 -04:00
parent 4668378d91
commit 9364e6a5b7
255 changed files with 3761 additions and 3730 deletions

View file

@ -52,7 +52,7 @@ public:
/**
* @return The enum type associated with the script-layer "Tag".
*/
const IntrusivePtr<zeek::EnumType>& GetTagType() const;
const zeek::IntrusivePtr<zeek::EnumType>& GetTagType() const;
[[deprecated("Remove in v4.1. Use GetTagType() instead.")]]
zeek::EnumType* GetTagEnumType() const;
@ -71,7 +71,7 @@ public:
* @param val A component's enum value.
* @return The canonical component name.
*/
const std::string& GetComponentName(IntrusivePtr<EnumVal> val) const;
const std::string& GetComponentName(zeek::IntrusivePtr<EnumVal> val) const;
[[deprecated("Remove in v4.1. Use IntrusivePtr argument instead.")]]
const std::string& GetComponentName(Val* val) const;
@ -128,7 +128,7 @@ public:
private:
std::string module; /**< Script layer module in which component tags live. */
IntrusivePtr<zeek::EnumType> tag_enum_type; /**< Enum type of component tags. */
zeek::IntrusivePtr<zeek::EnumType> tag_enum_type; /**< Enum type of component tags. */
std::map<std::string, C*> components_by_name;
std::map<T, C*> components_by_tag;
std::map<int, C*> components_by_val;
@ -137,7 +137,7 @@ private:
template <class T, class C>
ComponentManager<T, C>::ComponentManager(const std::string& arg_module, const std::string& local_id)
: module(arg_module),
tag_enum_type(make_intrusive<zeek::EnumType>(module + "::" + local_id))
tag_enum_type(zeek::make_intrusive<zeek::EnumType>(module + "::" + local_id))
{
auto id = install_ID(local_id.c_str(), module.c_str(), true, true);
add_type(id.get(), tag_enum_type, nullptr);
@ -163,7 +163,7 @@ std::list<C*> ComponentManager<T, C>::GetComponents() const
}
template <class T, class C>
const IntrusivePtr<zeek::EnumType>& ComponentManager<T, C>::GetTagType() const
const zeek::IntrusivePtr<zeek::EnumType>& ComponentManager<T, C>::GetTagType() const
{
return tag_enum_type;
}
@ -193,7 +193,7 @@ const std::string& ComponentManager<T, C>::GetComponentName(T tag) const
}
template <class T, class C>
const std::string& ComponentManager<T, C>::GetComponentName(IntrusivePtr<EnumVal> val) const
const std::string& ComponentManager<T, C>::GetComponentName(zeek::IntrusivePtr<EnumVal> val) const
{
return GetComponentName(T(std::move(val)));
}
@ -201,7 +201,7 @@ const std::string& ComponentManager<T, C>::GetComponentName(IntrusivePtr<EnumVal
template <class T, class C>
const std::string& ComponentManager<T, C>::GetComponentName(Val* val) const
{
return GetComponentName(T({NewRef{}, val->AsEnumVal()}));
return GetComponentName(T({zeek::NewRef{}, val->AsEnumVal()}));
}
template <class T, class C>