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