|
15 | 15 | #ifndef THIRD_PARTY_CEL_CPP_COMMON_TYPE_REFLECTOR_H_ |
16 | 16 | #define THIRD_PARTY_CEL_CPP_COMMON_TYPE_REFLECTOR_H_ |
17 | 17 |
|
18 | | -#include "absl/base/attributes.h" |
19 | 18 | #include "absl/base/nullability.h" |
20 | 19 | #include "absl/status/statusor.h" |
21 | | -#include "absl/strings/cord.h" |
22 | 20 | #include "absl/strings/string_view.h" |
23 | | -#include "absl/types/optional.h" |
24 | | -#include "common/memory.h" |
25 | | -#include "common/type.h" |
26 | 21 | #include "common/type_introspector.h" |
27 | 22 | #include "common/value.h" |
28 | | -#include "common/value_factory.h" |
29 | | -#include "google/protobuf/descriptor.h" |
| 23 | +#include "google/protobuf/arena.h" |
| 24 | +#include "google/protobuf/message.h" |
30 | 25 |
|
31 | 26 | namespace cel { |
32 | 27 |
|
33 | 28 | // `TypeReflector` is an interface for constructing new instances of types are |
34 | 29 | // runtime. It handles type reflection. |
35 | 30 | class TypeReflector : public virtual TypeIntrospector { |
36 | 31 | public: |
37 | | - // Legacy type reflector, will prefer builders for legacy value. |
38 | | - ABSL_DEPRECATED("Is now the same as Builtin()") |
39 | | - static TypeReflector& LegacyBuiltin() { return Builtin(); } |
40 | | - // Will prefer builders for modern values. |
41 | | - ABSL_DEPRECATED("Is now the same as Builtin()") |
42 | | - static TypeReflector& ModernBuiltin() { return Builtin(); } |
43 | | - |
44 | | - static TypeReflector& Builtin(); |
45 | | - |
46 | | - // `NewListValueBuilder` returns a new `ListValueBuilderInterface` for the |
47 | | - // corresponding `ListType` `type`. |
48 | | - absl::StatusOr<absl::Nonnull<ListValueBuilderPtr>> NewListValueBuilder( |
49 | | - ValueFactory& value_factory, const ListType& type) const; |
50 | | - |
51 | | - // `NewMapValueBuilder` returns a new `MapValueBuilderInterface` for the |
52 | | - // corresponding `MapType` `type`. |
53 | | - absl::StatusOr<absl::Nonnull<MapValueBuilderPtr>> NewMapValueBuilder( |
54 | | - ValueFactory& value_factory, const MapType& type) const; |
55 | | - |
56 | | - // `NewStructValueBuilder` returns a new `StructValueBuilder` for the |
57 | | - // corresponding `StructType` `type`. |
58 | | - virtual absl::StatusOr<absl::Nullable<StructValueBuilderPtr>> |
59 | | - NewStructValueBuilder(ValueFactory& value_factory, |
60 | | - const StructType& type) const; |
61 | | - |
62 | 32 | // `NewValueBuilder` returns a new `ValueBuilder` for the corresponding type |
63 | 33 | // `name`. It is primarily used to handle wrapper types which sometimes show |
64 | 34 | // up literally in expressions. |
65 | 35 | virtual absl::StatusOr<absl::Nullable<ValueBuilderPtr>> NewValueBuilder( |
66 | | - ValueFactory& value_factory, absl::string_view name) const; |
67 | | - |
68 | | - virtual absl::Nullable<const google::protobuf::DescriptorPool*> descriptor_pool() |
69 | | - const { |
70 | | - return nullptr; |
71 | | - } |
| 36 | + absl::string_view name, |
| 37 | + absl::Nonnull<google::protobuf::MessageFactory*> message_factory, |
| 38 | + absl::Nonnull<google::protobuf::Arena*> arena) const = 0; |
72 | 39 | }; |
73 | 40 |
|
74 | | -Shared<TypeReflector> NewThreadCompatibleTypeReflector( |
75 | | - MemoryManagerRef memory_manager); |
76 | | - |
77 | 41 | } // namespace cel |
78 | 42 |
|
79 | 43 | #endif // THIRD_PARTY_CEL_CPP_COMMON_TYPE_REFLECTOR_H_ |
0 commit comments