1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: google/protobuf/timestamp.proto
3
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
5 #include <google/protobuf/timestamp.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* Timestamp_descriptor_ = NULL;
26 const ::google::protobuf::internal::GeneratedMessageReflection*
27 Timestamp_reflection_ = NULL;
28
29 } // namespace
30
31
32 void protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto()33 void protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto() {
34 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
35 const ::google::protobuf::FileDescriptor* file =
36 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
37 "google/protobuf/timestamp.proto");
38 GOOGLE_CHECK(file != NULL);
39 Timestamp_descriptor_ = file->message_type(0);
40 static const int Timestamp_offsets_[2] = {
41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_),
42 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_),
43 };
44 Timestamp_reflection_ =
45 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
46 Timestamp_descriptor_,
47 Timestamp::default_instance_,
48 Timestamp_offsets_,
49 -1,
50 -1,
51 -1,
52 sizeof(Timestamp),
53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata_),
54 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _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_2ftimestamp_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 Timestamp_descriptor_, &Timestamp::default_instance());
70 }
71
72 } // namespace
73
protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto()74 void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() {
75 delete Timestamp::default_instance_;
76 delete Timestamp_reflection_;
77 }
78
79 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() GOOGLE_ATTRIBUTE_COLD;
protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto()80 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_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\037google/protobuf/timestamp.proto\022\017googl"
88 "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
89 "\022\r\n\005nanos\030\002 \001(\005B\201\001\n\023com.google.protobufB"
90 "\016TimestampProtoP\001Z+github.com/golang/pro"
91 "tobuf/ptypes/timestamp\240\001\001\370\001\001\242\002\003GPB\252\002\036Goo"
92 "gle.Protobuf.WellKnownTypesb\006proto3", 235);
93 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
94 "google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
95 Timestamp::default_instance_ = new Timestamp();
96 Timestamp::default_instance_->InitAsDefaultInstance();
97 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto);
98 }
99
100 // Force AddDescriptors() to be called at static initialization time.
101 struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto {
StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eprotogoogle::protobuf::StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto102 StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() {
103 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
104 }
105 } static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_;
106
107 // ===================================================================
108
109 #if !defined(_MSC_VER) || _MSC_VER >= 1900
110 const int Timestamp::kSecondsFieldNumber;
111 const int Timestamp::kNanosFieldNumber;
112 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
113
Timestamp()114 Timestamp::Timestamp()
115 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
116 SharedCtor();
117 // @@protoc_insertion_point(constructor:google.protobuf.Timestamp)
118 }
119
Timestamp(::google::protobuf::Arena * arena)120 Timestamp::Timestamp(::google::protobuf::Arena* arena)
121 : ::google::protobuf::Message(),
122 _internal_metadata_(arena) {
123 SharedCtor();
124 RegisterArenaDtor(arena);
125 // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
126 }
127
InitAsDefaultInstance()128 void Timestamp::InitAsDefaultInstance() {
129 _is_default_instance_ = true;
130 }
131
Timestamp(const Timestamp & from)132 Timestamp::Timestamp(const Timestamp& from)
133 : ::google::protobuf::Message(),
134 _internal_metadata_(NULL) {
135 SharedCtor();
136 MergeFrom(from);
137 // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp)
138 }
139
SharedCtor()140 void Timestamp::SharedCtor() {
141 _is_default_instance_ = false;
142 _cached_size_ = 0;
143 seconds_ = GOOGLE_LONGLONG(0);
144 nanos_ = 0;
145 }
146
~Timestamp()147 Timestamp::~Timestamp() {
148 // @@protoc_insertion_point(destructor:google.protobuf.Timestamp)
149 SharedDtor();
150 }
151
SharedDtor()152 void Timestamp::SharedDtor() {
153 if (GetArenaNoVirtual() != NULL) {
154 return;
155 }
156
157 if (this != default_instance_) {
158 }
159 }
160
ArenaDtor(void * object)161 void Timestamp::ArenaDtor(void* object) {
162 Timestamp* _this = reinterpret_cast< Timestamp* >(object);
163 (void)_this;
164 }
RegisterArenaDtor(::google::protobuf::Arena * arena)165 void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) {
166 }
SetCachedSize(int size) const167 void Timestamp::SetCachedSize(int size) const {
168 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
169 _cached_size_ = size;
170 GOOGLE_SAFE_CONCURRENT_WRITES_END();
171 }
descriptor()172 const ::google::protobuf::Descriptor* Timestamp::descriptor() {
173 protobuf_AssignDescriptorsOnce();
174 return Timestamp_descriptor_;
175 }
176
default_instance()177 const Timestamp& Timestamp::default_instance() {
178 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
179 return *default_instance_;
180 }
181
182 Timestamp* Timestamp::default_instance_ = NULL;
183
New(::google::protobuf::Arena * arena) const184 Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const {
185 return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena);
186 }
187
Clear()188 void Timestamp::Clear() {
189 // @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp)
190 #if defined(__clang__)
191 #define ZR_HELPER_(f) \
192 _Pragma("clang diagnostic push") \
193 _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
194 __builtin_offsetof(Timestamp, f) \
195 _Pragma("clang diagnostic pop")
196 #else
197 #define ZR_HELPER_(f) reinterpret_cast<char*>(\
198 &reinterpret_cast<Timestamp*>(16)->f)
199 #endif
200
201 #define ZR_(first, last) do {\
202 ::memset(&first, 0,\
203 ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
204 } while (0)
205
206 ZR_(seconds_, nanos_);
207
208 #undef ZR_HELPER_
209 #undef ZR_
210
211 }
212
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)213 bool Timestamp::MergePartialFromCodedStream(
214 ::google::protobuf::io::CodedInputStream* input) {
215 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
216 ::google::protobuf::uint32 tag;
217 // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp)
218 for (;;) {
219 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
220 tag = p.first;
221 if (!p.second) goto handle_unusual;
222 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
223 // optional int64 seconds = 1;
224 case 1: {
225 if (tag == 8) {
226 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
227 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
228 input, &seconds_)));
229
230 } else {
231 goto handle_unusual;
232 }
233 if (input->ExpectTag(16)) goto parse_nanos;
234 break;
235 }
236
237 // optional int32 nanos = 2;
238 case 2: {
239 if (tag == 16) {
240 parse_nanos:
241 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
242 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
243 input, &nanos_)));
244
245 } else {
246 goto handle_unusual;
247 }
248 if (input->ExpectAtEnd()) goto success;
249 break;
250 }
251
252 default: {
253 handle_unusual:
254 if (tag == 0 ||
255 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
256 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
257 goto success;
258 }
259 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
260 break;
261 }
262 }
263 }
264 success:
265 // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp)
266 return true;
267 failure:
268 // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp)
269 return false;
270 #undef DO_
271 }
272
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const273 void Timestamp::SerializeWithCachedSizes(
274 ::google::protobuf::io::CodedOutputStream* output) const {
275 // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp)
276 // optional int64 seconds = 1;
277 if (this->seconds() != 0) {
278 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
279 }
280
281 // optional int32 nanos = 2;
282 if (this->nanos() != 0) {
283 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
284 }
285
286 // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp)
287 }
288
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const289 ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray(
290 bool deterministic, ::google::protobuf::uint8* target) const {
291 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
292 // optional int64 seconds = 1;
293 if (this->seconds() != 0) {
294 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
295 }
296
297 // optional int32 nanos = 2;
298 if (this->nanos() != 0) {
299 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
300 }
301
302 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp)
303 return target;
304 }
305
ByteSize() const306 int Timestamp::ByteSize() const {
307 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp)
308 int total_size = 0;
309
310 // optional int64 seconds = 1;
311 if (this->seconds() != 0) {
312 total_size += 1 +
313 ::google::protobuf::internal::WireFormatLite::Int64Size(
314 this->seconds());
315 }
316
317 // optional int32 nanos = 2;
318 if (this->nanos() != 0) {
319 total_size += 1 +
320 ::google::protobuf::internal::WireFormatLite::Int32Size(
321 this->nanos());
322 }
323
324 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
325 _cached_size_ = total_size;
326 GOOGLE_SAFE_CONCURRENT_WRITES_END();
327 return total_size;
328 }
329
MergeFrom(const::google::protobuf::Message & from)330 void Timestamp::MergeFrom(const ::google::protobuf::Message& from) {
331 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Timestamp)
332 if (GOOGLE_PREDICT_FALSE(&from == this)) {
333 ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
334 }
335 const Timestamp* source =
336 ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>(
337 &from);
338 if (source == NULL) {
339 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Timestamp)
340 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
341 } else {
342 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Timestamp)
343 MergeFrom(*source);
344 }
345 }
346
MergeFrom(const Timestamp & from)347 void Timestamp::MergeFrom(const Timestamp& from) {
348 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Timestamp)
349 if (GOOGLE_PREDICT_FALSE(&from == this)) {
350 ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
351 }
352 if (from.seconds() != 0) {
353 set_seconds(from.seconds());
354 }
355 if (from.nanos() != 0) {
356 set_nanos(from.nanos());
357 }
358 }
359
CopyFrom(const::google::protobuf::Message & from)360 void Timestamp::CopyFrom(const ::google::protobuf::Message& from) {
361 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Timestamp)
362 if (&from == this) return;
363 Clear();
364 MergeFrom(from);
365 }
366
CopyFrom(const Timestamp & from)367 void Timestamp::CopyFrom(const Timestamp& from) {
368 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Timestamp)
369 if (&from == this) return;
370 Clear();
371 MergeFrom(from);
372 }
373
IsInitialized() const374 bool Timestamp::IsInitialized() const {
375
376 return true;
377 }
378
Swap(Timestamp * other)379 void Timestamp::Swap(Timestamp* other) {
380 if (other == this) return;
381 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
382 InternalSwap(other);
383 } else {
384 Timestamp temp;
385 temp.MergeFrom(*this);
386 CopyFrom(*other);
387 other->CopyFrom(temp);
388 }
389 }
UnsafeArenaSwap(Timestamp * other)390 void Timestamp::UnsafeArenaSwap(Timestamp* other) {
391 if (other == this) return;
392 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
393 InternalSwap(other);
394 }
InternalSwap(Timestamp * other)395 void Timestamp::InternalSwap(Timestamp* other) {
396 std::swap(seconds_, other->seconds_);
397 std::swap(nanos_, other->nanos_);
398 _internal_metadata_.Swap(&other->_internal_metadata_);
399 std::swap(_cached_size_, other->_cached_size_);
400 }
401
GetMetadata() const402 ::google::protobuf::Metadata Timestamp::GetMetadata() const {
403 protobuf_AssignDescriptorsOnce();
404 ::google::protobuf::Metadata metadata;
405 metadata.descriptor = Timestamp_descriptor_;
406 metadata.reflection = Timestamp_reflection_;
407 return metadata;
408 }
409
410 #if PROTOBUF_INLINE_NOT_IN_HEADERS
411 // Timestamp
412
413 // optional int64 seconds = 1;
clear_seconds()414 void Timestamp::clear_seconds() {
415 seconds_ = GOOGLE_LONGLONG(0);
416 }
seconds() const417 ::google::protobuf::int64 Timestamp::seconds() const {
418 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds)
419 return seconds_;
420 }
set_seconds(::google::protobuf::int64 value)421 void Timestamp::set_seconds(::google::protobuf::int64 value) {
422
423 seconds_ = value;
424 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds)
425 }
426
427 // optional int32 nanos = 2;
clear_nanos()428 void Timestamp::clear_nanos() {
429 nanos_ = 0;
430 }
nanos() const431 ::google::protobuf::int32 Timestamp::nanos() const {
432 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos)
433 return nanos_;
434 }
set_nanos(::google::protobuf::int32 value)435 void Timestamp::set_nanos(::google::protobuf::int32 value) {
436
437 nanos_ = value;
438 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos)
439 }
440
441 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS
442
443 // @@protoc_insertion_point(namespace_scope)
444
445 } // namespace protobuf
446 } // namespace google
447
448 // @@protoc_insertion_point(global_scope)
449