mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Switch VectorVal BroValUnion to store std::vector<IntrusivePtr<Val>>
This changes the return type of AsVector() from std::vector<Val*>*
This commit is contained in:
parent
40db09ccbf
commit
69533bcbc6
5 changed files with 27 additions and 47 deletions
|
@ -81,7 +81,7 @@ union BroValUnion {
|
|||
RE_Matcher* re_val;
|
||||
PDict<TableEntryVal>* table_val;
|
||||
std::vector<IntrusivePtr<Val>>* record_val;
|
||||
std::vector<Val*>* vector_val;
|
||||
std::vector<IntrusivePtr<Val>>* vector_val;
|
||||
|
||||
BroValUnion() = default;
|
||||
|
||||
|
@ -114,9 +114,6 @@ union BroValUnion {
|
|||
|
||||
constexpr BroValUnion(PDict<TableEntryVal>* value) noexcept
|
||||
: table_val(value) {}
|
||||
|
||||
constexpr BroValUnion(std::vector<Val*> *value) noexcept
|
||||
: vector_val(value) {}
|
||||
};
|
||||
|
||||
class Val : public BroObj {
|
||||
|
@ -221,7 +218,7 @@ public:
|
|||
CONST_ACCESSOR(TYPE_RECORD, std::vector<IntrusivePtr<Val>>*, record_val, AsRecord)
|
||||
CONST_ACCESSOR(TYPE_FILE, BroFile*, file_val, AsFile)
|
||||
CONST_ACCESSOR(TYPE_PATTERN, RE_Matcher*, re_val, AsPattern)
|
||||
CONST_ACCESSOR(TYPE_VECTOR, std::vector<Val*>*, vector_val, AsVector)
|
||||
CONST_ACCESSOR(TYPE_VECTOR, std::vector<IntrusivePtr<Val>>*, vector_val, AsVector)
|
||||
|
||||
const IPPrefix& AsSubNet() const
|
||||
{
|
||||
|
@ -255,7 +252,7 @@ public:
|
|||
ACCESSOR(TYPE_FUNC, Func*, func_val, AsFunc)
|
||||
ACCESSOR(TYPE_FILE, BroFile*, file_val, AsFile)
|
||||
ACCESSOR(TYPE_PATTERN, RE_Matcher*, re_val, AsPattern)
|
||||
ACCESSOR(TYPE_VECTOR, std::vector<Val*>*, vector_val, AsVector)
|
||||
ACCESSOR(TYPE_VECTOR, std::vector<IntrusivePtr<Val>>*, vector_val, AsVector)
|
||||
|
||||
IntrusivePtr<Func> AsFuncPtr() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue