mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
simplifications to the Frame class now that it no longer has to support old-style captures
This commit is contained in:
parent
82588ca311
commit
6ac348d77d
2 changed files with 9 additions and 32 deletions
22
src/Frame.h
22
src/Frame.h
|
@ -172,16 +172,11 @@ public:
|
|||
Frame* CloneForTrigger() const;
|
||||
|
||||
/**
|
||||
* Serializes the frame in support of copy semantics for lambdas:
|
||||
*
|
||||
* [ "CopyFrame", serialized_values ]
|
||||
*
|
||||
* where serialized_values are two-element vectors. A serialized_value
|
||||
* has the result of calling broker::data_to_val on the value in the
|
||||
* first index, and an integer representing that value's type in the
|
||||
* second index.
|
||||
* Serializes the frame (only done for lambda/when captures) as a
|
||||
* sequence of two-element vectors, the first element reflecting
|
||||
* the frame value, the second its type.
|
||||
*/
|
||||
broker::expected<broker::data> SerializeCopyFrame();
|
||||
broker::expected<broker::data> Serialize();
|
||||
|
||||
/**
|
||||
* Instantiates a Frame from a serialized one.
|
||||
|
@ -189,13 +184,8 @@ public:
|
|||
* @return a pair in which the first item is the status of the serialization;
|
||||
* and the second is the unserialized frame with reference count +1, or
|
||||
* null if the serialization wasn't successful.
|
||||
*
|
||||
* The *captures* argument, if non-nil, specifies that the frame
|
||||
* reflects captures with copy-semantics rather than deprecated
|
||||
* reference semantics.
|
||||
*/
|
||||
static std::pair<bool, FramePtr>
|
||||
Unserialize(const broker::vector& data, const std::optional<FuncType::CaptureList>& captures);
|
||||
static std::pair<bool, FramePtr> Unserialize(const broker::vector& data);
|
||||
|
||||
// If the frame is run in the context of a trigger condition evaluation,
|
||||
// the trigger needs to be registered.
|
||||
|
@ -246,7 +236,7 @@ private:
|
|||
*/
|
||||
int current_offset;
|
||||
|
||||
/** Frame used for captures (if any) with copy semantics. */
|
||||
/** Frame used for lambda/when captures. */
|
||||
Frame* captures;
|
||||
|
||||
/** Maps IDs to offsets into the "captures" frame. If the ID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue