mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
support for constructing VectorVal's directly from underlying ZVal vectors
This commit is contained in:
parent
fb01f6fdef
commit
e06d988bfd
2 changed files with 10 additions and 2 deletions
10
src/Val.cc
10
src/Val.cc
|
@ -3223,9 +3223,15 @@ ValPtr TypeVal::DoClone(CloneState* state)
|
||||||
return {NewRef{}, this};
|
return {NewRef{}, this};
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorVal::VectorVal(VectorTypePtr t) : Val(t)
|
VectorVal::VectorVal(VectorTypePtr t) :
|
||||||
|
VectorVal(t, new vector<std::optional<ZVal>>())
|
||||||
{
|
{
|
||||||
vector_val = new vector<std::optional<ZVal>>();
|
}
|
||||||
|
|
||||||
|
VectorVal::VectorVal(VectorTypePtr t, std::vector<std::optional<ZVal>>* vals)
|
||||||
|
: Val(t)
|
||||||
|
{
|
||||||
|
vector_val = vals;
|
||||||
yield_type = t->Yield();
|
yield_type = t->Yield();
|
||||||
|
|
||||||
auto y_tag = yield_type->Tag();
|
auto y_tag = yield_type->Tag();
|
||||||
|
|
|
@ -1473,6 +1473,8 @@ protected:
|
||||||
class VectorVal final : public Val, public notifier::detail::Modifiable {
|
class VectorVal final : public Val, public notifier::detail::Modifiable {
|
||||||
public:
|
public:
|
||||||
explicit VectorVal(VectorTypePtr t);
|
explicit VectorVal(VectorTypePtr t);
|
||||||
|
VectorVal(VectorTypePtr t, std::vector<std::optional<ZVal>>* vals);
|
||||||
|
|
||||||
~VectorVal() override;
|
~VectorVal() override;
|
||||||
|
|
||||||
ValPtr SizeVal() const override;
|
ValPtr SizeVal() const override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue