4040#include " google/protobuf/descriptor.h"
4141#include " google/protobuf/message.h"
4242
43+ namespace google ::api::expr::runtime {
44+ class LegacyTypeInfoApis ;
45+ }
46+
4347namespace cel {
4448
4549class Value ;
@@ -57,8 +61,12 @@ class LegacyStructValue final
5761 public:
5862 static constexpr ValueKind kKind = ValueKind::kStruct ;
5963
60- LegacyStructValue (uintptr_t message_ptr, uintptr_t type_info)
61- : message_ptr_(message_ptr), type_info_(type_info) {}
64+ LegacyStructValue (
65+ absl::NullabilityUnknown<const google::protobuf::Message*> message_ptr,
66+ absl::NullabilityUnknown<
67+ const google::api::expr::runtime::LegacyTypeInfoApis*>
68+ legacy_type_info)
69+ : message_ptr_(message_ptr), legacy_type_info_(legacy_type_info) {}
6270
6371 LegacyStructValue (const LegacyStructValue&) = default ;
6472 LegacyStructValue& operator =(const LegacyStructValue&) = default ;
@@ -98,12 +106,6 @@ class LegacyStructValue final
98106
99107 bool IsZeroValue () const ;
100108
101- void swap (LegacyStructValue& other) noexcept {
102- using std::swap;
103- swap (message_ptr_, other.message_ptr_ );
104- swap (type_info_, other.type_info_ );
105- }
106-
107109 absl::Status GetFieldByName (
108110 absl::string_view name, ProtoWrapperTypeOptions unboxing_options,
109111 absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
@@ -138,22 +140,32 @@ class LegacyStructValue final
138140 absl::Nonnull<int *> count) const ;
139141 using StructValueMixin::Qualify;
140142
141- uintptr_t message_ptr () const { return message_ptr_; }
143+ absl::NullabilityUnknown<const google::protobuf::Message*> message_ptr () const {
144+ return message_ptr_;
145+ }
146+
147+ absl::NullabilityUnknown<
148+ const google::api::expr::runtime::LegacyTypeInfoApis*>
149+ legacy_type_info () const {
150+ return legacy_type_info_;
151+ }
142152
143- uintptr_t legacy_type_info () const { return type_info_; }
153+ friend void swap (LegacyStructValue& lhs, LegacyStructValue& rhs) noexcept {
154+ using std::swap;
155+ swap (lhs.message_ptr_ , rhs.message_ptr_ );
156+ swap (lhs.legacy_type_info_ , rhs.legacy_type_info_ );
157+ }
144158
145159 private:
146160 friend class common_internal ::ValueMixin<LegacyStructValue>;
147161 friend class common_internal ::StructValueMixin<LegacyStructValue>;
148162
149- uintptr_t message_ptr_;
150- uintptr_t type_info_;
163+ absl::NullabilityUnknown<const google::protobuf::Message*> message_ptr_;
164+ absl::NullabilityUnknown<
165+ const google::api::expr::runtime::LegacyTypeInfoApis*>
166+ legacy_type_info_;
151167};
152168
153- inline void swap (LegacyStructValue& lhs, LegacyStructValue& rhs) noexcept {
154- lhs.swap (rhs);
155- }
156-
157169inline std::ostream& operator <<(std::ostream& out,
158170 const LegacyStructValue& value) {
159171 return out << value.DebugString ();
0 commit comments