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