mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Deprecate RecordVal::Assign(int, Val*)
And adapt all usages to the existing overload taking IntrusivePtr.
This commit is contained in:
parent
d7ca63c1be
commit
f3d160d034
38 changed files with 366 additions and 332 deletions
22
src/Val.h
22
src/Val.h
|
@ -945,8 +945,30 @@ public:
|
|||
|
||||
IntrusivePtr<Val> SizeVal() const override;
|
||||
|
||||
/**
|
||||
* Assign a value to a record field.
|
||||
* @param field The field index to assign.
|
||||
* @param new_val The value to assign.
|
||||
*/
|
||||
void Assign(int field, IntrusivePtr<Val> new_val);
|
||||
|
||||
/**
|
||||
* Assign a value of type @c T to a record field, as constructed from
|
||||
* the provided arguments.
|
||||
* @param field The field index to assign.
|
||||
* @param args A variable number of arguments to pass to constructor of
|
||||
* type @c T.
|
||||
*/
|
||||
template <class T, class... Ts>
|
||||
void Assign(int field, Ts&&... args)
|
||||
{ Assign(field, make_intrusive<T>(std::forward<Ts>(args)...)); }
|
||||
|
||||
[[deprecated("Remove in v4.1. Assign an IntrusivePtr instead.")]]
|
||||
void Assign(int field, Val* new_val);
|
||||
// Note: the following nullptr method can also go upon removing the above.
|
||||
void Assign(int field, std::nullptr_t)
|
||||
{ Assign(field, IntrusivePtr<Val>{}); }
|
||||
|
||||
Val* Lookup(int field) const; // Does not Ref() value.
|
||||
IntrusivePtr<Val> LookupWithDefault(int field) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue