MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ParsedMapFieldValue

Class ParsedMapFieldValue

common/values/parsed_map_field_value.h:52–223  ·  view source on GitHub ↗

ParsedMapFieldValue is a MapValue over a map field of a parsed protocol buffer message.

Source from the content-addressed store, hash-verified

50// ParsedMapFieldValue is a MapValue over a map field of a parsed protocol
51// buffer message.
52class ParsedMapFieldValue final
53 : private common_internal::MapValueMixin<ParsedMapFieldValue> {
54 public:
55 static constexpr ValueKind kKind = ValueKind::kMap;
56 static constexpr absl::string_view kName = "map";
57
58 ParsedMapFieldValue(const google::protobuf::Message* absl_nonnull message,
59 const google::protobuf::FieldDescriptor* absl_nonnull field,
60 google::protobuf::Arena* absl_nonnull arena)
61 : message_(message), field_(field), arena_(arena) {
62 ABSL_DCHECK(message != nullptr);
63 ABSL_DCHECK(field != nullptr);
64 ABSL_DCHECK(arena != nullptr);
65 ABSL_DCHECK(field_->is_map())
66 << field_->full_name() << " must be a map field";
67 ABSL_DCHECK_OK(CheckArena(message_, arena_));
68 }
69
70 // Places the `ParsedMapFieldValue` into an invalid state. Anything
71 // except assigning to `ParsedMapFieldValue` is undefined behavior.
72 ParsedMapFieldValue() = default;
73
74 ParsedMapFieldValue(const ParsedMapFieldValue&) = default;
75 ParsedMapFieldValue(ParsedMapFieldValue&&) = default;
76 ParsedMapFieldValue& operator=(const ParsedMapFieldValue&) = default;
77 ParsedMapFieldValue& operator=(ParsedMapFieldValue&&) = default;
78
79 static constexpr ValueKind kind() { return kKind; }
80
81 static constexpr absl::string_view GetTypeName() { return kName; }
82
83 static MapType GetRuntimeType() { return MapType(); }
84
85 std::string DebugString() const;
86
87 // See Value::SerializeTo().
88 absl::Status SerializeTo(
89 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
90 google::protobuf::MessageFactory* absl_nonnull message_factory,
91 google::protobuf::io::ZeroCopyOutputStream* absl_nonnull output) const;
92
93 // See Value::ConvertToJson().
94 absl::Status ConvertToJson(
95 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
96 google::protobuf::MessageFactory* absl_nonnull message_factory,
97 google::protobuf::Message* absl_nonnull json) const;
98
99 // See Value::ConvertToJsonObject().
100 absl::Status ConvertToJsonObject(
101 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
102 google::protobuf::MessageFactory* absl_nonnull message_factory,
103 google::protobuf::Message* absl_nonnull json) const;
104
105 absl::Status Equal(const Value& other,
106 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
107 google::protobuf::MessageFactory* absl_nonnull message_factory,
108 google::protobuf::Arena* absl_nonnull arena,
109 Value* absl_nonnull result) const;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected