/src/protobuf_install/include/google/protobuf/map_entry.h
Line | Count | Source |
1 | | // Protocol Buffers - Google's data interchange format |
2 | | // Copyright 2008 Google Inc. All rights reserved. |
3 | | // https://developers.google.com/protocol-buffers/ |
4 | | // |
5 | | // Redistribution and use in source and binary forms, with or without |
6 | | // modification, are permitted provided that the following conditions are |
7 | | // met: |
8 | | // |
9 | | // * Redistributions of source code must retain the above copyright |
10 | | // notice, this list of conditions and the following disclaimer. |
11 | | // * Redistributions in binary form must reproduce the above |
12 | | // copyright notice, this list of conditions and the following disclaimer |
13 | | // in the documentation and/or other materials provided with the |
14 | | // distribution. |
15 | | // * Neither the name of Google Inc. nor the names of its |
16 | | // contributors may be used to endorse or promote products derived from |
17 | | // this software without specific prior written permission. |
18 | | // |
19 | | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 | | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 | | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 | | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 | | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 | | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 | | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 | | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | | |
31 | | #ifndef GOOGLE_PROTOBUF_MAP_ENTRY_H__ |
32 | | #define GOOGLE_PROTOBUF_MAP_ENTRY_H__ |
33 | | |
34 | | #include <google/protobuf/port.h> |
35 | | #include <google/protobuf/generated_message_reflection.h> |
36 | | #include <google/protobuf/map_entry_lite.h> |
37 | | #include <google/protobuf/map_type_handler.h> |
38 | | #include <google/protobuf/reflection_ops.h> |
39 | | #include <google/protobuf/unknown_field_set.h> |
40 | | #include <google/protobuf/wire_format_lite.h> |
41 | | |
42 | | // Must be included last. |
43 | | #include <google/protobuf/port_def.inc> |
44 | | |
45 | | #ifdef SWIG |
46 | | #error "You cannot SWIG proto headers" |
47 | | #endif |
48 | | |
49 | | namespace google { |
50 | | namespace protobuf { |
51 | | class Arena; |
52 | | namespace internal { |
53 | | template <typename Derived, typename Key, typename Value, |
54 | | WireFormatLite::FieldType kKeyFieldType, |
55 | | WireFormatLite::FieldType kValueFieldType> |
56 | | class MapField; |
57 | | } |
58 | | } // namespace protobuf |
59 | | } // namespace google |
60 | | |
61 | | namespace google { |
62 | | namespace protobuf { |
63 | | namespace internal { |
64 | | |
65 | | // MapEntry is the returned google::protobuf::Message when calling AddMessage of |
66 | | // google::protobuf::Reflection. In order to let it work with generated message |
67 | | // reflection, its in-memory type is the same as generated message with the same |
68 | | // fields. However, in order to decide the in-memory type of key/value, we need |
69 | | // to know both their cpp type in generated api and proto type. In |
70 | | // implementation, all in-memory types have related wire format functions to |
71 | | // support except ArenaStringPtr. Therefore, we need to define another type with |
72 | | // supporting wire format functions. Since this type is only used as return type |
73 | | // of MapEntry accessors, it's named MapEntry accessor type. |
74 | | // |
75 | | // cpp type: the type visible to users in public API. |
76 | | // proto type: WireFormatLite::FieldType of the field. |
77 | | // in-memory type: type of the data member used to stored this field. |
78 | | // MapEntry accessor type: type used in MapEntry getters/mutators to access the |
79 | | // field. |
80 | | // |
81 | | // cpp type | proto type | in-memory type | MapEntry accessor type |
82 | | // int32_t TYPE_INT32 int32_t int32_t |
83 | | // int32_t TYPE_FIXED32 int32_t int32_t |
84 | | // string TYPE_STRING ArenaStringPtr string |
85 | | // FooEnum TYPE_ENUM int int |
86 | | // FooMessage TYPE_MESSAGE FooMessage* FooMessage |
87 | | // |
88 | | // The in-memory types of primitive types can be inferred from its proto type, |
89 | | // while we need to explicitly specify the cpp type if proto type is |
90 | | // TYPE_MESSAGE to infer the in-memory type. |
91 | | template <typename Derived, typename Key, typename Value, |
92 | | WireFormatLite::FieldType kKeyFieldType, |
93 | | WireFormatLite::FieldType kValueFieldType> |
94 | | class MapEntry : public MapEntryImpl<Derived, Message, Key, Value, |
95 | | kKeyFieldType, kValueFieldType> { |
96 | | public: |
97 | 0 | constexpr MapEntry() {}Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::SystemState_NodeStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry() Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_DaemonStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry() Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_TargetStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry() |
98 | | explicit MapEntry(Arena* arena) |
99 | 215k | : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, |
100 | 215k | kValueFieldType>(arena) {}google::protobuf::internal::MapEntry<safepower_agent_proto::SystemState_NodeStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry(google::protobuf::Arena*) Line | Count | Source | 99 | 62.8k | : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, | 100 | 62.8k | kValueFieldType>(arena) {} |
google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_DaemonStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry(google::protobuf::Arena*) Line | Count | Source | 99 | 92.2k | : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, | 100 | 92.2k | kValueFieldType>(arena) {} |
google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_TargetStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::MapEntry(google::protobuf::Arena*) Line | Count | Source | 99 | 59.9k | : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, | 100 | 59.9k | kValueFieldType>(arena) {} |
|
101 | 215k | ~MapEntry() override { |
102 | 215k | Message::_internal_metadata_.template Delete<UnknownFieldSet>(); |
103 | 215k | } google::protobuf::internal::MapEntry<safepower_agent_proto::SystemState_NodeStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::~MapEntry() Line | Count | Source | 101 | 62.8k | ~MapEntry() override { | 102 | 62.8k | Message::_internal_metadata_.template Delete<UnknownFieldSet>(); | 103 | 62.8k | } |
google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_DaemonStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::~MapEntry() Line | Count | Source | 101 | 92.2k | ~MapEntry() override { | 102 | 92.2k | Message::_internal_metadata_.template Delete<UnknownFieldSet>(); | 103 | 92.2k | } |
google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_TargetStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::~MapEntry() Line | Count | Source | 101 | 59.9k | ~MapEntry() override { | 102 | 59.9k | Message::_internal_metadata_.template Delete<UnknownFieldSet>(); | 103 | 59.9k | } |
|
104 | | typedef void InternalArenaConstructable_; |
105 | | typedef void DestructorSkippable_; |
106 | | |
107 | | typedef typename MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, |
108 | | kValueFieldType>::KeyTypeHandler KeyTypeHandler; |
109 | | typedef |
110 | | typename MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType, |
111 | | kValueFieldType>::ValueTypeHandler ValueTypeHandler; |
112 | 0 | size_t SpaceUsedLong() const override { |
113 | 0 | size_t size = sizeof(Derived); |
114 | 0 | size += KeyTypeHandler::SpaceUsedInMapEntryLong(this->key_); |
115 | 0 | size += ValueTypeHandler::SpaceUsedInMapEntryLong(this->value_); |
116 | 0 | return size; |
117 | 0 | } Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::SystemState_NodeStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::SpaceUsedLong() const Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_DaemonStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::SpaceUsedLong() const Unexecuted instantiation: google::protobuf::internal::MapEntry<safepower_agent_proto::NodeState_TargetStateEntry_DoNotUse, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState, (google::protobuf::internal::WireFormatLite::FieldType)9, (google::protobuf::internal::WireFormatLite::FieldType)11>::SpaceUsedLong() const |
118 | | |
119 | | private: |
120 | | friend class ::PROTOBUF_NAMESPACE_ID::Arena; |
121 | | template <typename C, typename K, typename V, |
122 | | WireFormatLite::FieldType k_wire_type, WireFormatLite::FieldType> |
123 | | friend class internal::MapField; |
124 | | |
125 | | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntry); |
126 | | }; |
127 | | |
128 | | } // namespace internal |
129 | | } // namespace protobuf |
130 | | } // namespace google |
131 | | |
132 | | #include <google/protobuf/port_undef.inc> |
133 | | |
134 | | #endif // GOOGLE_PROTOBUF_MAP_ENTRY_H__ |