/src/brpc/build/brpc/nshead_meta.pb.cc
Line | Count | Source |
1 | | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | | // source: brpc/nshead_meta.proto |
3 | | |
4 | | #include "brpc/nshead_meta.pb.h" |
5 | | |
6 | | #include <algorithm> |
7 | | |
8 | | #include <google/protobuf/io/coded_stream.h> |
9 | | #include <google/protobuf/extension_set.h> |
10 | | #include <google/protobuf/wire_format_lite.h> |
11 | | #include <google/protobuf/descriptor.h> |
12 | | #include <google/protobuf/generated_message_reflection.h> |
13 | | #include <google/protobuf/reflection_ops.h> |
14 | | #include <google/protobuf/wire_format.h> |
15 | | // @@protoc_insertion_point(includes) |
16 | | #include <google/protobuf/port_def.inc> |
17 | | |
18 | | PROTOBUF_PRAGMA_INIT_SEG |
19 | | |
20 | | namespace _pb = ::PROTOBUF_NAMESPACE_ID; |
21 | | namespace _pbi = _pb::internal; |
22 | | |
23 | | namespace brpc { |
24 | | PROTOBUF_CONSTEXPR NsheadMeta::NsheadMeta( |
25 | | ::_pbi::ConstantInitialized): _impl_{ |
26 | | /*decltype(_impl_._has_bits_)*/{} |
27 | | , /*decltype(_impl_._cached_size_)*/{} |
28 | | , /*decltype(_impl_.full_method_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} |
29 | | , /*decltype(_impl_.user_string_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} |
30 | | , /*decltype(_impl_.correlation_id_)*/int64_t{0} |
31 | | , /*decltype(_impl_.log_id_)*/int64_t{0} |
32 | | , /*decltype(_impl_.attachment_size_)*/0 |
33 | | , /*decltype(_impl_.compress_type_)*/0 |
34 | | , /*decltype(_impl_.trace_id_)*/int64_t{0} |
35 | | , /*decltype(_impl_.span_id_)*/int64_t{0} |
36 | | , /*decltype(_impl_.parent_span_id_)*/int64_t{0}} {} |
37 | | struct NsheadMetaDefaultTypeInternal { |
38 | | PROTOBUF_CONSTEXPR NsheadMetaDefaultTypeInternal() |
39 | 0 | : _instance(::_pbi::ConstantInitialized{}) {} |
40 | 0 | ~NsheadMetaDefaultTypeInternal() {} |
41 | | union { |
42 | | NsheadMeta _instance; |
43 | | }; |
44 | | }; |
45 | | PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NsheadMetaDefaultTypeInternal _NsheadMeta_default_instance_; |
46 | | } // namespace brpc |
47 | | static ::_pb::Metadata file_level_metadata_brpc_2fnshead_5fmeta_2eproto[1]; |
48 | | static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_brpc_2fnshead_5fmeta_2eproto = nullptr; |
49 | | static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_brpc_2fnshead_5fmeta_2eproto = nullptr; |
50 | | |
51 | | const uint32_t TableStruct_brpc_2fnshead_5fmeta_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
52 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_._has_bits_), |
53 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _internal_metadata_), |
54 | | ~0u, // no _extensions_ |
55 | | ~0u, // no _oneof_case_ |
56 | | ~0u, // no _weak_field_map_ |
57 | | ~0u, // no _inlined_string_donated_ |
58 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.full_method_name_), |
59 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.correlation_id_), |
60 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.log_id_), |
61 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.attachment_size_), |
62 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.compress_type_), |
63 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.trace_id_), |
64 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.span_id_), |
65 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.parent_span_id_), |
66 | | PROTOBUF_FIELD_OFFSET(::brpc::NsheadMeta, _impl_.user_string_), |
67 | | 0, |
68 | | 2, |
69 | | 3, |
70 | | 4, |
71 | | 5, |
72 | | 6, |
73 | | 7, |
74 | | 8, |
75 | | 1, |
76 | | }; |
77 | | static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
78 | | { 0, 15, -1, sizeof(::brpc::NsheadMeta)}, |
79 | | }; |
80 | | |
81 | | static const ::_pb::Message* const file_default_instances[] = { |
82 | | &::brpc::_NsheadMeta_default_instance_._instance, |
83 | | }; |
84 | | |
85 | | const char descriptor_table_protodef_brpc_2fnshead_5fmeta_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
86 | | "\n\026brpc/nshead_meta.proto\022\004brpc\032\022brpc/opt" |
87 | | "ions.proto\"\342\001\n\nNsheadMeta\022\030\n\020full_method" |
88 | | "_name\030\001 \002(\t\022\026\n\016correlation_id\030\002 \001(\003\022\016\n\006l" |
89 | | "og_id\030\003 \001(\003\022\027\n\017attachment_size\030\004 \001(\005\022)\n\r" |
90 | | "compress_type\030\005 \001(\0162\022.brpc.CompressType\022" |
91 | | "\020\n\010trace_id\030\006 \001(\003\022\017\n\007span_id\030\007 \001(\003\022\026\n\016pa" |
92 | | "rent_span_id\030\010 \001(\003\022\023\n\013user_string\030\t \001(\014B" |
93 | | "\027\n\010com.brpcB\013NsheadProto" |
94 | | ; |
95 | | static const ::_pbi::DescriptorTable* const descriptor_table_brpc_2fnshead_5fmeta_2eproto_deps[1] = { |
96 | | &::descriptor_table_brpc_2foptions_2eproto, |
97 | | }; |
98 | | static ::_pbi::once_flag descriptor_table_brpc_2fnshead_5fmeta_2eproto_once; |
99 | | const ::_pbi::DescriptorTable descriptor_table_brpc_2fnshead_5fmeta_2eproto = { |
100 | | false, false, 304, descriptor_table_protodef_brpc_2fnshead_5fmeta_2eproto, |
101 | | "brpc/nshead_meta.proto", |
102 | | &descriptor_table_brpc_2fnshead_5fmeta_2eproto_once, descriptor_table_brpc_2fnshead_5fmeta_2eproto_deps, 1, 1, |
103 | | schemas, file_default_instances, TableStruct_brpc_2fnshead_5fmeta_2eproto::offsets, |
104 | | file_level_metadata_brpc_2fnshead_5fmeta_2eproto, file_level_enum_descriptors_brpc_2fnshead_5fmeta_2eproto, |
105 | | file_level_service_descriptors_brpc_2fnshead_5fmeta_2eproto, |
106 | | }; |
107 | 0 | PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_brpc_2fnshead_5fmeta_2eproto_getter() { |
108 | 0 | return &descriptor_table_brpc_2fnshead_5fmeta_2eproto; |
109 | 0 | } |
110 | | |
111 | | // Force running AddDescriptors() at dynamic initialization time. |
112 | | PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_brpc_2fnshead_5fmeta_2eproto(&descriptor_table_brpc_2fnshead_5fmeta_2eproto); |
113 | | namespace brpc { |
114 | | |
115 | | // =================================================================== |
116 | | |
117 | | class NsheadMeta::_Internal { |
118 | | public: |
119 | | using HasBits = decltype(std::declval<NsheadMeta>()._impl_._has_bits_); |
120 | 0 | static void set_has_full_method_name(HasBits* has_bits) { |
121 | 0 | (*has_bits)[0] |= 1u; |
122 | 0 | } |
123 | 0 | static void set_has_correlation_id(HasBits* has_bits) { |
124 | 0 | (*has_bits)[0] |= 4u; |
125 | 0 | } |
126 | 0 | static void set_has_log_id(HasBits* has_bits) { |
127 | 0 | (*has_bits)[0] |= 8u; |
128 | 0 | } |
129 | 0 | static void set_has_attachment_size(HasBits* has_bits) { |
130 | 0 | (*has_bits)[0] |= 16u; |
131 | 0 | } |
132 | 0 | static void set_has_compress_type(HasBits* has_bits) { |
133 | 0 | (*has_bits)[0] |= 32u; |
134 | 0 | } |
135 | 0 | static void set_has_trace_id(HasBits* has_bits) { |
136 | 0 | (*has_bits)[0] |= 64u; |
137 | 0 | } |
138 | 0 | static void set_has_span_id(HasBits* has_bits) { |
139 | 0 | (*has_bits)[0] |= 128u; |
140 | 0 | } |
141 | 0 | static void set_has_parent_span_id(HasBits* has_bits) { |
142 | 0 | (*has_bits)[0] |= 256u; |
143 | 0 | } |
144 | 0 | static void set_has_user_string(HasBits* has_bits) { |
145 | 0 | (*has_bits)[0] |= 2u; |
146 | 0 | } |
147 | 0 | static bool MissingRequiredFields(const HasBits& has_bits) { |
148 | 0 | return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; |
149 | 0 | } |
150 | | }; |
151 | | |
152 | | NsheadMeta::NsheadMeta(::PROTOBUF_NAMESPACE_ID::Arena* arena, |
153 | | bool is_message_owned) |
154 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { |
155 | 0 | SharedCtor(arena, is_message_owned); |
156 | | // @@protoc_insertion_point(arena_constructor:brpc.NsheadMeta) |
157 | 0 | } |
158 | | NsheadMeta::NsheadMeta(const NsheadMeta& from) |
159 | 0 | : ::PROTOBUF_NAMESPACE_ID::Message() { |
160 | 0 | NsheadMeta* const _this = this; (void)_this; |
161 | 0 | new (&_impl_) Impl_{ |
162 | 0 | decltype(_impl_._has_bits_){from._impl_._has_bits_} |
163 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
164 | 0 | , decltype(_impl_.full_method_name_){} |
165 | 0 | , decltype(_impl_.user_string_){} |
166 | 0 | , decltype(_impl_.correlation_id_){} |
167 | 0 | , decltype(_impl_.log_id_){} |
168 | 0 | , decltype(_impl_.attachment_size_){} |
169 | 0 | , decltype(_impl_.compress_type_){} |
170 | 0 | , decltype(_impl_.trace_id_){} |
171 | 0 | , decltype(_impl_.span_id_){} |
172 | 0 | , decltype(_impl_.parent_span_id_){}}; |
173 | |
|
174 | 0 | _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
175 | 0 | _impl_.full_method_name_.InitDefault(); |
176 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
177 | | _impl_.full_method_name_.Set("", GetArenaForAllocation()); |
178 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
179 | 0 | if (from._internal_has_full_method_name()) { |
180 | 0 | _this->_impl_.full_method_name_.Set(from._internal_full_method_name(), |
181 | 0 | _this->GetArenaForAllocation()); |
182 | 0 | } |
183 | 0 | _impl_.user_string_.InitDefault(); |
184 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
185 | | _impl_.user_string_.Set("", GetArenaForAllocation()); |
186 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
187 | 0 | if (from._internal_has_user_string()) { |
188 | 0 | _this->_impl_.user_string_.Set(from._internal_user_string(), |
189 | 0 | _this->GetArenaForAllocation()); |
190 | 0 | } |
191 | 0 | ::memcpy(&_impl_.correlation_id_, &from._impl_.correlation_id_, |
192 | 0 | static_cast<size_t>(reinterpret_cast<char*>(&_impl_.parent_span_id_) - |
193 | 0 | reinterpret_cast<char*>(&_impl_.correlation_id_)) + sizeof(_impl_.parent_span_id_)); |
194 | | // @@protoc_insertion_point(copy_constructor:brpc.NsheadMeta) |
195 | 0 | } |
196 | | |
197 | | inline void NsheadMeta::SharedCtor( |
198 | 0 | ::_pb::Arena* arena, bool is_message_owned) { |
199 | 0 | (void)arena; |
200 | 0 | (void)is_message_owned; |
201 | 0 | new (&_impl_) Impl_{ |
202 | 0 | decltype(_impl_._has_bits_){} |
203 | 0 | , /*decltype(_impl_._cached_size_)*/{} |
204 | 0 | , decltype(_impl_.full_method_name_){} |
205 | 0 | , decltype(_impl_.user_string_){} |
206 | 0 | , decltype(_impl_.correlation_id_){int64_t{0}} |
207 | 0 | , decltype(_impl_.log_id_){int64_t{0}} |
208 | 0 | , decltype(_impl_.attachment_size_){0} |
209 | 0 | , decltype(_impl_.compress_type_){0} |
210 | 0 | , decltype(_impl_.trace_id_){int64_t{0}} |
211 | 0 | , decltype(_impl_.span_id_){int64_t{0}} |
212 | 0 | , decltype(_impl_.parent_span_id_){int64_t{0}} |
213 | 0 | }; |
214 | 0 | _impl_.full_method_name_.InitDefault(); |
215 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
216 | | _impl_.full_method_name_.Set("", GetArenaForAllocation()); |
217 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
218 | 0 | _impl_.user_string_.InitDefault(); |
219 | | #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING |
220 | | _impl_.user_string_.Set("", GetArenaForAllocation()); |
221 | | #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING |
222 | 0 | } |
223 | | |
224 | 0 | NsheadMeta::~NsheadMeta() { |
225 | | // @@protoc_insertion_point(destructor:brpc.NsheadMeta) |
226 | 0 | if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { |
227 | 0 | (void)arena; |
228 | 0 | return; |
229 | 0 | } |
230 | 0 | SharedDtor(); |
231 | 0 | } |
232 | | |
233 | 0 | inline void NsheadMeta::SharedDtor() { |
234 | 0 | GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); |
235 | 0 | _impl_.full_method_name_.Destroy(); |
236 | 0 | _impl_.user_string_.Destroy(); |
237 | 0 | } |
238 | | |
239 | 0 | void NsheadMeta::SetCachedSize(int size) const { |
240 | 0 | _impl_._cached_size_.Set(size); |
241 | 0 | } |
242 | | |
243 | 0 | void NsheadMeta::Clear() { |
244 | | // @@protoc_insertion_point(message_clear_start:brpc.NsheadMeta) |
245 | 0 | uint32_t cached_has_bits = 0; |
246 | | // Prevent compiler warnings about cached_has_bits being unused |
247 | 0 | (void) cached_has_bits; |
248 | |
|
249 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
250 | 0 | if (cached_has_bits & 0x00000003u) { |
251 | 0 | if (cached_has_bits & 0x00000001u) { |
252 | 0 | _impl_.full_method_name_.ClearNonDefaultToEmpty(); |
253 | 0 | } |
254 | 0 | if (cached_has_bits & 0x00000002u) { |
255 | 0 | _impl_.user_string_.ClearNonDefaultToEmpty(); |
256 | 0 | } |
257 | 0 | } |
258 | 0 | if (cached_has_bits & 0x000000fcu) { |
259 | 0 | ::memset(&_impl_.correlation_id_, 0, static_cast<size_t>( |
260 | 0 | reinterpret_cast<char*>(&_impl_.span_id_) - |
261 | 0 | reinterpret_cast<char*>(&_impl_.correlation_id_)) + sizeof(_impl_.span_id_)); |
262 | 0 | } |
263 | 0 | _impl_.parent_span_id_ = int64_t{0}; |
264 | 0 | _impl_._has_bits_.Clear(); |
265 | 0 | _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
266 | 0 | } |
267 | | |
268 | 0 | const char* NsheadMeta::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { |
269 | 0 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
270 | 0 | _Internal::HasBits has_bits{}; |
271 | 0 | while (!ctx->Done(&ptr)) { |
272 | 0 | uint32_t tag; |
273 | 0 | ptr = ::_pbi::ReadTag(ptr, &tag); |
274 | 0 | switch (tag >> 3) { |
275 | | // required string full_method_name = 1; |
276 | 0 | case 1: |
277 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) { |
278 | 0 | auto str = _internal_mutable_full_method_name(); |
279 | 0 | ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); |
280 | 0 | CHK_(ptr); |
281 | 0 | #ifndef NDEBUG |
282 | 0 | ::_pbi::VerifyUTF8(str, "brpc.NsheadMeta.full_method_name"); |
283 | 0 | #endif // !NDEBUG |
284 | 0 | } else |
285 | 0 | goto handle_unusual; |
286 | 0 | continue; |
287 | | // optional int64 correlation_id = 2; |
288 | 0 | case 2: |
289 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) { |
290 | 0 | _Internal::set_has_correlation_id(&has_bits); |
291 | 0 | _impl_.correlation_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
292 | 0 | CHK_(ptr); |
293 | 0 | } else |
294 | 0 | goto handle_unusual; |
295 | 0 | continue; |
296 | | // optional int64 log_id = 3; |
297 | 0 | case 3: |
298 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) { |
299 | 0 | _Internal::set_has_log_id(&has_bits); |
300 | 0 | _impl_.log_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
301 | 0 | CHK_(ptr); |
302 | 0 | } else |
303 | 0 | goto handle_unusual; |
304 | 0 | continue; |
305 | | // optional int32 attachment_size = 4; |
306 | 0 | case 4: |
307 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) { |
308 | 0 | _Internal::set_has_attachment_size(&has_bits); |
309 | 0 | _impl_.attachment_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); |
310 | 0 | CHK_(ptr); |
311 | 0 | } else |
312 | 0 | goto handle_unusual; |
313 | 0 | continue; |
314 | | // optional .brpc.CompressType compress_type = 5; |
315 | 0 | case 5: |
316 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) { |
317 | 0 | uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
318 | 0 | CHK_(ptr); |
319 | 0 | if (PROTOBUF_PREDICT_TRUE(::brpc::CompressType_IsValid(val))) { |
320 | 0 | _internal_set_compress_type(static_cast<::brpc::CompressType>(val)); |
321 | 0 | } else { |
322 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields()); |
323 | 0 | } |
324 | 0 | } else |
325 | 0 | goto handle_unusual; |
326 | 0 | continue; |
327 | | // optional int64 trace_id = 6; |
328 | 0 | case 6: |
329 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) { |
330 | 0 | _Internal::set_has_trace_id(&has_bits); |
331 | 0 | _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
332 | 0 | CHK_(ptr); |
333 | 0 | } else |
334 | 0 | goto handle_unusual; |
335 | 0 | continue; |
336 | | // optional int64 span_id = 7; |
337 | 0 | case 7: |
338 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) { |
339 | 0 | _Internal::set_has_span_id(&has_bits); |
340 | 0 | _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
341 | 0 | CHK_(ptr); |
342 | 0 | } else |
343 | 0 | goto handle_unusual; |
344 | 0 | continue; |
345 | | // optional int64 parent_span_id = 8; |
346 | 0 | case 8: |
347 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) { |
348 | 0 | _Internal::set_has_parent_span_id(&has_bits); |
349 | 0 | _impl_.parent_span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
350 | 0 | CHK_(ptr); |
351 | 0 | } else |
352 | 0 | goto handle_unusual; |
353 | 0 | continue; |
354 | | // optional bytes user_string = 9; |
355 | 0 | case 9: |
356 | 0 | if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) { |
357 | 0 | auto str = _internal_mutable_user_string(); |
358 | 0 | ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); |
359 | 0 | CHK_(ptr); |
360 | 0 | } else |
361 | 0 | goto handle_unusual; |
362 | 0 | continue; |
363 | 0 | default: |
364 | 0 | goto handle_unusual; |
365 | 0 | } // switch |
366 | 0 | handle_unusual: |
367 | 0 | if ((tag == 0) || ((tag & 7) == 4)) { |
368 | 0 | CHK_(ptr); |
369 | 0 | ctx->SetLastTag(tag); |
370 | 0 | goto message_done; |
371 | 0 | } |
372 | 0 | ptr = UnknownFieldParse( |
373 | 0 | tag, |
374 | 0 | _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), |
375 | 0 | ptr, ctx); |
376 | 0 | CHK_(ptr != nullptr); |
377 | 0 | } // while |
378 | 0 | message_done: |
379 | 0 | _impl_._has_bits_.Or(has_bits); |
380 | 0 | return ptr; |
381 | 0 | failure: |
382 | 0 | ptr = nullptr; |
383 | 0 | goto message_done; |
384 | 0 | #undef CHK_ |
385 | 0 | } |
386 | | |
387 | | uint8_t* NsheadMeta::_InternalSerialize( |
388 | 0 | uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
389 | | // @@protoc_insertion_point(serialize_to_array_start:brpc.NsheadMeta) |
390 | 0 | uint32_t cached_has_bits = 0; |
391 | 0 | (void) cached_has_bits; |
392 | |
|
393 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
394 | | // required string full_method_name = 1; |
395 | 0 | if (cached_has_bits & 0x00000001u) { |
396 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( |
397 | 0 | this->_internal_full_method_name().data(), static_cast<int>(this->_internal_full_method_name().length()), |
398 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, |
399 | 0 | "brpc.NsheadMeta.full_method_name"); |
400 | 0 | target = stream->WriteStringMaybeAliased( |
401 | 0 | 1, this->_internal_full_method_name(), target); |
402 | 0 | } |
403 | | |
404 | | // optional int64 correlation_id = 2; |
405 | 0 | if (cached_has_bits & 0x00000004u) { |
406 | 0 | target = stream->EnsureSpace(target); |
407 | 0 | target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_correlation_id(), target); |
408 | 0 | } |
409 | | |
410 | | // optional int64 log_id = 3; |
411 | 0 | if (cached_has_bits & 0x00000008u) { |
412 | 0 | target = stream->EnsureSpace(target); |
413 | 0 | target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_log_id(), target); |
414 | 0 | } |
415 | | |
416 | | // optional int32 attachment_size = 4; |
417 | 0 | if (cached_has_bits & 0x00000010u) { |
418 | 0 | target = stream->EnsureSpace(target); |
419 | 0 | target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_attachment_size(), target); |
420 | 0 | } |
421 | | |
422 | | // optional .brpc.CompressType compress_type = 5; |
423 | 0 | if (cached_has_bits & 0x00000020u) { |
424 | 0 | target = stream->EnsureSpace(target); |
425 | 0 | target = ::_pbi::WireFormatLite::WriteEnumToArray( |
426 | 0 | 5, this->_internal_compress_type(), target); |
427 | 0 | } |
428 | | |
429 | | // optional int64 trace_id = 6; |
430 | 0 | if (cached_has_bits & 0x00000040u) { |
431 | 0 | target = stream->EnsureSpace(target); |
432 | 0 | target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_trace_id(), target); |
433 | 0 | } |
434 | | |
435 | | // optional int64 span_id = 7; |
436 | 0 | if (cached_has_bits & 0x00000080u) { |
437 | 0 | target = stream->EnsureSpace(target); |
438 | 0 | target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_span_id(), target); |
439 | 0 | } |
440 | | |
441 | | // optional int64 parent_span_id = 8; |
442 | 0 | if (cached_has_bits & 0x00000100u) { |
443 | 0 | target = stream->EnsureSpace(target); |
444 | 0 | target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_parent_span_id(), target); |
445 | 0 | } |
446 | | |
447 | | // optional bytes user_string = 9; |
448 | 0 | if (cached_has_bits & 0x00000002u) { |
449 | 0 | target = stream->WriteBytesMaybeAliased( |
450 | 0 | 9, this->_internal_user_string(), target); |
451 | 0 | } |
452 | |
|
453 | 0 | if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
454 | 0 | target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( |
455 | 0 | _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); |
456 | 0 | } |
457 | | // @@protoc_insertion_point(serialize_to_array_end:brpc.NsheadMeta) |
458 | 0 | return target; |
459 | 0 | } |
460 | | |
461 | 0 | size_t NsheadMeta::ByteSizeLong() const { |
462 | | // @@protoc_insertion_point(message_byte_size_start:brpc.NsheadMeta) |
463 | 0 | size_t total_size = 0; |
464 | | |
465 | | // required string full_method_name = 1; |
466 | 0 | if (_internal_has_full_method_name()) { |
467 | 0 | total_size += 1 + |
468 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
469 | 0 | this->_internal_full_method_name()); |
470 | 0 | } |
471 | 0 | uint32_t cached_has_bits = 0; |
472 | | // Prevent compiler warnings about cached_has_bits being unused |
473 | 0 | (void) cached_has_bits; |
474 | |
|
475 | 0 | cached_has_bits = _impl_._has_bits_[0]; |
476 | 0 | if (cached_has_bits & 0x000000feu) { |
477 | | // optional bytes user_string = 9; |
478 | 0 | if (cached_has_bits & 0x00000002u) { |
479 | 0 | total_size += 1 + |
480 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( |
481 | 0 | this->_internal_user_string()); |
482 | 0 | } |
483 | | |
484 | | // optional int64 correlation_id = 2; |
485 | 0 | if (cached_has_bits & 0x00000004u) { |
486 | 0 | total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_correlation_id()); |
487 | 0 | } |
488 | | |
489 | | // optional int64 log_id = 3; |
490 | 0 | if (cached_has_bits & 0x00000008u) { |
491 | 0 | total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_log_id()); |
492 | 0 | } |
493 | | |
494 | | // optional int32 attachment_size = 4; |
495 | 0 | if (cached_has_bits & 0x00000010u) { |
496 | 0 | total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_attachment_size()); |
497 | 0 | } |
498 | | |
499 | | // optional .brpc.CompressType compress_type = 5; |
500 | 0 | if (cached_has_bits & 0x00000020u) { |
501 | 0 | total_size += 1 + |
502 | 0 | ::_pbi::WireFormatLite::EnumSize(this->_internal_compress_type()); |
503 | 0 | } |
504 | | |
505 | | // optional int64 trace_id = 6; |
506 | 0 | if (cached_has_bits & 0x00000040u) { |
507 | 0 | total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_trace_id()); |
508 | 0 | } |
509 | | |
510 | | // optional int64 span_id = 7; |
511 | 0 | if (cached_has_bits & 0x00000080u) { |
512 | 0 | total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_span_id()); |
513 | 0 | } |
514 | |
|
515 | 0 | } |
516 | | // optional int64 parent_span_id = 8; |
517 | 0 | if (cached_has_bits & 0x00000100u) { |
518 | 0 | total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_parent_span_id()); |
519 | 0 | } |
520 | |
|
521 | 0 | return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); |
522 | 0 | } |
523 | | |
524 | | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NsheadMeta::_class_data_ = { |
525 | | ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, |
526 | | NsheadMeta::MergeImpl |
527 | | }; |
528 | 0 | const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NsheadMeta::GetClassData() const { return &_class_data_; } |
529 | | |
530 | | |
531 | 0 | void NsheadMeta::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { |
532 | 0 | auto* const _this = static_cast<NsheadMeta*>(&to_msg); |
533 | 0 | auto& from = static_cast<const NsheadMeta&>(from_msg); |
534 | | // @@protoc_insertion_point(class_specific_merge_from_start:brpc.NsheadMeta) |
535 | 0 | GOOGLE_DCHECK_NE(&from, _this); |
536 | 0 | uint32_t cached_has_bits = 0; |
537 | 0 | (void) cached_has_bits; |
538 | |
|
539 | 0 | cached_has_bits = from._impl_._has_bits_[0]; |
540 | 0 | if (cached_has_bits & 0x000000ffu) { |
541 | 0 | if (cached_has_bits & 0x00000001u) { |
542 | 0 | _this->_internal_set_full_method_name(from._internal_full_method_name()); |
543 | 0 | } |
544 | 0 | if (cached_has_bits & 0x00000002u) { |
545 | 0 | _this->_internal_set_user_string(from._internal_user_string()); |
546 | 0 | } |
547 | 0 | if (cached_has_bits & 0x00000004u) { |
548 | 0 | _this->_impl_.correlation_id_ = from._impl_.correlation_id_; |
549 | 0 | } |
550 | 0 | if (cached_has_bits & 0x00000008u) { |
551 | 0 | _this->_impl_.log_id_ = from._impl_.log_id_; |
552 | 0 | } |
553 | 0 | if (cached_has_bits & 0x00000010u) { |
554 | 0 | _this->_impl_.attachment_size_ = from._impl_.attachment_size_; |
555 | 0 | } |
556 | 0 | if (cached_has_bits & 0x00000020u) { |
557 | 0 | _this->_impl_.compress_type_ = from._impl_.compress_type_; |
558 | 0 | } |
559 | 0 | if (cached_has_bits & 0x00000040u) { |
560 | 0 | _this->_impl_.trace_id_ = from._impl_.trace_id_; |
561 | 0 | } |
562 | 0 | if (cached_has_bits & 0x00000080u) { |
563 | 0 | _this->_impl_.span_id_ = from._impl_.span_id_; |
564 | 0 | } |
565 | 0 | _this->_impl_._has_bits_[0] |= cached_has_bits; |
566 | 0 | } |
567 | 0 | if (cached_has_bits & 0x00000100u) { |
568 | 0 | _this->_internal_set_parent_span_id(from._internal_parent_span_id()); |
569 | 0 | } |
570 | 0 | _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); |
571 | 0 | } |
572 | | |
573 | 0 | void NsheadMeta::CopyFrom(const NsheadMeta& from) { |
574 | | // @@protoc_insertion_point(class_specific_copy_from_start:brpc.NsheadMeta) |
575 | 0 | if (&from == this) return; |
576 | 0 | Clear(); |
577 | 0 | MergeFrom(from); |
578 | 0 | } |
579 | | |
580 | 0 | bool NsheadMeta::IsInitialized() const { |
581 | 0 | if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false; |
582 | 0 | return true; |
583 | 0 | } |
584 | | |
585 | 0 | void NsheadMeta::InternalSwap(NsheadMeta* other) { |
586 | 0 | using std::swap; |
587 | 0 | auto* lhs_arena = GetArenaForAllocation(); |
588 | 0 | auto* rhs_arena = other->GetArenaForAllocation(); |
589 | 0 | _internal_metadata_.InternalSwap(&other->_internal_metadata_); |
590 | 0 | swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); |
591 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( |
592 | 0 | &_impl_.full_method_name_, lhs_arena, |
593 | 0 | &other->_impl_.full_method_name_, rhs_arena |
594 | 0 | ); |
595 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( |
596 | 0 | &_impl_.user_string_, lhs_arena, |
597 | 0 | &other->_impl_.user_string_, rhs_arena |
598 | 0 | ); |
599 | 0 | ::PROTOBUF_NAMESPACE_ID::internal::memswap< |
600 | 0 | PROTOBUF_FIELD_OFFSET(NsheadMeta, _impl_.parent_span_id_) |
601 | 0 | + sizeof(NsheadMeta::_impl_.parent_span_id_) |
602 | 0 | - PROTOBUF_FIELD_OFFSET(NsheadMeta, _impl_.correlation_id_)>( |
603 | 0 | reinterpret_cast<char*>(&_impl_.correlation_id_), |
604 | 0 | reinterpret_cast<char*>(&other->_impl_.correlation_id_)); |
605 | 0 | } |
606 | | |
607 | 0 | ::PROTOBUF_NAMESPACE_ID::Metadata NsheadMeta::GetMetadata() const { |
608 | 0 | return ::_pbi::AssignDescriptors( |
609 | 0 | &descriptor_table_brpc_2fnshead_5fmeta_2eproto_getter, &descriptor_table_brpc_2fnshead_5fmeta_2eproto_once, |
610 | 0 | file_level_metadata_brpc_2fnshead_5fmeta_2eproto[0]); |
611 | 0 | } |
612 | | |
613 | | // @@protoc_insertion_point(namespace_scope) |
614 | | } // namespace brpc |
615 | | PROTOBUF_NAMESPACE_OPEN |
616 | | template<> PROTOBUF_NOINLINE ::brpc::NsheadMeta* |
617 | 0 | Arena::CreateMaybeMessage< ::brpc::NsheadMeta >(Arena* arena) { |
618 | 0 | return Arena::CreateMessageInternal< ::brpc::NsheadMeta >(arena); |
619 | 0 | } |
620 | | PROTOBUF_NAMESPACE_CLOSE |
621 | | |
622 | | // @@protoc_insertion_point(global_scope) |
623 | | #include <google/protobuf/port_undef.inc> |