mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
make DoDescribe protected for a tidier interface
mark use of DESC_PORTABLE as deprecated
This commit is contained in:
parent
cbb18207dc
commit
d75d1715a9
2 changed files with 22 additions and 10 deletions
|
@ -22,6 +22,10 @@ namespace zeek
|
|||
|
||||
ODesc::ODesc(DescType t, File* arg_f)
|
||||
{
|
||||
if ( t == DESC_PORTABLE )
|
||||
zeek::reporter->Warning(
|
||||
"use of DESC_PORTABLE \"Describe\" format is deprecated with Zeek 5.0");
|
||||
|
||||
type = t;
|
||||
style = STANDARD_STYLE;
|
||||
f = arg_f;
|
||||
|
|
28
src/Type.h
28
src/Type.h
|
@ -249,7 +249,6 @@ public:
|
|||
}
|
||||
|
||||
void Describe(ODesc* d) const override;
|
||||
virtual void DoDescribe(ODesc* d) const;
|
||||
virtual void DescribeReST(ODesc* d, bool roles_only = false) const;
|
||||
|
||||
[[deprecated("Remove in v5.1. MemoryAllocation() is deprecated and will be removed. See "
|
||||
|
@ -307,6 +306,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
virtual void DoDescribe(ODesc* d) const;
|
||||
|
||||
Type() = default;
|
||||
|
||||
void SetError();
|
||||
|
@ -348,13 +349,13 @@ public:
|
|||
void Append(TypePtr t);
|
||||
void AppendEvenIfNotPure(TypePtr t);
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
[[deprecated("Remove in v5.1. MemoryAllocation() is deprecated and will be removed. See "
|
||||
"GHI-572.")]] unsigned int
|
||||
MemoryAllocation() const override;
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
TypePtr pure_type;
|
||||
std::vector<TypePtr> types;
|
||||
};
|
||||
|
@ -370,7 +371,6 @@ public:
|
|||
|
||||
const TypePtr& Yield() const override { return yield_type; }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
// Returns true if this table is solely indexed by subnet.
|
||||
|
@ -384,6 +384,8 @@ protected:
|
|||
|
||||
~IndexType() override = default;
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
TypeListPtr indices;
|
||||
TypePtr yield_type;
|
||||
};
|
||||
|
@ -475,7 +477,6 @@ public:
|
|||
|
||||
const TypeListPtr& ParamList() const { return arg_types; }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
/**
|
||||
|
@ -536,6 +537,9 @@ protected:
|
|||
friend FuncTypePtr make_intrusive<FuncType>();
|
||||
|
||||
FuncType() : Type(TYPE_FUNC) { flavor = FUNC_FLAVOR_FUNCTION; }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
RecordTypePtr args;
|
||||
TypeListPtr arg_types;
|
||||
TypePtr yield;
|
||||
|
@ -676,7 +680,6 @@ public:
|
|||
*/
|
||||
void Create(std::vector<std::optional<ZVal>>& r) const;
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
void DescribeFields(ODesc* d) const;
|
||||
void DescribeFieldsReST(ODesc* d, bool func_args) const;
|
||||
|
@ -700,6 +703,8 @@ protected:
|
|||
|
||||
void AddField(unsigned int field, const TypeDecl* td);
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
// Maps each field to how to initialize it. Uses pointers due to
|
||||
// keeping the FieldInit definition private to Type.cc (see above).
|
||||
std::vector<FieldInit*> field_inits;
|
||||
|
@ -726,9 +731,9 @@ public:
|
|||
|
||||
const TypePtr& Yield() const override { return yield; }
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
protected:
|
||||
TypePtr yield;
|
||||
};
|
||||
|
||||
|
@ -741,12 +746,13 @@ public:
|
|||
|
||||
const std::string& Name() const { return name; }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
protected:
|
||||
OpaqueType() { }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
@ -784,7 +790,6 @@ public:
|
|||
|
||||
bool HasRedefs() const { return has_redefs; }
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
const EnumValPtr& GetEnumVal(bro_int_t i);
|
||||
|
@ -802,6 +807,8 @@ protected:
|
|||
bool is_export, detail::Expr* deprecation = nullptr,
|
||||
bool from_redef = false);
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
using NameMap = std::map<std::string, bro_int_t>;
|
||||
NameMap names;
|
||||
|
||||
|
@ -835,10 +842,11 @@ public:
|
|||
// gets using an empty "vector()" constructor.
|
||||
bool IsUnspecifiedVector() const;
|
||||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
TypePtr yield_type;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue