duration.pb.cc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/duration.proto
  3. #include "google/protobuf/duration.pb.h"
  4. #include <algorithm>
  5. #include "google/protobuf/io/coded_stream.h"
  6. #include "google/protobuf/extension_set.h"
  7. #include "google/protobuf/wire_format_lite.h"
  8. #include "google/protobuf/descriptor.h"
  9. #include "google/protobuf/generated_message_reflection.h"
  10. #include "google/protobuf/reflection_ops.h"
  11. #include "google/protobuf/wire_format.h"
  12. // @@protoc_insertion_point(includes)
  13. // Must be included last.
  14. #include "google/protobuf/port_def.inc"
  15. PROTOBUF_PRAGMA_INIT_SEG
  16. namespace _pb = ::PROTOBUF_NAMESPACE_ID;
  17. namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal;
  18. PROTOBUF_NAMESPACE_OPEN
  19. PROTOBUF_CONSTEXPR Duration::Duration(
  20. ::_pbi::ConstantInitialized): _impl_{
  21. /*decltype(_impl_.seconds_)*/ ::int64_t{0}
  22. , /*decltype(_impl_.nanos_)*/ 0
  23. , /*decltype(_impl_._cached_size_)*/{}} {}
  24. struct DurationDefaultTypeInternal {
  25. PROTOBUF_CONSTEXPR DurationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  26. ~DurationDefaultTypeInternal() {}
  27. union {
  28. Duration _instance;
  29. };
  30. };
  31. PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
  32. PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DurationDefaultTypeInternal _Duration_default_instance_;
  33. PROTOBUF_NAMESPACE_CLOSE
  34. static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fduration_2eproto[1];
  35. static constexpr const ::_pb::EnumDescriptor**
  36. file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
  37. static constexpr const ::_pb::ServiceDescriptor**
  38. file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto = nullptr;
  39. const ::uint32_t TableStruct_google_2fprotobuf_2fduration_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
  40. protodesc_cold) = {
  41. ~0u, // no _has_bits_
  42. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _internal_metadata_),
  43. ~0u, // no _extensions_
  44. ~0u, // no _oneof_case_
  45. ~0u, // no _weak_field_map_
  46. ~0u, // no _inlined_string_donated_
  47. ~0u, // no _split_
  48. ~0u, // no sizeof(Split)
  49. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.seconds_),
  50. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Duration, _impl_.nanos_),
  51. };
  52. static const ::_pbi::MigrationSchema
  53. schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  54. { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Duration)},
  55. };
  56. static const ::_pb::Message* const file_default_instances[] = {
  57. &::PROTOBUF_NAMESPACE_ID::_Duration_default_instance_._instance,
  58. };
  59. const char descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  60. "\n\036google/protobuf/duration.proto\022\017google"
  61. ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r"
  62. "\n\005nanos\030\002 \001(\005B\203\001\n\023com.google.protobufB\rD"
  63. "urationProtoP\001Z1google.golang.org/protob"
  64. "uf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Goo"
  65. "gle.Protobuf.WellKnownTypesb\006proto3"
  66. };
  67. static ::absl::once_flag descriptor_table_google_2fprotobuf_2fduration_2eproto_once;
  68. const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fduration_2eproto = {
  69. false,
  70. false,
  71. 235,
  72. descriptor_table_protodef_google_2fprotobuf_2fduration_2eproto,
  73. "google/protobuf/duration.proto",
  74. &descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
  75. nullptr,
  76. 0,
  77. 1,
  78. schemas,
  79. file_default_instances,
  80. TableStruct_google_2fprotobuf_2fduration_2eproto::offsets,
  81. file_level_metadata_google_2fprotobuf_2fduration_2eproto,
  82. file_level_enum_descriptors_google_2fprotobuf_2fduration_2eproto,
  83. file_level_service_descriptors_google_2fprotobuf_2fduration_2eproto,
  84. };
  85. // This function exists to be marked as weak.
  86. // It can significantly speed up compilation by breaking up LLVM's SCC
  87. // in the .pb.cc translation units. Large translation units see a
  88. // reduction of more than 35% of walltime for optimized builds. Without
  89. // the weak attribute all the messages in the file, including all the
  90. // vtables and everything they use become part of the same SCC through
  91. // a cycle like:
  92. // GetMetadata -> descriptor table -> default instances ->
  93. // vtables -> GetMetadata
  94. // By adding a weak function here we break the connection from the
  95. // individual vtables back into the descriptor table.
  96. PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fduration_2eproto_getter() {
  97. return &descriptor_table_google_2fprotobuf_2fduration_2eproto;
  98. }
  99. // Force running AddDescriptors() at dynamic initialization time.
  100. PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
  101. static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fduration_2eproto(&descriptor_table_google_2fprotobuf_2fduration_2eproto);
  102. PROTOBUF_NAMESPACE_OPEN
  103. // ===================================================================
  104. class Duration::_Internal {
  105. public:
  106. };
  107. Duration::Duration(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  108. : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
  109. SharedCtor(arena);
  110. // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
  111. }
  112. Duration::Duration(const Duration& from)
  113. : ::PROTOBUF_NAMESPACE_ID::Message(), _impl_(from._impl_) {
  114. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(
  115. from._internal_metadata_);
  116. // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration)
  117. }
  118. inline void Duration::SharedCtor(::_pb::Arena* arena) {
  119. (void)arena;
  120. new (&_impl_) Impl_{
  121. decltype(_impl_.seconds_) { ::int64_t{0} }
  122. , decltype(_impl_.nanos_) { 0 }
  123. , /*decltype(_impl_._cached_size_)*/{}
  124. };
  125. }
  126. Duration::~Duration() {
  127. // @@protoc_insertion_point(destructor:google.protobuf.Duration)
  128. if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  129. (void)arena;
  130. return;
  131. }
  132. SharedDtor();
  133. }
  134. inline void Duration::SharedDtor() {
  135. ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  136. }
  137. void Duration::SetCachedSize(int size) const {
  138. _impl_._cached_size_.Set(size);
  139. }
  140. void Duration::Clear() {
  141. // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration)
  142. ::uint32_t cached_has_bits = 0;
  143. // Prevent compiler warnings about cached_has_bits being unused
  144. (void) cached_has_bits;
  145. ::memset(&_impl_.seconds_, 0, static_cast<::size_t>(
  146. reinterpret_cast<char*>(&_impl_.nanos_) -
  147. reinterpret_cast<char*>(&_impl_.seconds_)) + sizeof(_impl_.nanos_));
  148. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  149. }
  150. const char* Duration::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
  151. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  152. while (!ctx->Done(&ptr)) {
  153. ::uint32_t tag;
  154. ptr = ::_pbi::ReadTag(ptr, &tag);
  155. switch (tag >> 3) {
  156. // int64 seconds = 1;
  157. case 1:
  158. if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
  159. _impl_.seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  160. CHK_(ptr);
  161. } else {
  162. goto handle_unusual;
  163. }
  164. continue;
  165. // int32 nanos = 2;
  166. case 2:
  167. if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
  168. _impl_.nanos_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
  169. CHK_(ptr);
  170. } else {
  171. goto handle_unusual;
  172. }
  173. continue;
  174. default:
  175. goto handle_unusual;
  176. } // switch
  177. handle_unusual:
  178. if ((tag == 0) || ((tag & 7) == 4)) {
  179. CHK_(ptr);
  180. ctx->SetLastTag(tag);
  181. goto message_done;
  182. }
  183. ptr = UnknownFieldParse(
  184. tag,
  185. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  186. ptr, ctx);
  187. CHK_(ptr != nullptr);
  188. } // while
  189. message_done:
  190. return ptr;
  191. failure:
  192. ptr = nullptr;
  193. goto message_done;
  194. #undef CHK_
  195. }
  196. ::uint8_t* Duration::_InternalSerialize(
  197. ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  198. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
  199. ::uint32_t cached_has_bits = 0;
  200. (void) cached_has_bits;
  201. // int64 seconds = 1;
  202. if (this->_internal_seconds() != 0) {
  203. target = stream->EnsureSpace(target);
  204. target = ::_pbi::WireFormatLite::WriteInt64ToArray(
  205. 1, this->_internal_seconds(), target);
  206. }
  207. // int32 nanos = 2;
  208. if (this->_internal_nanos() != 0) {
  209. target = stream->EnsureSpace(target);
  210. target = ::_pbi::WireFormatLite::WriteInt32ToArray(
  211. 2, this->_internal_nanos(), target);
  212. }
  213. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  214. target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
  215. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  216. }
  217. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration)
  218. return target;
  219. }
  220. ::size_t Duration::ByteSizeLong() const {
  221. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration)
  222. ::size_t total_size = 0;
  223. ::uint32_t cached_has_bits = 0;
  224. // Prevent compiler warnings about cached_has_bits being unused
  225. (void) cached_has_bits;
  226. // int64 seconds = 1;
  227. if (this->_internal_seconds() != 0) {
  228. total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
  229. this->_internal_seconds());
  230. }
  231. // int32 nanos = 2;
  232. if (this->_internal_nanos() != 0) {
  233. total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
  234. this->_internal_nanos());
  235. }
  236. return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
  237. }
  238. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Duration::_class_data_ = {
  239. ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
  240. Duration::MergeImpl
  241. };
  242. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Duration::GetClassData() const { return &_class_data_; }
  243. void Duration::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  244. auto* const _this = static_cast<Duration*>(&to_msg);
  245. auto& from = static_cast<const Duration&>(from_msg);
  246. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Duration)
  247. ABSL_DCHECK_NE(&from, _this);
  248. ::uint32_t cached_has_bits = 0;
  249. (void) cached_has_bits;
  250. if (from._internal_seconds() != 0) {
  251. _this->_internal_set_seconds(from._internal_seconds());
  252. }
  253. if (from._internal_nanos() != 0) {
  254. _this->_internal_set_nanos(from._internal_nanos());
  255. }
  256. _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  257. }
  258. void Duration::CopyFrom(const Duration& from) {
  259. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Duration)
  260. if (&from == this) return;
  261. Clear();
  262. MergeFrom(from);
  263. }
  264. bool Duration::IsInitialized() const {
  265. return true;
  266. }
  267. void Duration::InternalSwap(Duration* other) {
  268. using std::swap;
  269. _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  270. ::PROTOBUF_NAMESPACE_ID::internal::memswap<
  271. PROTOBUF_FIELD_OFFSET(Duration, _impl_.nanos_)
  272. + sizeof(Duration::_impl_.nanos_)
  273. - PROTOBUF_FIELD_OFFSET(Duration, _impl_.seconds_)>(
  274. reinterpret_cast<char*>(&_impl_.seconds_),
  275. reinterpret_cast<char*>(&other->_impl_.seconds_));
  276. }
  277. ::PROTOBUF_NAMESPACE_ID::Metadata Duration::GetMetadata() const {
  278. return ::_pbi::AssignDescriptors(
  279. &descriptor_table_google_2fprotobuf_2fduration_2eproto_getter, &descriptor_table_google_2fprotobuf_2fduration_2eproto_once,
  280. file_level_metadata_google_2fprotobuf_2fduration_2eproto[0]);
  281. }
  282. // @@protoc_insertion_point(namespace_scope)
  283. PROTOBUF_NAMESPACE_CLOSE
  284. PROTOBUF_NAMESPACE_OPEN
  285. template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Duration*
  286. Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Duration >(Arena* arena) {
  287. return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Duration >(arena);
  288. }
  289. PROTOBUF_NAMESPACE_CLOSE
  290. // @@protoc_insertion_point(global_scope)
  291. #include "google/protobuf/port_undef.inc"