• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
18 PROTOBUF_PRAGMA_INIT_SEG
19 
20 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21 namespace _pbi = _pb::internal;
22 
23 PROTOBUF_NAMESPACE_OPEN
Timestamp(::_pbi::ConstantInitialized)24 PROTOBUF_CONSTEXPR Timestamp::Timestamp(
25     ::_pbi::ConstantInitialized)
26   : seconds_(int64_t{0})
27   , nanos_(0){}
28 struct TimestampDefaultTypeInternal {
TimestampDefaultTypeInternalTimestampDefaultTypeInternal29   PROTOBUF_CONSTEXPR TimestampDefaultTypeInternal()
30       : _instance(::_pbi::ConstantInitialized{}) {}
~TimestampDefaultTypeInternalTimestampDefaultTypeInternal31   ~TimestampDefaultTypeInternal() {}
32   union {
33     Timestamp _instance;
34   };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TimestampDefaultTypeInternal _Timestamp_default_instance_;
37 PROTOBUF_NAMESPACE_CLOSE
38 static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto[1];
39 static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
40 static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto = nullptr;
41 
42 const uint32_t TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
43   ~0u,  // no _has_bits_
44   PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, _internal_metadata_),
45   ~0u,  // no _extensions_
46   ~0u,  // no _oneof_case_
47   ~0u,  // no _weak_field_map_
48   ~0u,  // no _inlined_string_donated_
49   PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, seconds_),
50   PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Timestamp, nanos_),
51 };
52 static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
53   { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Timestamp)},
54 };
55 
56 static const ::_pb::Message* const file_default_instances[] = {
57   &::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_._instance,
58 };
59 
60 const char descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
61   "\n\037google/protobuf/timestamp.proto\022\017googl"
62   "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
63   "\022\r\n\005nanos\030\002 \001(\005B\205\001\n\023com.google.protobufB"
64   "\016TimestampProtoP\001Z2google.golang.org/pro"
65   "tobuf/types/known/timestamppb\370\001\001\242\002\003GPB\252\002"
66   "\036Google.Protobuf.WellKnownTypesb\006proto3"
67   ;
68 static ::_pbi::once_flag descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once;
69 const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2ftimestamp_2eproto = {
70     false, false, 239, descriptor_table_protodef_google_2fprotobuf_2ftimestamp_2eproto,
71     "google/protobuf/timestamp.proto",
72     &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once, nullptr, 0, 1,
73     schemas, file_default_instances, TableStruct_google_2fprotobuf_2ftimestamp_2eproto::offsets,
74     file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto, file_level_enum_descriptors_google_2fprotobuf_2ftimestamp_2eproto,
75     file_level_service_descriptors_google_2fprotobuf_2ftimestamp_2eproto,
76 };
descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_getter()77 PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_getter() {
78   return &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto;
79 }
80 
81 // Force running AddDescriptors() at dynamic initialization time.
82 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2ftimestamp_2eproto(&descriptor_table_google_2fprotobuf_2ftimestamp_2eproto);
83 PROTOBUF_NAMESPACE_OPEN
84 
85 // ===================================================================
86 
87 class Timestamp::_Internal {
88  public:
89 };
90 
Timestamp(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)91 Timestamp::Timestamp(::PROTOBUF_NAMESPACE_ID::Arena* arena,
92                          bool is_message_owned)
93   : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
94   SharedCtor();
95   // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
96 }
Timestamp(const Timestamp & from)97 Timestamp::Timestamp(const Timestamp& from)
98   : ::PROTOBUF_NAMESPACE_ID::Message() {
99   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
100   ::memcpy(&seconds_, &from.seconds_,
101     static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
102     reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
103   // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp)
104 }
105 
SharedCtor()106 inline void Timestamp::SharedCtor() {
107 ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
108     reinterpret_cast<char*>(&seconds_) - reinterpret_cast<char*>(this)),
109     0, static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
110     reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
111 }
112 
~Timestamp()113 Timestamp::~Timestamp() {
114   // @@protoc_insertion_point(destructor:google.protobuf.Timestamp)
115   if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
116   (void)arena;
117     return;
118   }
119   SharedDtor();
120 }
121 
SharedDtor()122 inline void Timestamp::SharedDtor() {
123   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
124 }
125 
SetCachedSize(int size) const126 void Timestamp::SetCachedSize(int size) const {
127   _cached_size_.Set(size);
128 }
129 
Clear()130 void Timestamp::Clear() {
131 // @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp)
132   uint32_t cached_has_bits = 0;
133   // Prevent compiler warnings about cached_has_bits being unused
134   (void) cached_has_bits;
135 
136   ::memset(&seconds_, 0, static_cast<size_t>(
137       reinterpret_cast<char*>(&nanos_) -
138       reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
139   _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
140 }
141 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)142 const char* Timestamp::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
143 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
144   while (!ctx->Done(&ptr)) {
145     uint32_t tag;
146     ptr = ::_pbi::ReadTag(ptr, &tag);
147     switch (tag >> 3) {
148       // int64 seconds = 1;
149       case 1:
150         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
151           seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
152           CHK_(ptr);
153         } else
154           goto handle_unusual;
155         continue;
156       // int32 nanos = 2;
157       case 2:
158         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
159           nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
160           CHK_(ptr);
161         } else
162           goto handle_unusual;
163         continue;
164       default:
165         goto handle_unusual;
166     }  // switch
167   handle_unusual:
168     if ((tag == 0) || ((tag & 7) == 4)) {
169       CHK_(ptr);
170       ctx->SetLastTag(tag);
171       goto message_done;
172     }
173     ptr = UnknownFieldParse(
174         tag,
175         _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
176         ptr, ctx);
177     CHK_(ptr != nullptr);
178   }  // while
179 message_done:
180   return ptr;
181 failure:
182   ptr = nullptr;
183   goto message_done;
184 #undef CHK_
185 }
186 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const187 uint8_t* Timestamp::_InternalSerialize(
188     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
189   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
190   uint32_t cached_has_bits = 0;
191   (void) cached_has_bits;
192 
193   // int64 seconds = 1;
194   if (this->_internal_seconds() != 0) {
195     target = stream->EnsureSpace(target);
196     target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_seconds(), target);
197   }
198 
199   // int32 nanos = 2;
200   if (this->_internal_nanos() != 0) {
201     target = stream->EnsureSpace(target);
202     target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_nanos(), target);
203   }
204 
205   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
206     target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
207         _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
208   }
209   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp)
210   return target;
211 }
212 
ByteSizeLong() const213 size_t Timestamp::ByteSizeLong() const {
214 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp)
215   size_t total_size = 0;
216 
217   uint32_t cached_has_bits = 0;
218   // Prevent compiler warnings about cached_has_bits being unused
219   (void) cached_has_bits;
220 
221   // int64 seconds = 1;
222   if (this->_internal_seconds() != 0) {
223     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_seconds());
224   }
225 
226   // int32 nanos = 2;
227   if (this->_internal_nanos() != 0) {
228     total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_nanos());
229   }
230 
231   return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
232 }
233 
234 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Timestamp::_class_data_ = {
235     ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
236     Timestamp::MergeImpl
237 };
GetClassData() const238 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Timestamp::GetClassData() const { return &_class_data_; }
239 
MergeImpl(::PROTOBUF_NAMESPACE_ID::Message * to,const::PROTOBUF_NAMESPACE_ID::Message & from)240 void Timestamp::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
241                       const ::PROTOBUF_NAMESPACE_ID::Message& from) {
242   static_cast<Timestamp *>(to)->MergeFrom(
243       static_cast<const Timestamp &>(from));
244 }
245 
246 
MergeFrom(const Timestamp & from)247 void Timestamp::MergeFrom(const Timestamp& from) {
248 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Timestamp)
249   GOOGLE_DCHECK_NE(&from, this);
250   uint32_t cached_has_bits = 0;
251   (void) cached_has_bits;
252 
253   if (from._internal_seconds() != 0) {
254     _internal_set_seconds(from._internal_seconds());
255   }
256   if (from._internal_nanos() != 0) {
257     _internal_set_nanos(from._internal_nanos());
258   }
259   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
260 }
261 
CopyFrom(const Timestamp & from)262 void Timestamp::CopyFrom(const Timestamp& from) {
263 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Timestamp)
264   if (&from == this) return;
265   Clear();
266   MergeFrom(from);
267 }
268 
IsInitialized() const269 bool Timestamp::IsInitialized() const {
270   return true;
271 }
272 
InternalSwap(Timestamp * other)273 void Timestamp::InternalSwap(Timestamp* other) {
274   using std::swap;
275   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
276   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
277       PROTOBUF_FIELD_OFFSET(Timestamp, nanos_)
278       + sizeof(Timestamp::nanos_)
279       - PROTOBUF_FIELD_OFFSET(Timestamp, seconds_)>(
280           reinterpret_cast<char*>(&seconds_),
281           reinterpret_cast<char*>(&other->seconds_));
282 }
283 
GetMetadata() const284 ::PROTOBUF_NAMESPACE_ID::Metadata Timestamp::GetMetadata() const {
285   return ::_pbi::AssignDescriptors(
286       &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_getter, &descriptor_table_google_2fprotobuf_2ftimestamp_2eproto_once,
287       file_level_metadata_google_2fprotobuf_2ftimestamp_2eproto[0]);
288 }
289 
290 // @@protoc_insertion_point(namespace_scope)
291 PROTOBUF_NAMESPACE_CLOSE
292 PROTOBUF_NAMESPACE_OPEN
293 template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Timestamp*
CreateMaybeMessage(Arena * arena)294 Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Timestamp >(Arena* arena) {
295   return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Timestamp >(arena);
296 }
297 PROTOBUF_NAMESPACE_CLOSE
298 
299 // @@protoc_insertion_point(global_scope)
300 #include <google/protobuf/port_undef.inc>
301