mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Integrate review feedback
This commit is contained in:
parent
6132cbd13e
commit
bd3e5bedbb
7 changed files with 23 additions and 22 deletions
|
@ -94,7 +94,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* Legacy macro to insert into an OpaqueVal-derived class's declaration. Overrides the "old" serialization methods
|
* Legacy macro to insert into an OpaqueVal-derived class's declaration. Overrides the "old" serialization methods
|
||||||
* DoSerialize and DoUnserialize.
|
* DoSerialize and DoUnserialize.
|
||||||
* @deprecated Use DECLARE_OPAQUE_VALUE_V2 instead.
|
* @deprecated Use DECLARE_OPAQUE_VALUE_DATA instead.
|
||||||
*/
|
*/
|
||||||
#define DECLARE_OPAQUE_VALUE(T) \
|
#define DECLARE_OPAQUE_VALUE(T) \
|
||||||
friend class zeek::OpaqueMgr::Register<T>; \
|
friend class zeek::OpaqueMgr::Register<T>; \
|
||||||
|
@ -108,7 +108,7 @@ private:
|
||||||
* Macro to insert into an OpaqueVal-derived class's declaration. Overrides the "new" serialization methods
|
* Macro to insert into an OpaqueVal-derived class's declaration. Overrides the "new" serialization methods
|
||||||
* DoSerializeData and DoUnserializeData.
|
* DoSerializeData and DoUnserializeData.
|
||||||
*/
|
*/
|
||||||
#define DECLARE_OPAQUE_VALUE_V2(T) \
|
#define DECLARE_OPAQUE_VALUE_DATA(T) \
|
||||||
friend class zeek::OpaqueMgr::Register<T>; \
|
friend class zeek::OpaqueMgr::Register<T>; \
|
||||||
friend zeek::IntrusivePtr<T> zeek::make_intrusive<T>(); \
|
friend zeek::IntrusivePtr<T> zeek::make_intrusive<T>(); \
|
||||||
std::optional<zeek::BrokerData> DoSerializeData() const override; \
|
std::optional<zeek::BrokerData> DoSerializeData() const override; \
|
||||||
|
@ -138,7 +138,7 @@ public:
|
||||||
* @return the broker representation, or an error if serialization
|
* @return the broker representation, or an error if serialization
|
||||||
* isn't supported or failed.
|
* isn't supported or failed.
|
||||||
*/
|
*/
|
||||||
[[deprecated("use SerializeData instead")]] broker::expected<broker::data> Serialize() const;
|
[[deprecated("Remove in v7.1: use SerializeData instead")]] broker::expected<broker::data> Serialize() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc Serialize
|
* @copydoc Serialize
|
||||||
|
@ -151,7 +151,8 @@ public:
|
||||||
* @param data Broker representation as returned by *Serialize()*.
|
* @param data Broker representation as returned by *Serialize()*.
|
||||||
* @return unserialized instances with reference count at +1
|
* @return unserialized instances with reference count at +1
|
||||||
*/
|
*/
|
||||||
[[deprecated("use UnserializeData instead")]] static OpaqueValPtr Unserialize(const broker::data& data);
|
[[deprecated("Remove in v7.1: use UnserializeData instead")]] static OpaqueValPtr Unserialize(
|
||||||
|
const broker::data& data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc Unserialize
|
* @copydoc Unserialize
|
||||||
|
@ -289,7 +290,7 @@ protected:
|
||||||
bool DoFeed(const void* data, size_t size) override;
|
bool DoFeed(const void* data, size_t size) override;
|
||||||
StringValPtr DoGet() override;
|
StringValPtr DoGet() override;
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(MD5Val)
|
DECLARE_OPAQUE_VALUE_DATA(MD5Val)
|
||||||
private:
|
private:
|
||||||
StatePtr ctx = nullptr;
|
StatePtr ctx = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -317,7 +318,7 @@ protected:
|
||||||
bool DoFeed(const void* data, size_t size) override;
|
bool DoFeed(const void* data, size_t size) override;
|
||||||
StringValPtr DoGet() override;
|
StringValPtr DoGet() override;
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(SHA1Val)
|
DECLARE_OPAQUE_VALUE_DATA(SHA1Val)
|
||||||
private:
|
private:
|
||||||
StatePtr ctx = nullptr;
|
StatePtr ctx = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -345,7 +346,7 @@ protected:
|
||||||
bool DoFeed(const void* data, size_t size) override;
|
bool DoFeed(const void* data, size_t size) override;
|
||||||
StringValPtr DoGet() override;
|
StringValPtr DoGet() override;
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(SHA256Val)
|
DECLARE_OPAQUE_VALUE_DATA(SHA256Val)
|
||||||
private:
|
private:
|
||||||
StatePtr ctx = nullptr;
|
StatePtr ctx = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -360,7 +361,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
friend class Val;
|
friend class Val;
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(EntropyVal)
|
DECLARE_OPAQUE_VALUE_DATA(EntropyVal)
|
||||||
private:
|
private:
|
||||||
detail::RandTest state;
|
detail::RandTest state;
|
||||||
};
|
};
|
||||||
|
@ -390,7 +391,7 @@ protected:
|
||||||
friend class Val;
|
friend class Val;
|
||||||
BloomFilterVal();
|
BloomFilterVal();
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(BloomFilterVal)
|
DECLARE_OPAQUE_VALUE_DATA(BloomFilterVal)
|
||||||
private:
|
private:
|
||||||
// Disable.
|
// Disable.
|
||||||
BloomFilterVal(const BloomFilterVal&);
|
BloomFilterVal(const BloomFilterVal&);
|
||||||
|
@ -419,7 +420,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
CardinalityVal();
|
CardinalityVal();
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(CardinalityVal)
|
DECLARE_OPAQUE_VALUE_DATA(CardinalityVal)
|
||||||
private:
|
private:
|
||||||
TypePtr type;
|
TypePtr type;
|
||||||
detail::CompositeHash* hash;
|
detail::CompositeHash* hash;
|
||||||
|
@ -436,7 +437,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
ParaglobVal() : OpaqueVal(paraglob_type) {}
|
ParaglobVal() : OpaqueVal(paraglob_type) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(ParaglobVal)
|
DECLARE_OPAQUE_VALUE_DATA(ParaglobVal)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<paraglob::Paraglob> internal_paraglob;
|
std::unique_ptr<paraglob::Paraglob> internal_paraglob;
|
||||||
|
|
|
@ -125,7 +125,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
DataVal() : OpaqueVal(opaque_of_data_type) {}
|
DataVal() : OpaqueVal(opaque_of_data_type) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(zeek::Broker::detail::DataVal)
|
DECLARE_OPAQUE_VALUE_DATA(zeek::Broker::detail::DataVal)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -222,7 +222,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
SetIterator() : zeek::OpaqueVal(opaque_of_set_iterator) {}
|
SetIterator() : zeek::OpaqueVal(opaque_of_set_iterator) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(zeek::Broker::detail::SetIterator)
|
DECLARE_OPAQUE_VALUE_DATA(zeek::Broker::detail::SetIterator)
|
||||||
};
|
};
|
||||||
|
|
||||||
class TableIterator : public zeek::OpaqueVal {
|
class TableIterator : public zeek::OpaqueVal {
|
||||||
|
@ -238,7 +238,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
TableIterator() : zeek::OpaqueVal(opaque_of_table_iterator) {}
|
TableIterator() : zeek::OpaqueVal(opaque_of_table_iterator) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(zeek::Broker::detail::TableIterator)
|
DECLARE_OPAQUE_VALUE_DATA(zeek::Broker::detail::TableIterator)
|
||||||
};
|
};
|
||||||
|
|
||||||
class VectorIterator : public zeek::OpaqueVal {
|
class VectorIterator : public zeek::OpaqueVal {
|
||||||
|
@ -254,7 +254,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
VectorIterator() : zeek::OpaqueVal(opaque_of_vector_iterator) {}
|
VectorIterator() : zeek::OpaqueVal(opaque_of_vector_iterator) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(zeek::Broker::detail::VectorIterator)
|
DECLARE_OPAQUE_VALUE_DATA(zeek::Broker::detail::VectorIterator)
|
||||||
};
|
};
|
||||||
|
|
||||||
class RecordIterator : public zeek::OpaqueVal {
|
class RecordIterator : public zeek::OpaqueVal {
|
||||||
|
@ -270,7 +270,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
RecordIterator() : zeek::OpaqueVal(opaque_of_record_iterator) {}
|
RecordIterator() : zeek::OpaqueVal(opaque_of_record_iterator) {}
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(zeek::Broker::detail::RecordIterator)
|
DECLARE_OPAQUE_VALUE_DATA(zeek::Broker::detail::RecordIterator)
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace zeek::Broker::detail
|
} // namespace zeek::Broker::detail
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
IntrusivePtr<Val> DoClone(CloneState* state) override { return {NewRef{}, this}; }
|
IntrusivePtr<Val> DoClone(CloneState* state) override { return {NewRef{}, this}; }
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(StoreHandleVal)
|
DECLARE_OPAQUE_VALUE_DATA(StoreHandleVal)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper function to construct a broker backend type from script land.
|
// Helper function to construct a broker backend type from script land.
|
||||||
|
|
|
@ -184,7 +184,7 @@ protected:
|
||||||
*/
|
*/
|
||||||
X509Val();
|
X509Val();
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(X509Val)
|
DECLARE_OPAQUE_VALUE_DATA(X509Val)
|
||||||
private:
|
private:
|
||||||
::X509* certificate; // the wrapped certificate
|
::X509* certificate; // the wrapped certificate
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit LogDelayTokenVal() : LogDelayTokenVal(0) {}
|
explicit LogDelayTokenVal() : LogDelayTokenVal(0) {}
|
||||||
DECLARE_OPAQUE_VALUE_V2(LogDelayTokenVal)
|
DECLARE_OPAQUE_VALUE_DATA(LogDelayTokenVal)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DelayTokenType token;
|
DelayTokenType token;
|
||||||
|
|
|
@ -105,8 +105,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual std::string InternalState() const = 0;
|
virtual std::string InternalState() const = 0;
|
||||||
|
|
||||||
[[deprecated("use SerializeData instead")]] broker::expected<broker::data> Serialize() const;
|
[[deprecated("Remove in v7.1: use SerializeData instead")]] broker::expected<broker::data> Serialize() const;
|
||||||
[[deprecated("use UnserializeData instead")]] static std::unique_ptr<BloomFilter> Unserialize(
|
[[deprecated("Remove in v7.1: use UnserializeData instead")]] static std::unique_ptr<BloomFilter> Unserialize(
|
||||||
const broker::data& data);
|
const broker::data& data);
|
||||||
std::optional<BrokerData> SerializeData() const;
|
std::optional<BrokerData> SerializeData() const;
|
||||||
static std::unique_ptr<BloomFilter> UnserializeData(BrokerDataView data);
|
static std::unique_ptr<BloomFilter> UnserializeData(BrokerDataView data);
|
||||||
|
|
|
@ -132,7 +132,7 @@ public:
|
||||||
*/
|
*/
|
||||||
ValPtr DoClone(CloneState* state) override;
|
ValPtr DoClone(CloneState* state) override;
|
||||||
|
|
||||||
DECLARE_OPAQUE_VALUE_V2(TopkVal)
|
DECLARE_OPAQUE_VALUE_DATA(TopkVal)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue