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 PROTOBUF_NAMESPACE_OPEN
18 class DurationDefaultTypeInternal {
19 public:
20 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Duration> _instance;
21 } _Duration_default_instance_;
22 PROTOBUF_NAMESPACE_CLOSE
InitDefaultsscc_info_Duration_google_2fprotobuf_2fduration_2eproto()23 static void InitDefaultsscc_info_Duration_google_2fprotobuf_2fduration_2eproto() {
24 GOOGLE_PROTOBUF_VERIFY_VERSION;
25
26 {
27 void* ptr = &PROTOBUF_NAMESPACE_ID::_Duration_default_instance_;
28 new (ptr) PROTOBUF_NAMESPACE_ID::Duration();
29 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
30 }
31 }
32
33 PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Duration_google_2fprotobuf_2fduration_2eproto =
34 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Duration_google_2fprotobuf_2fduration_2eproto}, {}};
35
36 static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fduration_2eproto[1];
37 static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
38 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
39
40 const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
41 ~0u, // no _has_bits_
42 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
43 ~0u, // no _extensions_
44 ~0u, // no _oneof_case_
45 ~0u, // no _weak_field_map_
46 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, seconds_),
47 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, nanos_),
48 };
49 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
50 { 0, -1, sizeof(PROTOBUF_NAMESPACE_ID::Duration)},
51 };
52
53 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
54 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&PROTOBUF_NAMESPACE_ID::_Duration_default_instance_),
55 };
56
57 const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
58 "\n\036google/protobuf/duration.proto\022\017google"
59 ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
60 "\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
61 "urationProtoP\001Z1google.golang.org/protob"
62 "uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
63 "gle.Protobuf.WellKnownTypesb\006proto3"
64 ;
65 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2fprotobuf_2fduration_2eproto_deps[1] = {
66 };
67 static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2fprotobuf_2fduration_2eproto_sccs[1] = {
68 &scc_info_Duration_google_2fprotobuf_2fduration_2eproto.base,
69 };
70 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once;
71 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = {
72 false, false, descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto, "google/protobuf/duration.proto", 235,
73 &descriptor_table_google_2fprotobuf_2fduration_2eproto_once, descriptor_table_google_2fprotobuf_2fduration_2eproto_sccs, descriptor_table_google_2fprotobuf_2fduration_2eproto_deps, 1, 0,
74 schemas, file_default_instances, TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
75 file_level_metadata_google_2fprotobuf_2fduration_2eproto, 1, file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto, file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto,
76 };
77
78 // Force running AddDescriptors() at dynamic initialization time.
79 static bool dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2fprotobuf_2fduration_2eproto)), true);
80 PROTOBUF_NAMESPACE_OPEN
81
82 // ===================================================================
83
84 class Duration::_Internal {
85 public:
86 };
87
Duration(::PROTOBUF_NAMESPACE_ID::Arena * arena)88 Duration::Duration(::PROTOBUF_NAMESPACE_ID::Arena* arena)
89 : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
90 SharedCtor();
91 RegisterArenaDtor(arena);
92 // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
93 }
Duration(const Duration & from)94 Duration::Duration(const Duration& from)
95 : ::PROTOBUF_NAMESPACE_ID::Message() {
96 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
97 ::memcpy(&seconds_, &from.seconds_,
98 static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
99 reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
100 // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
101 }
102
SharedCtor()103 void Duration::SharedCtor() {
104 ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
105 reinterpret_cast<char*>(&seconds_) - reinterpret_cast<char*>(this)),
106 0, static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
107 reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
108 }
109
~Duration()110 Duration::~Duration() {
111 // @@protoc_insertion_point(destructor:google.protobuf.Duration)
112 SharedDtor();
113 _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
114 }
115
SharedDtor()116 void Duration::SharedDtor() {
117 GOOGLE_DCHECK(GetArena() == nullptr);
118 }
119
ArenaDtor(void * object)120 void Duration::ArenaDtor(void* object) {
121 Duration* _this = reinterpret_cast< Duration* >(object);
122 (void)_this;
123 }
RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *)124 void Duration::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
125 }
SetCachedSize(int size) const126 void Duration::SetCachedSize(int size) const {
127 _cached_size_.Set(size);
128 }
default_instance()129 const Duration& Duration::default_instance() {
130 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Duration_google_2fprotobuf_2fduration_2eproto.base);
131 return *internal_default_instance();
132 }
133
134
Clear()135 void Duration::Clear() {
136 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
137 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
138 // Prevent compiler warnings about cached_has_bits being unused
139 (void) cached_has_bits;
140
141 ::memset(&seconds_, 0, static_cast<size_t>(
142 reinterpret_cast<char*>(&nanos_) -
143 reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
144 _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
145 }
146
_InternalParse(const char * ptr,::PROTOBUF_NAMESPACE_ID::internal::ParseContext * ctx)147 const char* Duration::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
148 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
149 while (!ctx->Done(&ptr)) {
150 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
151 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
152 CHK_(ptr);
153 switch (tag >> 3) {
154 // int64 seconds = 1;
155 case 1:
156 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
157 seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
158 CHK_(ptr);
159 } else goto handle_unusual;
160 continue;
161 // int32 nanos = 2;
162 case 2:
163 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
164 nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
165 CHK_(ptr);
166 } else goto handle_unusual;
167 continue;
168 default: {
169 handle_unusual:
170 if ((tag & 7) == 4 || tag == 0) {
171 ctx->SetLastTag(tag);
172 goto success;
173 }
174 ptr = UnknownFieldParse(tag,
175 _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
176 ptr, ctx);
177 CHK_(ptr != nullptr);
178 continue;
179 }
180 } // switch
181 } // while
182 success:
183 return ptr;
184 failure:
185 ptr = nullptr;
186 goto success;
187 #undef CHK_
188 }
189
_InternalSerialize(::PROTOBUF_NAMESPACE_ID::uint8 * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const190 ::PROTOBUF_NAMESPACE_ID::uint8* Duration::_InternalSerialize(
191 ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
192 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
193 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
194 (void) cached_has_bits;
195
196 // int64 seconds = 1;
197 if (this->seconds() != 0) {
198 target = stream->EnsureSpace(target);
199 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_seconds(), target);
200 }
201
202 // int32 nanos = 2;
203 if (this->nanos() != 0) {
204 target = stream->EnsureSpace(target);
205 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_nanos(), target);
206 }
207
208 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
209 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
210 _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
211 }
212 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
213 return target;
214 }
215
ByteSizeLong() const216 size_t Duration::ByteSizeLong() const {
217 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
218 size_t total_size = 0;
219
220 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
221 // Prevent compiler warnings about cached_has_bits being unused
222 (void) cached_has_bits;
223
224 // int64 seconds = 1;
225 if (this->seconds() != 0) {
226 total_size += 1 +
227 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
228 this->_internal_seconds());
229 }
230
231 // int32 nanos = 2;
232 if (this->nanos() != 0) {
233 total_size += 1 +
234 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
235 this->_internal_nanos());
236 }
237
238 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
239 return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
240 _internal_metadata_, total_size, &_cached_size_);
241 }
242 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
243 SetCachedSize(cached_size);
244 return total_size;
245 }
246
MergeFrom(const::PROTOBUF_NAMESPACE_ID::Message & from)247 void Duration::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
248 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duration)
249 GOOGLE_DCHECK_NE(&from, this);
250 const Duration* source =
251 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Duration>(
252 &from);
253 if (source == nullptr) {
254 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Duration)
255 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
256 } else {
257 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Duration)
258 MergeFrom(*source);
259 }
260 }
261
MergeFrom(const Duration & from)262 void Duration::MergeFrom(const Duration& from) {
263 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
264 GOOGLE_DCHECK_NE(&from, this);
265 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
266 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
267 (void) cached_has_bits;
268
269 if (from.seconds() != 0) {
270 _internal_set_seconds(from._internal_seconds());
271 }
272 if (from.nanos() != 0) {
273 _internal_set_nanos(from._internal_nanos());
274 }
275 }
276
CopyFrom(const::PROTOBUF_NAMESPACE_ID::Message & from)277 void Duration::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
278 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration)
279 if (&from == this) return;
280 Clear();
281 MergeFrom(from);
282 }
283
CopyFrom(const Duration & from)284 void Duration::CopyFrom(const Duration& from) {
285 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
286 if (&from == this) return;
287 Clear();
288 MergeFrom(from);
289 }
290
IsInitialized() const291 bool Duration::IsInitialized() const {
292 return true;
293 }
294
InternalSwap(Duration * other)295 void Duration::InternalSwap(Duration* other) {
296 using std::swap;
297 _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
298 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
299 PROTOBUF_FIELD_OFFSET(Duration, nanos_)
300 + sizeof(Duration::nanos_)
301 - PROTOBUF_FIELD_OFFSET(Duration, seconds_)>(
302 reinterpret_cast<char*>(&seconds_),
303 reinterpret_cast<char*>(&other->seconds_));
304 }
305
GetMetadata() const306 ::PROTOBUF_NAMESPACE_ID::Metadata Duration::GetMetadata() const {
307 return GetMetadataStatic();
308 }
309
310
311 // @@protoc_insertion_point(namespace_scope)
312 PROTOBUF_NAMESPACE_CLOSE
313 PROTOBUF_NAMESPACE_OPEN
CreateMaybeMessage(Arena * arena)314 template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Duration* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Duration >(Arena* arena) {
315 return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Duration >(arena);
316 }
317 PROTOBUF_NAMESPACE_CLOSE
318
319 // @@protoc_insertion_point(global_scope)
320 #include <google/protobuf/port_undef.inc>
321