mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Deprecate ID::AsType(), add ID::IsType() and ID::GetType()
This commit is contained in:
parent
f26904e031
commit
6e647416d5
10 changed files with 32 additions and 22 deletions
12
src/ID.h
12
src/ID.h
|
@ -37,13 +37,23 @@ public:
|
|||
std::string ModuleName() const;
|
||||
|
||||
void SetType(IntrusivePtr<BroType> t);
|
||||
|
||||
BroType* Type() { return type.get(); }
|
||||
const BroType* Type() const { return type.get(); }
|
||||
|
||||
void MakeType() { is_type = true; }
|
||||
const IntrusivePtr<BroType>& GetType() const
|
||||
{ return type; }
|
||||
|
||||
[[deprecated("Remove in v4.1. Use IsType() and GetType().")]]
|
||||
BroType* AsType() { return is_type ? Type() : nullptr; }
|
||||
[[deprecated("Remove in v4.1. Use IsType() and GetType().")]]
|
||||
const BroType* AsType() const { return is_type ? Type() : nullptr; }
|
||||
|
||||
bool IsType() const
|
||||
{ return is_type; }
|
||||
|
||||
void MakeType() { is_type = true; }
|
||||
|
||||
// If weak_ref is false, the Val is assumed to be already ref'ed
|
||||
// and will be deref'ed when the ID is deleted.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue