Use type aliases for IntrusivePtr definitions

This commit is contained in:
Tim Wojtulewicz 2020-06-24 16:46:34 -04:00
parent f6a251cdac
commit ec9eff0bd5
180 changed files with 2026 additions and 1893 deletions

View file

@ -18,12 +18,18 @@
class RecordVal;
namespace zeek { class Type; }
namespace zeek {
class Type;
using TypePtr = zeek::IntrusivePtr<zeek::Type>;
}
using BroType [[deprecated("Remove in v4.1. Use zeek::Type instead.")]] = zeek::Type;
ZEEK_FORWARD_DECLARE_NAMESPACED(PrintStmt, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(Attributes, zeek::detail);
class BroFile;
using BroFilePtr = zeek::IntrusivePtr<BroFile>;
class BroFile final : public BroObj {
public:
explicit BroFile(FILE* arg_f);
@ -45,7 +51,7 @@ public:
[[deprecated("Remove in v4.1. Use GetType().")]]
zeek::Type* FType() const { return t.get(); }
const zeek::IntrusivePtr<zeek::Type>& GetType() const
const zeek::TypePtr& GetType() const
{ return t; }
// Whether the file is open in a general sense; it might
@ -72,7 +78,7 @@ public:
static void CloseOpenFiles();
// Get the file with the given name, opening it if it doesn't yet exist.
static zeek::IntrusivePtr<BroFile> Get(const char* name);
static BroFilePtr Get(const char* name);
[[deprecated("Remove in v4.1. Use BroFile::Get().")]]
static BroFile* GetFile(const char* name)
{ return Get(name).release(); }
@ -106,7 +112,7 @@ protected:
void RaiseOpenEvent();
FILE* f;
zeek::IntrusivePtr<zeek::Type> t;
zeek::TypePtr t;
char* name;
char* access;
zeek::detail::Attributes* attrs;