1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/duration.proto
3
4#include <google/protobuf/duration.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
18PROTOBUF_PRAGMA_INIT_SEG
19
20namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21namespace _pbi = _pb::internal;
22
23PROTOBUF_NAMESPACE_OPEN
24PROTOBUF_CONSTEXPR Duration::Duration(
25 ::_pbi::ConstantInitialized): _impl_{
26 /*decltype(_impl_.seconds_)*/.seconds_: int64_t{0}
27 , /*decltype(_impl_.nanos_)*/.nanos_: 0
28 , /*decltype(_impl_._cached_size_)*/._cached_size_: {}} {}
29struct DurationDefaultTypeInternal {
30 PROTOBUF_CONSTEXPR DurationDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
32 ~DurationDefaultTypeInternal() {}
33 union {
34 Duration _instance;
35 };
36};
37PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DurationDefaultTypeInternal _Duration_default_instance_;
38PROTOBUF_NAMESPACE_CLOSE
39static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fduration_2eproto[1];
40static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
41static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
42
43const uint32_t TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
44 ~0u, // no _has_bits_
45 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
46 ~0u, // no _extensions_
47 ~0u, // no _oneof_case_
48 ~0u, // no _weak_field_map_
49 ~0u, // no _inlined_string_donated_
50 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.seconds_),
51 PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.nanos_),
52};
53static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
54 { .offsets_index: 0, .has_bit_indices_index: -1, .inlined_string_indices_index: -1, .object_size: sizeof(::PROTOBUF_NAMESPACE_ID::Duration)},
55};
56
57static const ::_pb::Message* const file_default_instances[] = {
58 &::PROTOBUF_NAMESPACE_ID::_Duration_default_instance_._instance,
59};
60
61const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
62 "\n\036google/protobuf/duration.proto\022\017google"
63 ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
64 "\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
65 "urationProtoP\001Z1google.golang.org/protob"
66 "uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
67 "gle.Protobuf.WellKnownTypesb\006proto3"
68 ;
69static ::_pbi::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once;
70const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = {
71 .is_initialized: false, .is_eager: false, .size: 235, .descriptor: descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto,
72 .filename: "google/protobuf/duration.proto",
73 .once: &descriptor_table_google_2fprotobuf_2fduration_2eproto_once, .deps: nullptr, .num_deps: 0, .num_messages: 1,
74 .schemas: schemas, .default_instances: file_default_instances, .offsets: TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
75 .file_level_metadata: file_level_metadata_google_2fprotobuf_2fduration_2eproto, .file_level_enum_descriptors: file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto,
76 .file_level_service_descriptors: file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto,
77};
78PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fduration_2eproto_getter() {
79 return &descriptor_table_google_2fprotobuf_2fduration_2eproto;
80}
81
82// Force running AddDescriptors() at dynamic initialization time.
83PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto(&descriptor_table_google_2fprotobuf_2fduration_2eproto);
84PROTOBUF_NAMESPACE_OPEN
85
86// ===================================================================
87
88class Duration::_Internal {
89 public:
90};
91
92Duration::Duration(::PROTOBUF_NAMESPACE_ID::Arena* arena,
93 bool is_message_owned)
94 : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
95 SharedCtor(arena, is_message_owned);
96 // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
97}
98Duration::Duration(const Duration& from)
99 : ::PROTOBUF_NAMESPACE_ID::Message() {
100 Duration* const _this = this; (void)_this;
101 new (&_impl_) Impl_{
102 .seconds_: decltype(_impl_.seconds_){}
103 , .nanos_: decltype(_impl_.nanos_){}
104 , /*decltype(_impl_._cached_size_)*/._cached_size_: {}};
105
106 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(other: from._internal_metadata_);
107 ::memcpy(dest: &_impl_.seconds_, src: &from._impl_.seconds_,
108 n: static_cast<size_t>(reinterpret_cast<char*>(&_impl_.nanos_) -
109 reinterpret_cast<char*>(&_impl_.seconds_)) + sizeof(_impl_.nanos_));
110 // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
111}
112
113inline void Duration::SharedCtor(
114 ::_pb::Arena* arena, bool is_message_owned) {
115 (void)arena;
116 (void)is_message_owned;
117 new (&_impl_) Impl_{
118 .seconds_: decltype(_impl_.seconds_){int64_t{0}}
119 , .nanos_: decltype(_impl_.nanos_){0}
120 , /*decltype(_impl_._cached_size_)*/._cached_size_: {}
121 };
122}
123
124Duration::~Duration() {
125 // @@protoc_insertion_point(destructor:google.protobuf.Duration)
126 if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
127 (void)arena;
128 return;
129 }
130 SharedDtor();
131}
132
133inline void Duration::SharedDtor() {
134 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
135}
136
137void Duration::SetCachedSize(int size) const {
138 _impl_._cached_size_.Set(size);
139}
140
141void Duration::Clear() {
142// @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
143 uint32_t cached_has_bits = 0;
144 // Prevent compiler warnings about cached_has_bits being unused
145 (void) cached_has_bits;
146
147 ::memset(s: &_impl_.seconds_, c: 0, n: static_cast<size_t>(
148 reinterpret_cast<char*>(&_impl_.nanos_) -
149 reinterpret_cast<char*>(&_impl_.seconds_)) + sizeof(_impl_.nanos_));
150 _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
151}
152
153const char* Duration::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
154#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
155 while (!ctx->Done(ptr: &ptr)) {
156 uint32_t tag;
157 ptr = ::_pbi::ReadTag(p: ptr, out: &tag);
158 switch (tag >> 3) {
159 // int64 seconds = 1;
160 case 1:
161 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
162 _impl_.seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(p: &ptr);
163 CHK_(ptr);
164 } else
165 goto handle_unusual;
166 continue;
167 // int32 nanos = 2;
168 case 2:
169 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
170 _impl_.nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(p: &ptr);
171 CHK_(ptr);
172 } else
173 goto handle_unusual;
174 continue;
175 default:
176 goto handle_unusual;
177 } // switch
178 handle_unusual:
179 if ((tag == 0) || ((tag & 7) == 4)) {
180 CHK_(ptr);
181 ctx->SetLastTag(tag);
182 goto message_done;
183 }
184 ptr = UnknownFieldParse(
185 tag,
186 unknown: _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
187 ptr, ctx);
188 CHK_(ptr != nullptr);
189 } // while
190message_done:
191 return ptr;
192failure:
193 ptr = nullptr;
194 goto message_done;
195#undef CHK_
196}
197
198uint8_t* Duration::_InternalSerialize(
199 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
200 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
201 uint32_t cached_has_bits = 0;
202 (void) cached_has_bits;
203
204 // int64 seconds = 1;
205 if (this->_internal_seconds() != 0) {
206 target = stream->EnsureSpace(ptr: target);
207 target = ::_pbi::WireFormatLite::WriteInt64ToArray(field_number: 1, value: this->_internal_seconds(), target);
208 }
209
210 // int32 nanos = 2;
211 if (this->_internal_nanos() != 0) {
212 target = stream->EnsureSpace(ptr: target);
213 target = ::_pbi::WireFormatLite::WriteInt32ToArray(field_number: 2, value: this->_internal_nanos(), target);
214 }
215
216 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
217 target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
218 unknown_fields: _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(default_instance: ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
219 }
220 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
221 return target;
222}
223
224size_t Duration::ByteSizeLong() const {
225// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
226 size_t total_size = 0;
227
228 uint32_t cached_has_bits = 0;
229 // Prevent compiler warnings about cached_has_bits being unused
230 (void) cached_has_bits;
231
232 // int64 seconds = 1;
233 if (this->_internal_seconds() != 0) {
234 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(value: this->_internal_seconds());
235 }
236
237 // int32 nanos = 2;
238 if (this->_internal_nanos() != 0) {
239 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(value: this->_internal_nanos());
240 }
241
242 return MaybeComputeUnknownFieldsSize(total_size, cached_size: &_impl_._cached_size_);
243}
244
245const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Duration::_class_data_ = {
246 .copy_to_from: ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
247 .merge_to_from: Duration::MergeImpl
248};
249const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Duration::GetClassData() const { return &_class_data_; }
250
251
252void Duration::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
253 auto* const _this = static_cast<Duration*>(&to_msg);
254 auto& from = static_cast<const Duration&>(from_msg);
255 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
256 GOOGLE_DCHECK_NE(&from, _this);
257 uint32_t cached_has_bits = 0;
258 (void) cached_has_bits;
259
260 if (from._internal_seconds() != 0) {
261 _this->_internal_set_seconds(value: from._internal_seconds());
262 }
263 if (from._internal_nanos() != 0) {
264 _this->_internal_set_nanos(value: from._internal_nanos());
265 }
266 _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(other: from._internal_metadata_);
267}
268
269void Duration::CopyFrom(const Duration& from) {
270// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
271 if (&from == this) return;
272 Clear();
273 MergeFrom(from);
274}
275
276bool Duration::IsInitialized() const {
277 return true;
278}
279
280void Duration::InternalSwap(Duration* other) {
281 using std::swap;
282 _internal_metadata_.InternalSwap(other: &other->_internal_metadata_);
283 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
284 PROTOBUF_FIELD_OFFSET(Duration, _impl_.nanos_)
285 + sizeof(Duration::_impl_.nanos_)
286 - PROTOBUF_FIELD_OFFSET(Duration, _impl_.seconds_)>(
287 p: reinterpret_cast<char*>(&_impl_.seconds_),
288 q: reinterpret_cast<char*>(&other->_impl_.seconds_));
289}
290
291::PROTOBUF_NAMESPACE_ID::Metadata Duration::GetMetadata() const {
292 return ::_pbi::AssignDescriptors(
293 table: &descriptor_table_google_2fprotobuf_2fduration_2eproto_getter, once: &descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
294 metadata: file_level_metadata_google_2fprotobuf_2fduration_2eproto[0]);
295}
296
297// @@protoc_insertion_point(namespace_scope)
298PROTOBUF_NAMESPACE_CLOSE
299PROTOBUF_NAMESPACE_OPEN
300template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Duration*
301Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Duration >(Arena* arena) {
302 return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Duration >(arena);
303}
304PROTOBUF_NAMESPACE_CLOSE
305
306// @@protoc_insertion_point(global_scope)
307#include <google/protobuf/port_undef.inc>
308