any.pb.cc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/any.proto
  3. #include "google/protobuf/any.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. #if defined(__llvm__)
  19. #pragma clang diagnostic push
  20. #pragma clang diagnostic ignored "-Wuninitialized"
  21. #endif // __llvm__
  22. PROTOBUF_NAMESPACE_OPEN
  23. PROTOBUF_CONSTEXPR Any::Any(
  24. ::_pbi::ConstantInitialized): _impl_{
  25. /*decltype(_impl_.type_url_)*/ {
  26. &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  27. }
  28. , /*decltype(_impl_.value_)*/ {
  29. &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
  30. }
  31. , /*decltype(_impl_._cached_size_)*/{}
  32. , /*decltype(_impl_._any_metadata_)*/{&_impl_.type_url_, &_impl_.value_}} {}
  33. struct AnyDefaultTypeInternal {
  34. PROTOBUF_CONSTEXPR AnyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
  35. ~AnyDefaultTypeInternal() {}
  36. union {
  37. Any _instance;
  38. };
  39. };
  40. PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
  41. PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AnyDefaultTypeInternal _Any_default_instance_;
  42. PROTOBUF_NAMESPACE_CLOSE
  43. static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fany_2eproto[1];
  44. static constexpr const ::_pb::EnumDescriptor**
  45. file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
  46. static constexpr const ::_pb::ServiceDescriptor**
  47. file_level_service_descriptors_google_2fprotobuf_2fany_2eproto = nullptr;
  48. const ::uint32_t TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
  49. protodesc_cold) = {
  50. ~0u, // no _has_bits_
  51. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_),
  52. ~0u, // no _extensions_
  53. ~0u, // no _oneof_case_
  54. ~0u, // no _weak_field_map_
  55. ~0u, // no _inlined_string_donated_
  56. ~0u, // no _split_
  57. ~0u, // no sizeof(Split)
  58. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.type_url_),
  59. PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _impl_.value_),
  60. };
  61. static const ::_pbi::MigrationSchema
  62. schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  63. { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Any)},
  64. };
  65. static const ::_pb::Message* const file_default_instances[] = {
  66. &::PROTOBUF_NAMESPACE_ID::_Any_default_instance_._instance,
  67. };
  68. const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  69. "\n\031google/protobuf/any.proto\022\017google.prot"
  70. "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
  71. " \001(\014Bv\n\023com.google.protobufB\010AnyProtoP\001Z"
  72. ",google.golang.org/protobuf/types/known/"
  73. "anypb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownT"
  74. "ypesb\006proto3"
  75. };
  76. static ::absl::once_flag descriptor_table_google_2fprotobuf_2fany_2eproto_once;
  77. const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto = {
  78. false,
  79. false,
  80. 212,
  81. descriptor_table_protodef_google_2fprotobuf_2fany_2eproto,
  82. "google/protobuf/any.proto",
  83. &descriptor_table_google_2fprotobuf_2fany_2eproto_once,
  84. nullptr,
  85. 0,
  86. 1,
  87. schemas,
  88. file_default_instances,
  89. TableStruct_google_2fprotobuf_2fany_2eproto::offsets,
  90. file_level_metadata_google_2fprotobuf_2fany_2eproto,
  91. file_level_enum_descriptors_google_2fprotobuf_2fany_2eproto,
  92. file_level_service_descriptors_google_2fprotobuf_2fany_2eproto,
  93. };
  94. // This function exists to be marked as weak.
  95. // It can significantly speed up compilation by breaking up LLVM's SCC
  96. // in the .pb.cc translation units. Large translation units see a
  97. // reduction of more than 35% of walltime for optimized builds. Without
  98. // the weak attribute all the messages in the file, including all the
  99. // vtables and everything they use become part of the same SCC through
  100. // a cycle like:
  101. // GetMetadata -> descriptor table -> default instances ->
  102. // vtables -> GetMetadata
  103. // By adding a weak function here we break the connection from the
  104. // individual vtables back into the descriptor table.
  105. PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fany_2eproto_getter() {
  106. return &descriptor_table_google_2fprotobuf_2fany_2eproto;
  107. }
  108. // Force running AddDescriptors() at dynamic initialization time.
  109. PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
  110. static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fany_2eproto(&descriptor_table_google_2fprotobuf_2fany_2eproto);
  111. PROTOBUF_NAMESPACE_OPEN
  112. // ===================================================================
  113. bool Any::GetAnyFieldDescriptors(
  114. const ::PROTOBUF_NAMESPACE_ID::Message& message,
  115. const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
  116. const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field) {
  117. return ::_pbi::GetAnyFieldDescriptors(
  118. message, type_url_field, value_field);
  119. }
  120. bool Any::ParseAnyTypeUrl(
  121. ::absl::string_view type_url,
  122. std::string* full_type_name) {
  123. return ::_pbi::ParseAnyTypeUrl(type_url, full_type_name);
  124. }
  125. class Any::_Internal {
  126. public:
  127. };
  128. Any::Any(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  129. : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
  130. SharedCtor(arena);
  131. // @@protoc_insertion_point(arena_constructor:google.protobuf.Any)
  132. }
  133. Any::Any(const Any& from)
  134. : ::PROTOBUF_NAMESPACE_ID::Message() {
  135. Any* const _this = this; (void)_this;
  136. new (&_impl_) Impl_{
  137. decltype(_impl_.type_url_) {}
  138. , decltype(_impl_.value_) {}
  139. , /*decltype(_impl_._cached_size_)*/{}
  140. , /*decltype(_impl_._any_metadata_)*/{&_impl_.type_url_, &_impl_.value_}};
  141. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  142. _impl_.type_url_.InitDefault();
  143. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  144. _impl_.type_url_.Set("", GetArenaForAllocation());
  145. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  146. if (!from._internal_type_url().empty()) {
  147. _this->_impl_.type_url_.Set(from._internal_type_url(), _this->GetArenaForAllocation());
  148. }
  149. _impl_.value_.InitDefault();
  150. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  151. _impl_.value_.Set("", GetArenaForAllocation());
  152. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  153. if (!from._internal_value().empty()) {
  154. _this->_impl_.value_.Set(from._internal_value(), _this->GetArenaForAllocation());
  155. }
  156. // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
  157. }
  158. inline void Any::SharedCtor(::_pb::Arena* arena) {
  159. (void)arena;
  160. new (&_impl_) Impl_{
  161. decltype(_impl_.type_url_) {}
  162. , decltype(_impl_.value_) {}
  163. , /*decltype(_impl_._cached_size_)*/{}
  164. , /*decltype(_impl_._any_metadata_)*/{&_impl_.type_url_, &_impl_.value_}
  165. };
  166. _impl_.type_url_.InitDefault();
  167. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  168. _impl_.type_url_.Set("", GetArenaForAllocation());
  169. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  170. _impl_.value_.InitDefault();
  171. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  172. _impl_.value_.Set("", GetArenaForAllocation());
  173. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  174. }
  175. Any::~Any() {
  176. // @@protoc_insertion_point(destructor:google.protobuf.Any)
  177. if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  178. (void)arena;
  179. return;
  180. }
  181. SharedDtor();
  182. }
  183. inline void Any::SharedDtor() {
  184. ABSL_DCHECK(GetArenaForAllocation() == nullptr);
  185. _impl_.type_url_.Destroy();
  186. _impl_.value_.Destroy();
  187. _impl_._any_metadata_.~AnyMetadata();
  188. }
  189. void Any::SetCachedSize(int size) const {
  190. _impl_._cached_size_.Set(size);
  191. }
  192. void Any::Clear() {
  193. // @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
  194. ::uint32_t cached_has_bits = 0;
  195. // Prevent compiler warnings about cached_has_bits being unused
  196. (void) cached_has_bits;
  197. _impl_.type_url_.ClearToEmpty();
  198. _impl_.value_.ClearToEmpty();
  199. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  200. }
  201. const char* Any::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
  202. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  203. while (!ctx->Done(&ptr)) {
  204. ::uint32_t tag;
  205. ptr = ::_pbi::ReadTag(ptr, &tag);
  206. switch (tag >> 3) {
  207. // string type_url = 1;
  208. case 1:
  209. if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
  210. auto str = _internal_mutable_type_url();
  211. ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
  212. CHK_(ptr);
  213. CHK_(::_pbi::VerifyUTF8(str, "google.protobuf.Any.type_url"));
  214. } else {
  215. goto handle_unusual;
  216. }
  217. continue;
  218. // bytes value = 2;
  219. case 2:
  220. if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
  221. auto str = _internal_mutable_value();
  222. ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
  223. CHK_(ptr);
  224. } else {
  225. goto handle_unusual;
  226. }
  227. continue;
  228. default:
  229. goto handle_unusual;
  230. } // switch
  231. handle_unusual:
  232. if ((tag == 0) || ((tag & 7) == 4)) {
  233. CHK_(ptr);
  234. ctx->SetLastTag(tag);
  235. goto message_done;
  236. }
  237. ptr = UnknownFieldParse(
  238. tag,
  239. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  240. ptr, ctx);
  241. CHK_(ptr != nullptr);
  242. } // while
  243. message_done:
  244. return ptr;
  245. failure:
  246. ptr = nullptr;
  247. goto message_done;
  248. #undef CHK_
  249. }
  250. ::uint8_t* Any::_InternalSerialize(
  251. ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  252. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
  253. ::uint32_t cached_has_bits = 0;
  254. (void) cached_has_bits;
  255. // string type_url = 1;
  256. if (!this->_internal_type_url().empty()) {
  257. const std::string& _s = this->_internal_type_url();
  258. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  259. _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "google.protobuf.Any.type_url");
  260. target = stream->WriteStringMaybeAliased(1, _s, target);
  261. }
  262. // bytes value = 2;
  263. if (!this->_internal_value().empty()) {
  264. const std::string& _s = this->_internal_value();
  265. target = stream->WriteBytesMaybeAliased(2, _s, target);
  266. }
  267. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  268. target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
  269. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  270. }
  271. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
  272. return target;
  273. }
  274. ::size_t Any::ByteSizeLong() const {
  275. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
  276. ::size_t total_size = 0;
  277. ::uint32_t cached_has_bits = 0;
  278. // Prevent compiler warnings about cached_has_bits being unused
  279. (void) cached_has_bits;
  280. // string type_url = 1;
  281. if (!this->_internal_type_url().empty()) {
  282. total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  283. this->_internal_type_url());
  284. }
  285. // bytes value = 2;
  286. if (!this->_internal_value().empty()) {
  287. total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
  288. this->_internal_value());
  289. }
  290. return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
  291. }
  292. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Any::_class_data_ = {
  293. ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
  294. Any::MergeImpl
  295. };
  296. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Any::GetClassData() const { return &_class_data_; }
  297. void Any::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  298. auto* const _this = static_cast<Any*>(&to_msg);
  299. auto& from = static_cast<const Any&>(from_msg);
  300. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
  301. ABSL_DCHECK_NE(&from, _this);
  302. ::uint32_t cached_has_bits = 0;
  303. (void) cached_has_bits;
  304. if (!from._internal_type_url().empty()) {
  305. _this->_internal_set_type_url(from._internal_type_url());
  306. }
  307. if (!from._internal_value().empty()) {
  308. _this->_internal_set_value(from._internal_value());
  309. }
  310. _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  311. }
  312. void Any::CopyFrom(const Any& from) {
  313. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
  314. if (&from == this) return;
  315. Clear();
  316. MergeFrom(from);
  317. }
  318. bool Any::IsInitialized() const {
  319. return true;
  320. }
  321. void Any::InternalSwap(Any* other) {
  322. using std::swap;
  323. auto* lhs_arena = GetArenaForAllocation();
  324. auto* rhs_arena = other->GetArenaForAllocation();
  325. _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  326. ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.type_url_, lhs_arena,
  327. &other->_impl_.type_url_, rhs_arena);
  328. ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, lhs_arena,
  329. &other->_impl_.value_, rhs_arena);
  330. }
  331. ::PROTOBUF_NAMESPACE_ID::Metadata Any::GetMetadata() const {
  332. return ::_pbi::AssignDescriptors(
  333. &descriptor_table_google_2fprotobuf_2fany_2eproto_getter, &descriptor_table_google_2fprotobuf_2fany_2eproto_once,
  334. file_level_metadata_google_2fprotobuf_2fany_2eproto[0]);
  335. }
  336. // @@protoc_insertion_point(namespace_scope)
  337. PROTOBUF_NAMESPACE_CLOSE
  338. PROTOBUF_NAMESPACE_OPEN
  339. template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Any*
  340. Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) {
  341. return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Any >(arena);
  342. }
  343. PROTOBUF_NAMESPACE_CLOSE
  344. // @@protoc_insertion_point(global_scope)
  345. #if defined(__llvm__)
  346. #pragma clang diagnostic pop
  347. #endif // __llvm__
  348. #include "google/protobuf/port_undef.inc"