1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: google/protobuf/duration.proto
3
4 #include <google/protobuf/duration.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 PROTOBUF_NAMESPACE_OPEN
Duration(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)20 constexpr Duration::Duration(
21 ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
22 : seconds_(int64_t{0})
23 , nanos_(0){}
24 struct DurationDefaultTypeInternal {
DurationDefaultTypeInternalDurationDefaultTypeInternal25 constexpr DurationDefaultTypeInternal()
26 : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~DurationDefaultTypeInternalDurationDefaultTypeInternal27 ~DurationDefaultTypeInternal() {}
28 union {
29 Duration _instance;
30 };
31 };
32 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DurationDefaultTypeInternal _Duration_default_instance_;
33 PROTOBUF_NAMESPACE_CLOSE
34 static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2fprotobuf_2fduration_2eproto[1];
35 static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
36 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
37
38 const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
39 ~0u, // no _has_bits_
40 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
41 ~0u, // no _extensions_
42 ~0u, // no _oneof_case_
43 ~0u, // no _weak_field_map_
44 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, seconds_),
45 PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Duration, nanos_),
46 };
47 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
48 { 0, -1, sizeof(PROTOBUF_NAMESPACE_ID::Duration)},
49 };
50
51 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
52 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&PROTOBUF_NAMESPACE_ID::_Duration_default_instance_),
53 };
54
55 const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
56 "\n\036google/protobuf/duration.proto\022\017google"
57 ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
58 "\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
59 "urationProtoP\001Z1google.golang.org/protob"
60 "uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
61 "gle.Protobuf.WellKnownTypesb\006proto3"
62 ;
63 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once;
64 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = {
65 false, false, 235, descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto, "google/protobuf/duration.proto",
66 &descriptor_table_google_2fprotobuf_2fduration_2eproto_once, nullptr, 0, 1,
67 schemas, file_default_instances, TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
68 file_level_metadata_google_2fprotobuf_2fduration_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto, file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto,
69 };
descriptor_table_google_2fprotobuf_2fduration_2eproto_getter()70 PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_google_2fprotobuf_2fduration_2eproto_getter() {
71 return &descriptor_table_google_2fprotobuf_2fduration_2eproto;
72 }
73
74 // Force running AddDescriptors() at dynamic initialization time.
75 PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto(&descriptor_table_google_2fprotobuf_2fduration_2eproto);
76 PROTOBUF_NAMESPACE_OPEN
77
78 // ===================================================================
79
80 class Duration::_Internal {
81 public:
82 };
83
Duration(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)84 Duration::Duration(::PROTOBUF_NAMESPACE_ID::Arena* arena,
85 bool is_message_owned)
86 : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
87 SharedCtor();
88 if (!is_message_owned) {
89 RegisterArenaDtor(arena);
90 }
91 // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
92 }
Duration(const Duration & from)93 Duration::Duration(const Duration& from)
94 : ::PROTOBUF_NAMESPACE_ID::Message() {
95 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
96 ::memcpy(&seconds_, &from.seconds_,
97 static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
98 reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
99 // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
100 }
101
SharedCtor()102 inline void Duration::SharedCtor() {
103 ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
104 reinterpret_cast<char*>(&seconds_) - reinterpret_cast<char*>(this)),
105 0, static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
106 reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
107 }
108
~Duration()109 Duration::~Duration() {
110 // @@protoc_insertion_point(destructor:google.protobuf.Duration)
111 if (GetArenaForAllocation() != nullptr) return;
112 SharedDtor();
113 _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
114 }
115
SharedDtor()116 inline void Duration::SharedDtor() {
117 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
118 }
119
ArenaDtor(void * object)120 void Duration::ArenaDtor(void* object) {
121 Duration* _this = reinterpret_cast< Duration* >(object);
122 (void)_this;
123 }
RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *)124 void Duration::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
125 }
SetCachedSize(int size) const126 void Duration::SetCachedSize(int size) const {
127 _cached_size_.Set(size);
128 }
129
Clear()130 void Duration::Clear() {
131 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
132 ::PROTOBUF_NAMESPACE_ID::uint32 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,::PROTOBUF_NAMESPACE_ID::internal::ParseContext * ctx)142 const char* Duration::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
143 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
144 while (!ctx->Done(&ptr)) {
145 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
146 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
147 switch (tag >> 3) {
148 // int64 seconds = 1;
149 case 1:
150 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
151 seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
152 CHK_(ptr);
153 } else goto handle_unusual;
154 continue;
155 // int32 nanos = 2;
156 case 2:
157 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
158 nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
159 CHK_(ptr);
160 } else goto handle_unusual;
161 continue;
162 default: {
163 handle_unusual:
164 if ((tag == 0) || ((tag & 7) == 4)) {
165 CHK_(ptr);
166 ctx->SetLastTag(tag);
167 goto success;
168 }
169 ptr = UnknownFieldParse(tag,
170 _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
171 ptr, ctx);
172 CHK_(ptr != nullptr);
173 continue;
174 }
175 } // switch
176 } // while
177 success:
178 return ptr;
179 failure:
180 ptr = nullptr;
181 goto success;
182 #undef CHK_
183 }
184
_InternalSerialize(::PROTOBUF_NAMESPACE_ID::uint8 * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const185 ::PROTOBUF_NAMESPACE_ID::uint8* Duration::_InternalSerialize(
186 ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
187 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
188 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
189 (void) cached_has_bits;
190
191 // int64 seconds = 1;
192 if (this->_internal_seconds() != 0) {
193 target = stream->EnsureSpace(target);
194 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_seconds(), target);
195 }
196
197 // int32 nanos = 2;
198 if (this->_internal_nanos() != 0) {
199 target = stream->EnsureSpace(target);
200 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_nanos(), target);
201 }
202
203 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
204 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
205 _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
206 }
207 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
208 return target;
209 }
210
ByteSizeLong() const211 size_t Duration::ByteSizeLong() const {
212 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
213 size_t total_size = 0;
214
215 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
216 // Prevent compiler warnings about cached_has_bits being unused
217 (void) cached_has_bits;
218
219 // int64 seconds = 1;
220 if (this->_internal_seconds() != 0) {
221 total_size += 1 +
222 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
223 this->_internal_seconds());
224 }
225
226 // int32 nanos = 2;
227 if (this->_internal_nanos() != 0) {
228 total_size += 1 +
229 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
230 this->_internal_nanos());
231 }
232
233 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
234 return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
235 _internal_metadata_, total_size, &_cached_size_);
236 }
237 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
238 SetCachedSize(cached_size);
239 return total_size;
240 }
241
242 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Duration::_class_data_ = {
243 ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
244 Duration::MergeImpl
245 };
GetClassData() const246 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Duration::GetClassData() const { return &_class_data_; }
247
MergeImpl(::PROTOBUF_NAMESPACE_ID::Message * to,const::PROTOBUF_NAMESPACE_ID::Message & from)248 void Duration::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message*to,
249 const ::PROTOBUF_NAMESPACE_ID::Message&from) {
250 static_cast<Duration *>(to)->MergeFrom(
251 static_cast<const Duration &>(from));
252 }
253
254
MergeFrom(const Duration & from)255 void Duration::MergeFrom(const Duration& from) {
256 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
257 GOOGLE_DCHECK_NE(&from, this);
258 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
259 (void) cached_has_bits;
260
261 if (from._internal_seconds() != 0) {
262 _internal_set_seconds(from._internal_seconds());
263 }
264 if (from._internal_nanos() != 0) {
265 _internal_set_nanos(from._internal_nanos());
266 }
267 _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
268 }
269
CopyFrom(const Duration & from)270 void Duration::CopyFrom(const Duration& from) {
271 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
272 if (&from == this) return;
273 Clear();
274 MergeFrom(from);
275 }
276
IsInitialized() const277 bool Duration::IsInitialized() const {
278 return true;
279 }
280
InternalSwap(Duration * other)281 void Duration::InternalSwap(Duration* other) {
282 using std::swap;
283 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
284 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
285 PROTOBUF_FIELD_OFFSET(Duration, nanos_)
286 + sizeof(Duration::nanos_)
287 - PROTOBUF_FIELD_OFFSET(Duration, seconds_)>(
288 reinterpret_cast<char*>(&seconds_),
289 reinterpret_cast<char*>(&other->seconds_));
290 }
291
GetMetadata() const292 ::PROTOBUF_NAMESPACE_ID::Metadata Duration::GetMetadata() const {
293 return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
294 &descriptor_table_google_2fprotobuf_2fduration_2eproto_getter, &descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
295 file_level_metadata_google_2fprotobuf_2fduration_2eproto[0]);
296 }
297
298 // @@protoc_insertion_point(namespace_scope)
299 PROTOBUF_NAMESPACE_CLOSE
300 PROTOBUF_NAMESPACE_OPEN
CreateMaybeMessage(Arena * arena)301 template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Duration* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Duration >(Arena* arena) {
302 return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Duration >(arena);
303 }
304 PROTOBUF_NAMESPACE_CLOSE
305
306 // @@protoc_insertion_point(global_scope)
307 #include <google/protobuf/port_undef.inc>
308