blob: c1c4402c3a9e7685cfa0eb61046c097edaf9cc82 [file] [log] [blame]
Feng Xiao33c92802015-05-11 13:47:41 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/timestamp.proto
3
4#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
Bo Yang1f0286a2015-12-04 13:18:44 -08005#include <google/protobuf/timestamp.pb.h>
Feng Xiao33c92802015-05-11 13:47:41 -07006
7#include <algorithm>
8
9#include <google/protobuf/stubs/common.h>
Feng Xiaoe841bac2015-12-11 17:09:20 -080010#include <google/protobuf/stubs/port.h>
Feng Xiao33c92802015-05-11 13:47:41 -070011#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
20namespace google {
21namespace protobuf {
22
23namespace {
24
25const ::google::protobuf::Descriptor* Timestamp_descriptor_ = NULL;
26const ::google::protobuf::internal::GeneratedMessageReflection*
27 Timestamp_reflection_ = NULL;
28
29} // namespace
30
31
32void protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto() {
33 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
34 const ::google::protobuf::FileDescriptor* file =
35 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
36 "google/protobuf/timestamp.proto");
37 GOOGLE_CHECK(file != NULL);
38 Timestamp_descriptor_ = file->message_type(0);
39 static const int Timestamp_offsets_[2] = {
40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_),
41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_),
42 };
43 Timestamp_reflection_ =
44 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
45 Timestamp_descriptor_,
46 Timestamp::default_instance_,
47 Timestamp_offsets_,
48 -1,
49 -1,
50 -1,
51 sizeof(Timestamp),
52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata_),
53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _is_default_instance_));
54}
55
56namespace {
57
58GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
59inline void protobuf_AssignDescriptorsOnce() {
60 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
61 &protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto);
62}
63
64void protobuf_RegisterTypes(const ::std::string&) {
65 protobuf_AssignDescriptorsOnce();
66 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
67 Timestamp_descriptor_, &Timestamp::default_instance());
68}
69
70} // namespace
71
72void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() {
73 delete Timestamp::default_instance_;
74 delete Timestamp_reflection_;
75}
76
77void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() {
78 static bool already_here = false;
79 if (already_here) return;
80 already_here = true;
81 GOOGLE_PROTOBUF_VERIFY_VERSION;
82
83 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
84 "\n\037google/protobuf/timestamp.proto\022\017googl"
85 "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
Feng Xiaoe841bac2015-12-11 17:09:20 -080086 "\022\r\n\005nanos\030\002 \001(\005BT\n\023com.google.protobufB\016"
87 "TimestampProtoP\001\240\001\001\370\001\001\242\002\003GPB\252\002\036Google.Pr"
88 "otobuf.WellKnownTypesb\006proto3", 189);
Feng Xiao33c92802015-05-11 13:47:41 -070089 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
90 "google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
91 Timestamp::default_instance_ = new Timestamp();
92 Timestamp::default_instance_->InitAsDefaultInstance();
93 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto);
94}
95
96// Force AddDescriptors() to be called at static initialization time.
97struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto {
98 StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() {
99 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
100 }
101} static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_;
102
103namespace {
104
105static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
106static void MergeFromFail(int line) {
107 GOOGLE_CHECK(false) << __FILE__ << ":" << line;
108}
109
110} // namespace
111
112
113// ===================================================================
114
Bo Yang1f0286a2015-12-04 13:18:44 -0800115#if !defined(_MSC_VER) || _MSC_VER >= 1900
Feng Xiao33c92802015-05-11 13:47:41 -0700116const int Timestamp::kSecondsFieldNumber;
117const int Timestamp::kNanosFieldNumber;
Bo Yang1f0286a2015-12-04 13:18:44 -0800118#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Feng Xiao33c92802015-05-11 13:47:41 -0700119
120Timestamp::Timestamp()
Bo Yang5db21732015-05-21 14:28:59 -0700121 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
Feng Xiao33c92802015-05-11 13:47:41 -0700122 SharedCtor();
123 // @@protoc_insertion_point(constructor:google.protobuf.Timestamp)
124}
125
Feng Xiaoe841bac2015-12-11 17:09:20 -0800126Timestamp::Timestamp(::google::protobuf::Arena* arena)
127 : ::google::protobuf::Message(),
128 _internal_metadata_(arena) {
129 SharedCtor();
130 RegisterArenaDtor(arena);
131 // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
132}
133
Feng Xiao33c92802015-05-11 13:47:41 -0700134void Timestamp::InitAsDefaultInstance() {
135 _is_default_instance_ = true;
136}
137
138Timestamp::Timestamp(const Timestamp& from)
139 : ::google::protobuf::Message(),
140 _internal_metadata_(NULL) {
141 SharedCtor();
142 MergeFrom(from);
143 // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp)
144}
145
146void Timestamp::SharedCtor() {
147 _is_default_instance_ = false;
148 _cached_size_ = 0;
149 seconds_ = GOOGLE_LONGLONG(0);
150 nanos_ = 0;
151}
152
153Timestamp::~Timestamp() {
154 // @@protoc_insertion_point(destructor:google.protobuf.Timestamp)
155 SharedDtor();
156}
157
158void Timestamp::SharedDtor() {
Feng Xiaoe841bac2015-12-11 17:09:20 -0800159 if (GetArenaNoVirtual() != NULL) {
160 return;
161 }
162
Feng Xiao33c92802015-05-11 13:47:41 -0700163 if (this != default_instance_) {
164 }
165}
166
Feng Xiaoe841bac2015-12-11 17:09:20 -0800167void Timestamp::ArenaDtor(void* object) {
168 Timestamp* _this = reinterpret_cast< Timestamp* >(object);
169 (void)_this;
170}
171void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) {
172}
Feng Xiao33c92802015-05-11 13:47:41 -0700173void Timestamp::SetCachedSize(int size) const {
174 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
175 _cached_size_ = size;
176 GOOGLE_SAFE_CONCURRENT_WRITES_END();
177}
178const ::google::protobuf::Descriptor* Timestamp::descriptor() {
179 protobuf_AssignDescriptorsOnce();
180 return Timestamp_descriptor_;
181}
182
183const Timestamp& Timestamp::default_instance() {
184 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto();
185 return *default_instance_;
186}
187
188Timestamp* Timestamp::default_instance_ = NULL;
189
190Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const {
Feng Xiaoe841bac2015-12-11 17:09:20 -0800191 return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena);
Feng Xiao33c92802015-05-11 13:47:41 -0700192}
193
194void Timestamp::Clear() {
195#define ZR_HELPER_(f) reinterpret_cast<char*>(\
196 &reinterpret_cast<Timestamp*>(16)->f)
197
198#define ZR_(first, last) do {\
199 ::memset(&first, 0,\
200 ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
201} while (0)
202
203 ZR_(seconds_, nanos_);
204
205#undef ZR_HELPER_
206#undef ZR_
207
208}
209
210bool Timestamp::MergePartialFromCodedStream(
211 ::google::protobuf::io::CodedInputStream* input) {
212#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
213 ::google::protobuf::uint32 tag;
214 // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp)
215 for (;;) {
216 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
217 tag = p.first;
218 if (!p.second) goto handle_unusual;
219 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
220 // optional int64 seconds = 1;
221 case 1: {
222 if (tag == 8) {
223 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
224 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
225 input, &seconds_)));
226
227 } else {
228 goto handle_unusual;
229 }
230 if (input->ExpectTag(16)) goto parse_nanos;
231 break;
232 }
233
234 // optional int32 nanos = 2;
235 case 2: {
236 if (tag == 16) {
237 parse_nanos:
238 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
239 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
240 input, &nanos_)));
241
242 } else {
243 goto handle_unusual;
244 }
245 if (input->ExpectAtEnd()) goto success;
246 break;
247 }
248
249 default: {
250 handle_unusual:
251 if (tag == 0 ||
252 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
253 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
254 goto success;
255 }
256 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
257 break;
258 }
259 }
260 }
261success:
262 // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp)
263 return true;
264failure:
265 // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp)
266 return false;
267#undef DO_
268}
269
270void Timestamp::SerializeWithCachedSizes(
271 ::google::protobuf::io::CodedOutputStream* output) const {
272 // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp)
273 // optional int64 seconds = 1;
274 if (this->seconds() != 0) {
275 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
276 }
277
278 // optional int32 nanos = 2;
279 if (this->nanos() != 0) {
280 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
281 }
282
283 // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp)
284}
285
286::google::protobuf::uint8* Timestamp::SerializeWithCachedSizesToArray(
287 ::google::protobuf::uint8* target) const {
288 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
289 // optional int64 seconds = 1;
290 if (this->seconds() != 0) {
291 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
292 }
293
294 // optional int32 nanos = 2;
295 if (this->nanos() != 0) {
296 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
297 }
298
299 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp)
300 return target;
301}
302
303int Timestamp::ByteSize() const {
304 int total_size = 0;
305
306 // optional int64 seconds = 1;
307 if (this->seconds() != 0) {
308 total_size += 1 +
309 ::google::protobuf::internal::WireFormatLite::Int64Size(
310 this->seconds());
311 }
312
313 // optional int32 nanos = 2;
314 if (this->nanos() != 0) {
315 total_size += 1 +
316 ::google::protobuf::internal::WireFormatLite::Int32Size(
317 this->nanos());
318 }
319
320 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
321 _cached_size_ = total_size;
322 GOOGLE_SAFE_CONCURRENT_WRITES_END();
323 return total_size;
324}
325
326void Timestamp::MergeFrom(const ::google::protobuf::Message& from) {
327 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
Bo Yang5db21732015-05-21 14:28:59 -0700328 const Timestamp* source =
329 ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>(
330 &from);
Feng Xiao33c92802015-05-11 13:47:41 -0700331 if (source == NULL) {
332 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
333 } else {
334 MergeFrom(*source);
335 }
336}
337
338void Timestamp::MergeFrom(const Timestamp& from) {
339 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
340 if (from.seconds() != 0) {
341 set_seconds(from.seconds());
342 }
343 if (from.nanos() != 0) {
344 set_nanos(from.nanos());
345 }
346}
347
348void Timestamp::CopyFrom(const ::google::protobuf::Message& from) {
349 if (&from == this) return;
350 Clear();
351 MergeFrom(from);
352}
353
354void Timestamp::CopyFrom(const Timestamp& from) {
355 if (&from == this) return;
356 Clear();
357 MergeFrom(from);
358}
359
360bool Timestamp::IsInitialized() const {
361
362 return true;
363}
364
365void Timestamp::Swap(Timestamp* other) {
366 if (other == this) return;
Feng Xiaoe841bac2015-12-11 17:09:20 -0800367 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
368 InternalSwap(other);
369 } else {
370 Timestamp temp;
371 temp.MergeFrom(*this);
372 CopyFrom(*other);
373 other->CopyFrom(temp);
374 }
375}
376void Timestamp::UnsafeArenaSwap(Timestamp* other) {
377 if (other == this) return;
378 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
Feng Xiao33c92802015-05-11 13:47:41 -0700379 InternalSwap(other);
380}
381void Timestamp::InternalSwap(Timestamp* other) {
382 std::swap(seconds_, other->seconds_);
383 std::swap(nanos_, other->nanos_);
384 _internal_metadata_.Swap(&other->_internal_metadata_);
385 std::swap(_cached_size_, other->_cached_size_);
386}
387
388::google::protobuf::Metadata Timestamp::GetMetadata() const {
389 protobuf_AssignDescriptorsOnce();
390 ::google::protobuf::Metadata metadata;
391 metadata.descriptor = Timestamp_descriptor_;
392 metadata.reflection = Timestamp_reflection_;
393 return metadata;
394}
395
396#if PROTOBUF_INLINE_NOT_IN_HEADERS
397// Timestamp
398
399// optional int64 seconds = 1;
Bo Yang5db21732015-05-21 14:28:59 -0700400void Timestamp::clear_seconds() {
Feng Xiao33c92802015-05-11 13:47:41 -0700401 seconds_ = GOOGLE_LONGLONG(0);
402}
403 ::google::protobuf::int64 Timestamp::seconds() const {
404 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds)
405 return seconds_;
406}
407 void Timestamp::set_seconds(::google::protobuf::int64 value) {
408
409 seconds_ = value;
410 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds)
411}
412
413// optional int32 nanos = 2;
Bo Yang5db21732015-05-21 14:28:59 -0700414void Timestamp::clear_nanos() {
Feng Xiao33c92802015-05-11 13:47:41 -0700415 nanos_ = 0;
416}
417 ::google::protobuf::int32 Timestamp::nanos() const {
418 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos)
419 return nanos_;
420}
421 void Timestamp::set_nanos(::google::protobuf::int32 value) {
422
423 nanos_ = value;
424 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos)
425}
426
427#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
428
429// @@protoc_insertion_point(namespace_scope)
430
431} // namespace protobuf
432} // namespace google
433
434// @@protoc_insertion_point(global_scope)