1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: trace_log.proto
3
4 #include "trace_log.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/io/zero_copy_stream_impl_lite.h>
12 // @@protoc_insertion_point(includes)
13 #include <google/protobuf/port_def.inc>
14
15 PROTOBUF_PRAGMA_INIT_SEG
16
17 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
18 namespace _pbi = _pb::internal;
19
20 namespace metrics {
TraceLog(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR TraceLog::TraceLog(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.raw_data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.compression_type_)*/0} {}
27 struct TraceLogDefaultTypeInternal {
TraceLogDefaultTypeInternalmetrics::TraceLogDefaultTypeInternal28 PROTOBUF_CONSTEXPR TraceLogDefaultTypeInternal()
29 : _instance(::_pbi::ConstantInitialized{}) {}
~TraceLogDefaultTypeInternalmetrics::TraceLogDefaultTypeInternal30 ~TraceLogDefaultTypeInternal() {}
31 union {
32 TraceLog _instance;
33 };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceLogDefaultTypeInternal _TraceLog_default_instance_;
36 } // namespace metrics
37 namespace metrics {
TraceLog_CompressionType_IsValid(int value)38 bool TraceLog_CompressionType_IsValid(int value) {
39 switch (value) {
40 case 0:
41 case 1:
42 return true;
43 default:
44 return false;
45 }
46 }
47
48 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TraceLog_CompressionType_strings[2] = {};
49
50 static const char TraceLog_CompressionType_names[] =
51 "COMPRESSION_TYPE_NONE"
52 "COMPRESSION_TYPE_ZLIB";
53
54 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TraceLog_CompressionType_entries[] = {
55 { {TraceLog_CompressionType_names + 0, 21}, 0 },
56 { {TraceLog_CompressionType_names + 21, 21}, 1 },
57 };
58
59 static const int TraceLog_CompressionType_entries_by_number[] = {
60 0, // 0 -> COMPRESSION_TYPE_NONE
61 1, // 1 -> COMPRESSION_TYPE_ZLIB
62 };
63
TraceLog_CompressionType_Name(TraceLog_CompressionType value)64 const std::string& TraceLog_CompressionType_Name(
65 TraceLog_CompressionType value) {
66 static const bool dummy =
67 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
68 TraceLog_CompressionType_entries,
69 TraceLog_CompressionType_entries_by_number,
70 2, TraceLog_CompressionType_strings);
71 (void) dummy;
72 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
73 TraceLog_CompressionType_entries,
74 TraceLog_CompressionType_entries_by_number,
75 2, value);
76 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
77 TraceLog_CompressionType_strings[idx].get();
78 }
TraceLog_CompressionType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TraceLog_CompressionType * value)79 bool TraceLog_CompressionType_Parse(
80 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TraceLog_CompressionType* value) {
81 int int_value;
82 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
83 TraceLog_CompressionType_entries, 2, name, &int_value);
84 if (success) {
85 *value = static_cast<TraceLog_CompressionType>(int_value);
86 }
87 return success;
88 }
89 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
90 constexpr TraceLog_CompressionType TraceLog::COMPRESSION_TYPE_NONE;
91 constexpr TraceLog_CompressionType TraceLog::COMPRESSION_TYPE_ZLIB;
92 constexpr TraceLog_CompressionType TraceLog::CompressionType_MIN;
93 constexpr TraceLog_CompressionType TraceLog::CompressionType_MAX;
94 constexpr int TraceLog::CompressionType_ARRAYSIZE;
95 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
96
97 // ===================================================================
98
99 class TraceLog::_Internal {
100 public:
101 using HasBits = decltype(std::declval<TraceLog>()._impl_._has_bits_);
set_has_raw_data(HasBits * has_bits)102 static void set_has_raw_data(HasBits* has_bits) {
103 (*has_bits)[0] |= 1u;
104 }
set_has_compression_type(HasBits * has_bits)105 static void set_has_compression_type(HasBits* has_bits) {
106 (*has_bits)[0] |= 2u;
107 }
108 };
109
TraceLog(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)110 TraceLog::TraceLog(::PROTOBUF_NAMESPACE_ID::Arena* arena,
111 bool is_message_owned)
112 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
113 SharedCtor(arena, is_message_owned);
114 // @@protoc_insertion_point(arena_constructor:metrics.TraceLog)
115 }
TraceLog(const TraceLog & from)116 TraceLog::TraceLog(const TraceLog& from)
117 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
118 TraceLog* const _this = this; (void)_this;
119 new (&_impl_) Impl_{
120 decltype(_impl_._has_bits_){from._impl_._has_bits_}
121 , /*decltype(_impl_._cached_size_)*/{}
122 , decltype(_impl_.raw_data_){}
123 , decltype(_impl_.compression_type_){}};
124
125 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
126 _impl_.raw_data_.InitDefault();
127 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
128 _impl_.raw_data_.Set("", GetArenaForAllocation());
129 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
130 if (from._internal_has_raw_data()) {
131 _this->_impl_.raw_data_.Set(from._internal_raw_data(),
132 _this->GetArenaForAllocation());
133 }
134 _this->_impl_.compression_type_ = from._impl_.compression_type_;
135 // @@protoc_insertion_point(copy_constructor:metrics.TraceLog)
136 }
137
SharedCtor(::_pb::Arena * arena,bool is_message_owned)138 inline void TraceLog::SharedCtor(
139 ::_pb::Arena* arena, bool is_message_owned) {
140 (void)arena;
141 (void)is_message_owned;
142 new (&_impl_) Impl_{
143 decltype(_impl_._has_bits_){}
144 , /*decltype(_impl_._cached_size_)*/{}
145 , decltype(_impl_.raw_data_){}
146 , decltype(_impl_.compression_type_){0}
147 };
148 _impl_.raw_data_.InitDefault();
149 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
150 _impl_.raw_data_.Set("", GetArenaForAllocation());
151 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
152 }
153
~TraceLog()154 TraceLog::~TraceLog() {
155 // @@protoc_insertion_point(destructor:metrics.TraceLog)
156 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
157 (void)arena;
158 return;
159 }
160 SharedDtor();
161 }
162
SharedDtor()163 inline void TraceLog::SharedDtor() {
164 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
165 _impl_.raw_data_.Destroy();
166 }
167
SetCachedSize(int size) const168 void TraceLog::SetCachedSize(int size) const {
169 _impl_._cached_size_.Set(size);
170 }
171
Clear()172 void TraceLog::Clear() {
173 // @@protoc_insertion_point(message_clear_start:metrics.TraceLog)
174 uint32_t cached_has_bits = 0;
175 // Prevent compiler warnings about cached_has_bits being unused
176 (void) cached_has_bits;
177
178 cached_has_bits = _impl_._has_bits_[0];
179 if (cached_has_bits & 0x00000001u) {
180 _impl_.raw_data_.ClearNonDefaultToEmpty();
181 }
182 _impl_.compression_type_ = 0;
183 _impl_._has_bits_.Clear();
184 _internal_metadata_.Clear<std::string>();
185 }
186
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)187 const char* TraceLog::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
188 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
189 _Internal::HasBits has_bits{};
190 while (!ctx->Done(&ptr)) {
191 uint32_t tag;
192 ptr = ::_pbi::ReadTag(ptr, &tag);
193 switch (tag >> 3) {
194 // optional bytes raw_data = 1;
195 case 1:
196 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
197 auto str = _internal_mutable_raw_data();
198 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
199 CHK_(ptr);
200 } else
201 goto handle_unusual;
202 continue;
203 // optional .metrics.TraceLog.CompressionType compression_type = 5 [default = COMPRESSION_TYPE_NONE];
204 case 5:
205 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
206 uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
207 CHK_(ptr);
208 if (PROTOBUF_PREDICT_TRUE(::metrics::TraceLog_CompressionType_IsValid(val))) {
209 _internal_set_compression_type(static_cast<::metrics::TraceLog_CompressionType>(val));
210 } else {
211 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
212 }
213 } else
214 goto handle_unusual;
215 continue;
216 default:
217 goto handle_unusual;
218 } // switch
219 handle_unusual:
220 if ((tag == 0) || ((tag & 7) == 4)) {
221 CHK_(ptr);
222 ctx->SetLastTag(tag);
223 goto message_done;
224 }
225 ptr = UnknownFieldParse(
226 tag,
227 _internal_metadata_.mutable_unknown_fields<std::string>(),
228 ptr, ctx);
229 CHK_(ptr != nullptr);
230 } // while
231 message_done:
232 _impl_._has_bits_.Or(has_bits);
233 return ptr;
234 failure:
235 ptr = nullptr;
236 goto message_done;
237 #undef CHK_
238 }
239
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const240 uint8_t* TraceLog::_InternalSerialize(
241 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
242 // @@protoc_insertion_point(serialize_to_array_start:metrics.TraceLog)
243 uint32_t cached_has_bits = 0;
244 (void) cached_has_bits;
245
246 cached_has_bits = _impl_._has_bits_[0];
247 // optional bytes raw_data = 1;
248 if (cached_has_bits & 0x00000001u) {
249 target = stream->WriteBytesMaybeAliased(
250 1, this->_internal_raw_data(), target);
251 }
252
253 // optional .metrics.TraceLog.CompressionType compression_type = 5 [default = COMPRESSION_TYPE_NONE];
254 if (cached_has_bits & 0x00000002u) {
255 target = stream->EnsureSpace(target);
256 target = ::_pbi::WireFormatLite::WriteEnumToArray(
257 5, this->_internal_compression_type(), target);
258 }
259
260 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
261 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
262 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
263 }
264 // @@protoc_insertion_point(serialize_to_array_end:metrics.TraceLog)
265 return target;
266 }
267
ByteSizeLong() const268 size_t TraceLog::ByteSizeLong() const {
269 // @@protoc_insertion_point(message_byte_size_start:metrics.TraceLog)
270 size_t total_size = 0;
271
272 uint32_t cached_has_bits = 0;
273 // Prevent compiler warnings about cached_has_bits being unused
274 (void) cached_has_bits;
275
276 cached_has_bits = _impl_._has_bits_[0];
277 if (cached_has_bits & 0x00000003u) {
278 // optional bytes raw_data = 1;
279 if (cached_has_bits & 0x00000001u) {
280 total_size += 1 +
281 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
282 this->_internal_raw_data());
283 }
284
285 // optional .metrics.TraceLog.CompressionType compression_type = 5 [default = COMPRESSION_TYPE_NONE];
286 if (cached_has_bits & 0x00000002u) {
287 total_size += 1 +
288 ::_pbi::WireFormatLite::EnumSize(this->_internal_compression_type());
289 }
290
291 }
292 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
293 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
294 }
295 int cached_size = ::_pbi::ToCachedSize(total_size);
296 SetCachedSize(cached_size);
297 return total_size;
298 }
299
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)300 void TraceLog::CheckTypeAndMergeFrom(
301 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
302 MergeFrom(*::_pbi::DownCast<const TraceLog*>(
303 &from));
304 }
305
MergeFrom(const TraceLog & from)306 void TraceLog::MergeFrom(const TraceLog& from) {
307 TraceLog* const _this = this;
308 // @@protoc_insertion_point(class_specific_merge_from_start:metrics.TraceLog)
309 GOOGLE_DCHECK_NE(&from, _this);
310 uint32_t cached_has_bits = 0;
311 (void) cached_has_bits;
312
313 cached_has_bits = from._impl_._has_bits_[0];
314 if (cached_has_bits & 0x00000003u) {
315 if (cached_has_bits & 0x00000001u) {
316 _this->_internal_set_raw_data(from._internal_raw_data());
317 }
318 if (cached_has_bits & 0x00000002u) {
319 _this->_impl_.compression_type_ = from._impl_.compression_type_;
320 }
321 _this->_impl_._has_bits_[0] |= cached_has_bits;
322 }
323 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
324 }
325
CopyFrom(const TraceLog & from)326 void TraceLog::CopyFrom(const TraceLog& from) {
327 // @@protoc_insertion_point(class_specific_copy_from_start:metrics.TraceLog)
328 if (&from == this) return;
329 Clear();
330 MergeFrom(from);
331 }
332
IsInitialized() const333 bool TraceLog::IsInitialized() const {
334 return true;
335 }
336
InternalSwap(TraceLog * other)337 void TraceLog::InternalSwap(TraceLog* other) {
338 using std::swap;
339 auto* lhs_arena = GetArenaForAllocation();
340 auto* rhs_arena = other->GetArenaForAllocation();
341 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
342 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
343 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
344 &_impl_.raw_data_, lhs_arena,
345 &other->_impl_.raw_data_, rhs_arena
346 );
347 swap(_impl_.compression_type_, other->_impl_.compression_type_);
348 }
349
GetTypeName() const350 std::string TraceLog::GetTypeName() const {
351 return "metrics.TraceLog";
352 }
353
354
355 // @@protoc_insertion_point(namespace_scope)
356 } // namespace metrics
357 PROTOBUF_NAMESPACE_OPEN
358 template<> PROTOBUF_NOINLINE ::metrics::TraceLog*
CreateMaybeMessage(Arena * arena)359 Arena::CreateMaybeMessage< ::metrics::TraceLog >(Arena* arena) {
360 return Arena::CreateMessageInternal< ::metrics::TraceLog >(arena);
361 }
362 PROTOBUF_NAMESPACE_CLOSE
363
364 // @@protoc_insertion_point(global_scope)
365 #include <google/protobuf/port_undef.inc>
366