• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
23 namespace {
24 
25 const ::google::protobuf::Descriptor* Duration_descriptor_ = NULL;
26 const ::google::protobuf::internal::GeneratedMessageReflection*
27   Duration_reflection_ = NULL;
28 
29 }  // namespace
30 
31 
32 void protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto()33 void protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() {
34   protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto();
35   const ::google::protobuf::FileDescriptor* file =
36     ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
37       "google/protobuf/duration.proto");
38   GOOGLE_CHECK(file != NULL);
39   Duration_descriptor_ = file->message_type(0);
40   static const int Duration_offsets_[2] = {
41     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_),
42     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_),
43   };
44   Duration_reflection_ =
45     ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
46       Duration_descriptor_,
47       Duration::default_instance_,
48       Duration_offsets_,
49       -1,
50       -1,
51       -1,
52       sizeof(Duration),
53       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadata_),
54       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _is_default_instance_));
55 }
56 
57 namespace {
58 
59 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
protobuf_AssignDescriptorsOnce()60 inline void protobuf_AssignDescriptorsOnce() {
61   ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
62                  &protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto);
63 }
64 
65 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
protobuf_RegisterTypes(const::std::string &)66 void protobuf_RegisterTypes(const ::std::string&) {
67   protobuf_AssignDescriptorsOnce();
68   ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
69       Duration_descriptor_, &Duration::default_instance());
70 }
71 
72 }  // namespace
73 
protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto()74 void protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto() {
75   delete Duration::default_instance_;
76   delete Duration_reflection_;
77 }
78 
79 void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto()80 void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() {
81   static bool already_here = false;
82   if (already_here) return;
83   already_here = true;
84   GOOGLE_PROTOBUF_VERIFY_VERSION;
85 
86   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
87     "\n\036google/protobuf/duration.proto\022\017google"
88     ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
89     "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu"
90     "rationProtoP\001Z*github.com/golang/protobu"
91     "f/ptypes/duration\240\001\001\242\002\003GPB\252\002\036Google.Prot"
92     "obuf.WellKnownTypesb\006proto3", 227);
93   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
94     "google/protobuf/duration.proto", &protobuf_RegisterTypes);
95   Duration::default_instance_ = new Duration();
96   Duration::default_instance_->InitAsDefaultInstance();
97   ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto);
98 }
99 
100 // Force AddDescriptors() to be called at static initialization time.
101 struct StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto {
StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eprotogoogle::protobuf::StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto102   StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto() {
103     protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto();
104   }
105 } static_descriptor_initializer_google_2fprotobuf_2fduration_2eproto_;
106 
107 // ===================================================================
108 
109 #if !defined(_MSC_VER) || _MSC_VER >= 1900
110 const int Duration::kSecondsFieldNumber;
111 const int Duration::kNanosFieldNumber;
112 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
113 
Duration()114 Duration::Duration()
115   : ::google::protobuf::Message(), _internal_metadata_(NULL) {
116   SharedCtor();
117   // @@protoc_insertion_point(constructor:google.protobuf.Duration)
118 }
119 
InitAsDefaultInstance()120 void Duration::InitAsDefaultInstance() {
121   _is_default_instance_ = true;
122 }
123 
Duration(const Duration & from)124 Duration::Duration(const Duration& from)
125   : ::google::protobuf::Message(),
126     _internal_metadata_(NULL) {
127   SharedCtor();
128   MergeFrom(from);
129   // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
130 }
131 
SharedCtor()132 void Duration::SharedCtor() {
133     _is_default_instance_ = false;
134   _cached_size_ = 0;
135   seconds_ = GOOGLE_LONGLONG(0);
136   nanos_ = 0;
137 }
138 
~Duration()139 Duration::~Duration() {
140   // @@protoc_insertion_point(destructor:google.protobuf.Duration)
141   SharedDtor();
142 }
143 
SharedDtor()144 void Duration::SharedDtor() {
145   if (this != default_instance_) {
146   }
147 }
148 
SetCachedSize(int size) const149 void Duration::SetCachedSize(int size) const {
150   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
151   _cached_size_ = size;
152   GOOGLE_SAFE_CONCURRENT_WRITES_END();
153 }
descriptor()154 const ::google::protobuf::Descriptor* Duration::descriptor() {
155   protobuf_AssignDescriptorsOnce();
156   return Duration_descriptor_;
157 }
158 
default_instance()159 const Duration& Duration::default_instance() {
160   if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto();
161   return *default_instance_;
162 }
163 
164 Duration* Duration::default_instance_ = NULL;
165 
New(::google::protobuf::Arena * arena) const166 Duration* Duration::New(::google::protobuf::Arena* arena) const {
167   Duration* n = new Duration;
168   if (arena != NULL) {
169     arena->Own(n);
170   }
171   return n;
172 }
173 
Clear()174 void Duration::Clear() {
175 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
176 #if defined(__clang__)
177 #define ZR_HELPER_(f) \
178   _Pragma("clang diagnostic push") \
179   _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
180   __builtin_offsetof(Duration, f) \
181   _Pragma("clang diagnostic pop")
182 #else
183 #define ZR_HELPER_(f) reinterpret_cast<char*>(\
184   &reinterpret_cast<Duration*>(16)->f)
185 #endif
186 
187 #define ZR_(first, last) do {\
188   ::memset(&first, 0,\
189            ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
190 } while (0)
191 
192   ZR_(seconds_, nanos_);
193 
194 #undef ZR_HELPER_
195 #undef ZR_
196 
197 }
198 
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)199 bool Duration::MergePartialFromCodedStream(
200     ::google::protobuf::io::CodedInputStream* input) {
201 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
202   ::google::protobuf::uint32 tag;
203   // @@protoc_insertion_point(parse_start:google.protobuf.Duration)
204   for (;;) {
205     ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
206     tag = p.first;
207     if (!p.second) goto handle_unusual;
208     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
209       // optional int64 seconds = 1;
210       case 1: {
211         if (tag == 8) {
212           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
213                    ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
214                  input, &seconds_)));
215 
216         } else {
217           goto handle_unusual;
218         }
219         if (input->ExpectTag(16)) goto parse_nanos;
220         break;
221       }
222 
223       // optional int32 nanos = 2;
224       case 2: {
225         if (tag == 16) {
226          parse_nanos:
227           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
228                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
229                  input, &nanos_)));
230 
231         } else {
232           goto handle_unusual;
233         }
234         if (input->ExpectAtEnd()) goto success;
235         break;
236       }
237 
238       default: {
239       handle_unusual:
240         if (tag == 0 ||
241             ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
242             ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
243           goto success;
244         }
245         DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
246         break;
247       }
248     }
249   }
250 success:
251   // @@protoc_insertion_point(parse_success:google.protobuf.Duration)
252   return true;
253 failure:
254   // @@protoc_insertion_point(parse_failure:google.protobuf.Duration)
255   return false;
256 #undef DO_
257 }
258 
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const259 void Duration::SerializeWithCachedSizes(
260     ::google::protobuf::io::CodedOutputStream* output) const {
261   // @@protoc_insertion_point(serialize_start:google.protobuf.Duration)
262   // optional int64 seconds = 1;
263   if (this->seconds() != 0) {
264     ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
265   }
266 
267   // optional int32 nanos = 2;
268   if (this->nanos() != 0) {
269     ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
270   }
271 
272   // @@protoc_insertion_point(serialize_end:google.protobuf.Duration)
273 }
274 
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const275 ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray(
276     bool deterministic, ::google::protobuf::uint8* target) const {
277   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
278   // optional int64 seconds = 1;
279   if (this->seconds() != 0) {
280     target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
281   }
282 
283   // optional int32 nanos = 2;
284   if (this->nanos() != 0) {
285     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
286   }
287 
288   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
289   return target;
290 }
291 
ByteSize() const292 int Duration::ByteSize() const {
293 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
294   int total_size = 0;
295 
296   // optional int64 seconds = 1;
297   if (this->seconds() != 0) {
298     total_size += 1 +
299       ::google::protobuf::internal::WireFormatLite::Int64Size(
300         this->seconds());
301   }
302 
303   // optional int32 nanos = 2;
304   if (this->nanos() != 0) {
305     total_size += 1 +
306       ::google::protobuf::internal::WireFormatLite::Int32Size(
307         this->nanos());
308   }
309 
310   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
311   _cached_size_ = total_size;
312   GOOGLE_SAFE_CONCURRENT_WRITES_END();
313   return total_size;
314 }
315 
MergeFrom(const::google::protobuf::Message & from)316 void Duration::MergeFrom(const ::google::protobuf::Message& from) {
317 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duration)
318   if (GOOGLE_PREDICT_FALSE(&from == this)) {
319     ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
320   }
321   const Duration* source =
322       ::google::protobuf::internal::DynamicCastToGenerated<const Duration>(
323           &from);
324   if (source == NULL) {
325   // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Duration)
326     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
327   } else {
328   // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Duration)
329     MergeFrom(*source);
330   }
331 }
332 
MergeFrom(const Duration & from)333 void Duration::MergeFrom(const Duration& from) {
334 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
335   if (GOOGLE_PREDICT_FALSE(&from == this)) {
336     ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
337   }
338   if (from.seconds() != 0) {
339     set_seconds(from.seconds());
340   }
341   if (from.nanos() != 0) {
342     set_nanos(from.nanos());
343   }
344 }
345 
CopyFrom(const::google::protobuf::Message & from)346 void Duration::CopyFrom(const ::google::protobuf::Message& from) {
347 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration)
348   if (&from == this) return;
349   Clear();
350   MergeFrom(from);
351 }
352 
CopyFrom(const Duration & from)353 void Duration::CopyFrom(const Duration& from) {
354 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
355   if (&from == this) return;
356   Clear();
357   MergeFrom(from);
358 }
359 
IsInitialized() const360 bool Duration::IsInitialized() const {
361 
362   return true;
363 }
364 
Swap(Duration * other)365 void Duration::Swap(Duration* other) {
366   if (other == this) return;
367   InternalSwap(other);
368 }
InternalSwap(Duration * other)369 void Duration::InternalSwap(Duration* other) {
370   std::swap(seconds_, other->seconds_);
371   std::swap(nanos_, other->nanos_);
372   _internal_metadata_.Swap(&other->_internal_metadata_);
373   std::swap(_cached_size_, other->_cached_size_);
374 }
375 
GetMetadata() const376 ::google::protobuf::Metadata Duration::GetMetadata() const {
377   protobuf_AssignDescriptorsOnce();
378   ::google::protobuf::Metadata metadata;
379   metadata.descriptor = Duration_descriptor_;
380   metadata.reflection = Duration_reflection_;
381   return metadata;
382 }
383 
384 #if PROTOBUF_INLINE_NOT_IN_HEADERS
385 // Duration
386 
387 // optional int64 seconds = 1;
clear_seconds()388 void Duration::clear_seconds() {
389   seconds_ = GOOGLE_LONGLONG(0);
390 }
seconds() const391  ::google::protobuf::int64 Duration::seconds() const {
392   // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds)
393   return seconds_;
394 }
set_seconds(::google::protobuf::int64 value)395  void Duration::set_seconds(::google::protobuf::int64 value) {
396 
397   seconds_ = value;
398   // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds)
399 }
400 
401 // optional int32 nanos = 2;
clear_nanos()402 void Duration::clear_nanos() {
403   nanos_ = 0;
404 }
nanos() const405  ::google::protobuf::int32 Duration::nanos() const {
406   // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos)
407   return nanos_;
408 }
set_nanos(::google::protobuf::int32 value)409  void Duration::set_nanos(::google::protobuf::int32 value) {
410 
411   nanos_ = value;
412   // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos)
413 }
414 
415 #endif  // PROTOBUF_INLINE_NOT_IN_HEADERS
416 
417 // @@protoc_insertion_point(namespace_scope)
418 
419 }  // namespace protobuf
420 }  // namespace google
421 
422 // @@protoc_insertion_point(global_scope)
423