1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/duration.proto
3 
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
5 #include <google/protobuf/duration.pb.h>
6 
7 #include <algorithm>
8 
9 #include <google/protobuf/stubs/common.h>
10 #include <google/protobuf/stubs/port.h>
11 #include <google/protobuf/stubs/once.h>
12 #include <google/protobuf/io/coded_stream.h>
13 #include <google/protobuf/wire_format_lite_inl.h>
14 #include <google/protobuf/descriptor.h>
15 #include <google/protobuf/generated_message_reflection.h>
16 #include <google/protobuf/reflection_ops.h>
17 #include <google/protobuf/wire_format.h>
18 // @@protoc_insertion_point(includes)
19 
20 namespace google {
21 namespace protobuf {
22 class DurationDefaultTypeInternal {
23 public:
24  ::google::protobuf::internal::ExplicitlyConstructed<Duration>
25      _instance;
26 } _Duration_default_instance_;
27 
28 namespace protobuf_google_2fprotobuf_2fduration_2eproto {
29 
30 
31 namespace {
32 
33 ::google::protobuf::Metadata file_level_metadata[1];
34 
35 }  // namespace
36 
37 PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField
38     const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
39   {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},
40 };
41 
42 PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField
43     const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
44   ::google::protobuf::internal::AuxillaryParseTableField(),
45 };
46 PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const
47     TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
48   { NULL, NULL, 0, -1, -1, -1, -1, NULL, false },
49 };
50 
51 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
52   ~0u,  // no _has_bits_
53   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_),
54   ~0u,  // no _extensions_
55   ~0u,  // no _oneof_case_
56   ~0u,  // no _weak_field_map_
57   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_),
58   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_),
59 };
60 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
61   { 0, -1, sizeof(Duration)},
62 };
63 
64 static ::google::protobuf::Message const * const file_default_instances[] = {
65   reinterpret_cast<const ::google::protobuf::Message*>(&_Duration_default_instance_),
66 };
67 
68 namespace {
69 
protobuf_AssignDescriptors()70 void protobuf_AssignDescriptors() {
71   AddDescriptors();
72   ::google::protobuf::MessageFactory* factory = NULL;
73   AssignDescriptors(
74       "google/protobuf/duration.proto", schemas, file_default_instances, TableStruct::offsets, factory,
75       file_level_metadata, NULL, NULL);
76 }
77 
protobuf_AssignDescriptorsOnce()78 void protobuf_AssignDescriptorsOnce() {
79   static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
80   ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
81 }
82 
83 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
protobuf_RegisterTypes(const::std::string &)84 void protobuf_RegisterTypes(const ::std::string&) {
85   protobuf_AssignDescriptorsOnce();
86   ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
87 }
88 
89 }  // namespace
InitDefaultsImpl()90 void TableStruct::InitDefaultsImpl() {
91   GOOGLE_PROTOBUF_VERIFY_VERSION;
92 
93   ::google::protobuf::internal::InitProtobufDefaults();
94   _Duration_default_instance_._instance.DefaultConstruct();
95   ::google::protobuf::internal::OnShutdownDestroyMessage(
96       &_Duration_default_instance_);}
97 
InitDefaults()98 void InitDefaults() {
99   static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
100   ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
101 }
102 namespace {
AddDescriptorsImpl()103 void AddDescriptorsImpl() {
104   InitDefaults();
105   static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
106       "\n\036google/protobuf/duration.proto\022\017google"
107       ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
108       "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu"
109       "rationProtoP\001Z*github.com/golang/protobu"
110       "f/ptypes/duration\370\001\001\242\002\003GPB\252\002\036Google.Prot"
111       "obuf.WellKnownTypesb\006proto3"
112   };
113   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
114       descriptor, 227);
115   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
116     "google/protobuf/duration.proto", &protobuf_RegisterTypes);
117 }
118 } // anonymous namespace
119 
AddDescriptors()120 void AddDescriptors() {
121   static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
122   ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
123 }
124 // Force AddDescriptors() to be called at dynamic initialization time.
125 struct StaticDescriptorInitializer {
StaticDescriptorInitializergoogle::protobuf::protobuf_google_2fprotobuf_2fduration_2eproto::StaticDescriptorInitializer126   StaticDescriptorInitializer() {
127     AddDescriptors();
128   }
129 } static_descriptor_initializer;
130 
131 }  // namespace protobuf_google_2fprotobuf_2fduration_2eproto
132 
133 
134 // ===================================================================
135 
136 #if !defined(_MSC_VER) || _MSC_VER >= 1900
137 const int Duration::kSecondsFieldNumber;
138 const int Duration::kNanosFieldNumber;
139 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
140 
Duration()141 Duration::Duration()
142   : ::google::protobuf::Message(), _internal_metadata_(NULL) {
143   if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
144     protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults();
145   }
146   SharedCtor();
147   // @@protoc_insertion_point(constructor:google.protobuf.Duration)
148 }
Duration(::google::protobuf::Arena * arena)149 Duration::Duration(::google::protobuf::Arena* arena)
150   : ::google::protobuf::Message(),
151   _internal_metadata_(arena) {
152   protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults();
153   SharedCtor();
154   RegisterArenaDtor(arena);
155   // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
156 }
Duration(const Duration & from)157 Duration::Duration(const Duration& from)
158   : ::google::protobuf::Message(),
159       _internal_metadata_(NULL),
160       _cached_size_(0) {
161   _internal_metadata_.MergeFrom(from._internal_metadata_);
162   ::memcpy(&seconds_, &from.seconds_,
163     static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
164     reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
165   // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
166 }
167 
SharedCtor()168 void Duration::SharedCtor() {
169   ::memset(&seconds_, 0, static_cast<size_t>(
170       reinterpret_cast<char*>(&nanos_) -
171       reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
172   _cached_size_ = 0;
173 }
174 
~Duration()175 Duration::~Duration() {
176   // @@protoc_insertion_point(destructor:google.protobuf.Duration)
177   SharedDtor();
178 }
179 
SharedDtor()180 void Duration::SharedDtor() {
181   ::google::protobuf::Arena* arena = GetArenaNoVirtual();
182   GOOGLE_DCHECK(arena == NULL);
183   if (arena != NULL) {
184     return;
185   }
186 
187 }
188 
ArenaDtor(void * object)189 void Duration::ArenaDtor(void* object) {
190   Duration* _this = reinterpret_cast< Duration* >(object);
191   (void)_this;
192 }
RegisterArenaDtor(::google::protobuf::Arena * arena)193 void Duration::RegisterArenaDtor(::google::protobuf::Arena* arena) {
194 }
SetCachedSize(int size) const195 void Duration::SetCachedSize(int size) const {
196   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
197   _cached_size_ = size;
198   GOOGLE_SAFE_CONCURRENT_WRITES_END();
199 }
descriptor()200 const ::google::protobuf::Descriptor* Duration::descriptor() {
201   protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce();
202   return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
203 }
204 
default_instance()205 const Duration& Duration::default_instance() {
206   protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults();
207   return *internal_default_instance();
208 }
209 
New(::google::protobuf::Arena * arena) const210 Duration* Duration::New(::google::protobuf::Arena* arena) const {
211   return ::google::protobuf::Arena::CreateMessage<Duration>(arena);
212 }
213 
Clear()214 void Duration::Clear() {
215 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
216   ::google::protobuf::uint32 cached_has_bits = 0;
217   // Prevent compiler warnings about cached_has_bits being unused
218   (void) cached_has_bits;
219 
220   ::memset(&seconds_, 0, static_cast<size_t>(
221       reinterpret_cast<char*>(&nanos_) -
222       reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
223   _internal_metadata_.Clear();
224 }
225 
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)226 bool Duration::MergePartialFromCodedStream(
227     ::google::protobuf::io::CodedInputStream* input) {
228 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
229   ::google::protobuf::uint32 tag;
230   // @@protoc_insertion_point(parse_start:google.protobuf.Duration)
231   for (;;) {
232     ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
233     tag = p.first;
234     if (!p.second) goto handle_unusual;
235     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
236       // int64 seconds = 1;
237       case 1: {
238         if (static_cast< ::google::protobuf::uint8>(tag) ==
239             static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
240 
241           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
242                    ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
243                  input, &seconds_)));
244         } else {
245           goto handle_unusual;
246         }
247         break;
248       }
249 
250       // int32 nanos = 2;
251       case 2: {
252         if (static_cast< ::google::protobuf::uint8>(tag) ==
253             static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
254 
255           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
256                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
257                  input, &nanos_)));
258         } else {
259           goto handle_unusual;
260         }
261         break;
262       }
263 
264       default: {
265       handle_unusual:
266         if (tag == 0) {
267           goto success;
268         }
269         DO_(::google::protobuf::internal::WireFormat::SkipField(
270               input, tag, _internal_metadata_.mutable_unknown_fields()));
271         break;
272       }
273     }
274   }
275 success:
276   // @@protoc_insertion_point(parse_success:google.protobuf.Duration)
277   return true;
278 failure:
279   // @@protoc_insertion_point(parse_failure:google.protobuf.Duration)
280   return false;
281 #undef DO_
282 }
283 
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const284 void Duration::SerializeWithCachedSizes(
285     ::google::protobuf::io::CodedOutputStream* output) const {
286   // @@protoc_insertion_point(serialize_start:google.protobuf.Duration)
287   ::google::protobuf::uint32 cached_has_bits = 0;
288   (void) cached_has_bits;
289 
290   // int64 seconds = 1;
291   if (this->seconds() != 0) {
292     ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
293   }
294 
295   // int32 nanos = 2;
296   if (this->nanos() != 0) {
297     ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
298   }
299 
300   if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
301     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
302         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
303   }
304   // @@protoc_insertion_point(serialize_end:google.protobuf.Duration)
305 }
306 
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const307 ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray(
308     bool deterministic, ::google::protobuf::uint8* target) const {
309   (void)deterministic; // Unused
310   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
311   ::google::protobuf::uint32 cached_has_bits = 0;
312   (void) cached_has_bits;
313 
314   // int64 seconds = 1;
315   if (this->seconds() != 0) {
316     target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
317   }
318 
319   // int32 nanos = 2;
320   if (this->nanos() != 0) {
321     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
322   }
323 
324   if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
325     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
326         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
327   }
328   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
329   return target;
330 }
331 
ByteSizeLong() const332 size_t Duration::ByteSizeLong() const {
333 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
334   size_t total_size = 0;
335 
336   if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
337     total_size +=
338       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
339         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
340   }
341   // int64 seconds = 1;
342   if (this->seconds() != 0) {
343     total_size += 1 +
344       ::google::protobuf::internal::WireFormatLite::Int64Size(
345         this->seconds());
346   }
347 
348   // int32 nanos = 2;
349   if (this->nanos() != 0) {
350     total_size += 1 +
351       ::google::protobuf::internal::WireFormatLite::Int32Size(
352         this->nanos());
353   }
354 
355   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
356   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
357   _cached_size_ = cached_size;
358   GOOGLE_SAFE_CONCURRENT_WRITES_END();
359   return total_size;
360 }
361 
MergeFrom(const::google::protobuf::Message & from)362 void Duration::MergeFrom(const ::google::protobuf::Message& from) {
363 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duration)
364   GOOGLE_DCHECK_NE(&from, this);
365   const Duration* source =
366       ::google::protobuf::internal::DynamicCastToGenerated<const Duration>(
367           &from);
368   if (source == NULL) {
369   // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Duration)
370     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
371   } else {
372   // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Duration)
373     MergeFrom(*source);
374   }
375 }
376 
MergeFrom(const Duration & from)377 void Duration::MergeFrom(const Duration& from) {
378 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
379   GOOGLE_DCHECK_NE(&from, this);
380   _internal_metadata_.MergeFrom(from._internal_metadata_);
381   ::google::protobuf::uint32 cached_has_bits = 0;
382   (void) cached_has_bits;
383 
384   if (from.seconds() != 0) {
385     set_seconds(from.seconds());
386   }
387   if (from.nanos() != 0) {
388     set_nanos(from.nanos());
389   }
390 }
391 
CopyFrom(const::google::protobuf::Message & from)392 void Duration::CopyFrom(const ::google::protobuf::Message& from) {
393 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration)
394   if (&from == this) return;
395   Clear();
396   MergeFrom(from);
397 }
398 
CopyFrom(const Duration & from)399 void Duration::CopyFrom(const Duration& from) {
400 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
401   if (&from == this) return;
402   Clear();
403   MergeFrom(from);
404 }
405 
IsInitialized() const406 bool Duration::IsInitialized() const {
407   return true;
408 }
409 
Swap(Duration * other)410 void Duration::Swap(Duration* other) {
411   if (other == this) return;
412   if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
413     InternalSwap(other);
414   } else {
415     Duration* temp = New(GetArenaNoVirtual());
416     temp->MergeFrom(*other);
417     other->CopyFrom(*this);
418     InternalSwap(temp);
419     if (GetArenaNoVirtual() == NULL) {
420       delete temp;
421     }
422   }
423 }
UnsafeArenaSwap(Duration * other)424 void Duration::UnsafeArenaSwap(Duration* other) {
425   if (other == this) return;
426   GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
427   InternalSwap(other);
428 }
InternalSwap(Duration * other)429 void Duration::InternalSwap(Duration* other) {
430   using std::swap;
431   swap(seconds_, other->seconds_);
432   swap(nanos_, other->nanos_);
433   _internal_metadata_.Swap(&other->_internal_metadata_);
434   swap(_cached_size_, other->_cached_size_);
435 }
436 
GetMetadata() const437 ::google::protobuf::Metadata Duration::GetMetadata() const {
438   protobuf_google_2fprotobuf_2fduration_2eproto::protobuf_AssignDescriptorsOnce();
439   return protobuf_google_2fprotobuf_2fduration_2eproto::file_level_metadata[kIndexInFileMessages];
440 }
441 
442 #if PROTOBUF_INLINE_NOT_IN_HEADERS
443 // Duration
444 
445 // int64 seconds = 1;
clear_seconds()446 void Duration::clear_seconds() {
447   seconds_ = GOOGLE_LONGLONG(0);
448 }
seconds() const449 ::google::protobuf::int64 Duration::seconds() const {
450   // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds)
451   return seconds_;
452 }
set_seconds(::google::protobuf::int64 value)453 void Duration::set_seconds(::google::protobuf::int64 value) {
454 
455   seconds_ = value;
456   // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds)
457 }
458 
459 // int32 nanos = 2;
clear_nanos()460 void Duration::clear_nanos() {
461   nanos_ = 0;
462 }
nanos() const463 ::google::protobuf::int32 Duration::nanos() const {
464   // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos)
465   return nanos_;
466 }
set_nanos(::google::protobuf::int32 value)467 void Duration::set_nanos(::google::protobuf::int32 value) {
468 
469   nanos_ = value;
470   // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos)
471 }
472 
473 #endif  // PROTOBUF_INLINE_NOT_IN_HEADERS
474 
475 // @@protoc_insertion_point(namespace_scope)
476 
477 }  // namespace protobuf
478 }  // namespace google
479 
480 // @@protoc_insertion_point(global_scope)
481