You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

any.pb.h 14 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/any.proto
  3. #ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
  4. #define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto
  5. #include <limits>
  6. #include <string>
  7. #include <google/protobuf/port_def.inc>
  8. #if PROTOBUF_VERSION < 3021000
  9. #error This file was generated by a newer version of protoc which is
  10. #error incompatible with your Protocol Buffer headers. Please update
  11. #error your headers.
  12. #endif
  13. #if 3021006 < PROTOBUF_MIN_PROTOC_VERSION
  14. #error This file was generated by an older version of protoc which is
  15. #error incompatible with your Protocol Buffer headers. Please
  16. #error regenerate this file with a newer version of protoc.
  17. #endif
  18. #include <google/protobuf/port_undef.inc>
  19. #include <google/protobuf/io/coded_stream.h>
  20. #include <google/protobuf/arena.h>
  21. #include <google/protobuf/arenastring.h>
  22. #include <google/protobuf/generated_message_util.h>
  23. #include <google/protobuf/metadata_lite.h>
  24. #include <google/protobuf/generated_message_reflection.h>
  25. #include <google/protobuf/message.h>
  26. #include <google/protobuf/repeated_field.h> // IWYU pragma: export
  27. #include <google/protobuf/extension_set.h> // IWYU pragma: export
  28. #include <google/protobuf/unknown_field_set.h>
  29. // @@protoc_insertion_point(includes)
  30. #include <google/protobuf/port_def.inc>
  31. #define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto PROTOBUF_EXPORT
  32. PROTOBUF_NAMESPACE_OPEN
  33. namespace internal {
  34. class AnyMetadata;
  35. } // namespace internal
  36. PROTOBUF_NAMESPACE_CLOSE
  37. // Internal implementation detail -- do not use these members.
  38. struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto {
  39. static const uint32_t offsets[];
  40. };
  41. PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto;
  42. PROTOBUF_NAMESPACE_OPEN
  43. class Any;
  44. struct AnyDefaultTypeInternal;
  45. PROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_;
  46. PROTOBUF_NAMESPACE_CLOSE
  47. PROTOBUF_NAMESPACE_OPEN
  48. template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(Arena*);
  49. PROTOBUF_NAMESPACE_CLOSE
  50. PROTOBUF_NAMESPACE_OPEN
  51. // ===================================================================
  52. class PROTOBUF_EXPORT Any final :
  53. public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {
  54. public:
  55. inline Any() : Any(nullptr) {}
  56. ~Any() override;
  57. explicit PROTOBUF_CONSTEXPR Any(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
  58. Any(const Any& from);
  59. Any(Any&& from) noexcept
  60. : Any() {
  61. *this = ::std::move(from);
  62. }
  63. inline Any& operator=(const Any& from) {
  64. CopyFrom(from);
  65. return *this;
  66. }
  67. inline Any& operator=(Any&& from) noexcept {
  68. if (this == &from) return *this;
  69. if (GetOwningArena() == from.GetOwningArena()
  70. #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
  71. && GetOwningArena() != nullptr
  72. #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
  73. ) {
  74. InternalSwap(&from);
  75. } else {
  76. CopyFrom(from);
  77. }
  78. return *this;
  79. }
  80. static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
  81. return GetDescriptor();
  82. }
  83. static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
  84. return default_instance().GetMetadata().descriptor;
  85. }
  86. static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
  87. return default_instance().GetMetadata().reflection;
  88. }
  89. static const Any& default_instance() {
  90. return *internal_default_instance();
  91. }
  92. static inline const Any* internal_default_instance() {
  93. return reinterpret_cast<const Any*>(
  94. &_Any_default_instance_);
  95. }
  96. static constexpr int kIndexInFileMessages =
  97. 0;
  98. // implements Any -----------------------------------------------
  99. bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message) {
  100. GOOGLE_DCHECK_NE(&message, this);
  101. return _impl_._any_metadata_.PackFrom(GetArena(), message);
  102. }
  103. bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message,
  104. ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) {
  105. GOOGLE_DCHECK_NE(&message, this);
  106. return _impl_._any_metadata_.PackFrom(GetArena(), message, type_url_prefix);
  107. }
  108. bool UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const {
  109. return _impl_._any_metadata_.UnpackTo(message);
  110. }
  111. static bool GetAnyFieldDescriptors(
  112. const ::PROTOBUF_NAMESPACE_ID::Message& message,
  113. const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** type_url_field,
  114. const ::PROTOBUF_NAMESPACE_ID::FieldDescriptor** value_field);
  115. template <typename T, class = typename std::enable_if<!std::is_convertible<T, const ::PROTOBUF_NAMESPACE_ID::Message&>::value>::type>
  116. bool PackFrom(const T& message) {
  117. return _impl_._any_metadata_.PackFrom<T>(GetArena(), message);
  118. }
  119. template <typename T, class = typename std::enable_if<!std::is_convertible<T, const ::PROTOBUF_NAMESPACE_ID::Message&>::value>::type>
  120. bool PackFrom(const T& message,
  121. ::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) {
  122. return _impl_._any_metadata_.PackFrom<T>(GetArena(), message, type_url_prefix);}
  123. template <typename T, class = typename std::enable_if<!std::is_convertible<T, const ::PROTOBUF_NAMESPACE_ID::Message&>::value>::type>
  124. bool UnpackTo(T* message) const {
  125. return _impl_._any_metadata_.UnpackTo<T>(message);
  126. }
  127. template<typename T> bool Is() const {
  128. return _impl_._any_metadata_.Is<T>();
  129. }
  130. static bool ParseAnyTypeUrl(::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url,
  131. std::string* full_type_name);
  132. friend void swap(Any& a, Any& b) {
  133. a.Swap(&b);
  134. }
  135. inline void Swap(Any* other) {
  136. if (other == this) return;
  137. #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
  138. if (GetOwningArena() != nullptr &&
  139. GetOwningArena() == other->GetOwningArena()) {
  140. #else // PROTOBUF_FORCE_COPY_IN_SWAP
  141. if (GetOwningArena() == other->GetOwningArena()) {
  142. #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
  143. InternalSwap(other);
  144. } else {
  145. ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
  146. }
  147. }
  148. void UnsafeArenaSwap(Any* other) {
  149. if (other == this) return;
  150. GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
  151. InternalSwap(other);
  152. }
  153. // implements Message ----------------------------------------------
  154. Any* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
  155. return CreateMaybeMessage<Any>(arena);
  156. }
  157. using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
  158. void CopyFrom(const Any& from);
  159. using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
  160. void MergeFrom( const Any& from) {
  161. Any::MergeImpl(*this, from);
  162. }
  163. private:
  164. static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
  165. public:
  166. PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
  167. bool IsInitialized() const final;
  168. size_t ByteSizeLong() const final;
  169. const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
  170. uint8_t* _InternalSerialize(
  171. uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
  172. int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
  173. private:
  174. void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
  175. void SharedDtor();
  176. void SetCachedSize(int size) const final;
  177. void InternalSwap(Any* other);
  178. private:
  179. friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
  180. static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
  181. return "google.protobuf.Any";
  182. }
  183. protected:
  184. explicit Any(::PROTOBUF_NAMESPACE_ID::Arena* arena,
  185. bool is_message_owned = false);
  186. public:
  187. static const ClassData _class_data_;
  188. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
  189. ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
  190. // nested types ----------------------------------------------------
  191. // accessors -------------------------------------------------------
  192. enum : int {
  193. kTypeUrlFieldNumber = 1,
  194. kValueFieldNumber = 2,
  195. };
  196. // string type_url = 1;
  197. void clear_type_url();
  198. const std::string& type_url() const;
  199. template <typename ArgT0 = const std::string&, typename... ArgT>
  200. void set_type_url(ArgT0&& arg0, ArgT... args);
  201. std::string* mutable_type_url();
  202. PROTOBUF_NODISCARD std::string* release_type_url();
  203. void set_allocated_type_url(std::string* type_url);
  204. private:
  205. const std::string& _internal_type_url() const;
  206. inline PROTOBUF_ALWAYS_INLINE void _internal_set_type_url(const std::string& value);
  207. std::string* _internal_mutable_type_url();
  208. public:
  209. // bytes value = 2;
  210. void clear_value();
  211. const std::string& value() const;
  212. template <typename ArgT0 = const std::string&, typename... ArgT>
  213. void set_value(ArgT0&& arg0, ArgT... args);
  214. std::string* mutable_value();
  215. PROTOBUF_NODISCARD std::string* release_value();
  216. void set_allocated_value(std::string* value);
  217. private:
  218. const std::string& _internal_value() const;
  219. inline PROTOBUF_ALWAYS_INLINE void _internal_set_value(const std::string& value);
  220. std::string* _internal_mutable_value();
  221. public:
  222. // @@protoc_insertion_point(class_scope:google.protobuf.Any)
  223. private:
  224. class _Internal;
  225. template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
  226. typedef void InternalArenaConstructable_;
  227. typedef void DestructorSkippable_;
  228. struct Impl_ {
  229. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_url_;
  230. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_;
  231. mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
  232. ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata _any_metadata_;
  233. };
  234. union { Impl_ _impl_; };
  235. friend struct ::TableStruct_google_2fprotobuf_2fany_2eproto;
  236. };
  237. // ===================================================================
  238. // ===================================================================
  239. #ifdef __GNUC__
  240. #pragma GCC diagnostic push
  241. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  242. #endif // __GNUC__
  243. // Any
  244. // string type_url = 1;
  245. inline void Any::clear_type_url() {
  246. _impl_.type_url_.ClearToEmpty();
  247. }
  248. inline const std::string& Any::type_url() const {
  249. // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)
  250. return _internal_type_url();
  251. }
  252. template <typename ArgT0, typename... ArgT>
  253. inline PROTOBUF_ALWAYS_INLINE
  254. void Any::set_type_url(ArgT0&& arg0, ArgT... args) {
  255. _impl_.type_url_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
  256. // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url)
  257. }
  258. inline std::string* Any::mutable_type_url() {
  259. std::string* _s = _internal_mutable_type_url();
  260. // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)
  261. return _s;
  262. }
  263. inline const std::string& Any::_internal_type_url() const {
  264. return _impl_.type_url_.Get();
  265. }
  266. inline void Any::_internal_set_type_url(const std::string& value) {
  267. _impl_.type_url_.Set(value, GetArenaForAllocation());
  268. }
  269. inline std::string* Any::_internal_mutable_type_url() {
  270. return _impl_.type_url_.Mutable(GetArenaForAllocation());
  271. }
  272. inline std::string* Any::release_type_url() {
  273. // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url)
  274. return _impl_.type_url_.Release();
  275. }
  276. inline void Any::set_allocated_type_url(std::string* type_url) {
  277. if (type_url != nullptr) {
  278. } else {
  279. }
  280. _impl_.type_url_.SetAllocated(type_url, GetArenaForAllocation());
  281. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  282. if (_impl_.type_url_.IsDefault()) {
  283. _impl_.type_url_.Set("", GetArenaForAllocation());
  284. }
  285. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  286. // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)
  287. }
  288. // bytes value = 2;
  289. inline void Any::clear_value() {
  290. _impl_.value_.ClearToEmpty();
  291. }
  292. inline const std::string& Any::value() const {
  293. // @@protoc_insertion_point(field_get:google.protobuf.Any.value)
  294. return _internal_value();
  295. }
  296. template <typename ArgT0, typename... ArgT>
  297. inline PROTOBUF_ALWAYS_INLINE
  298. void Any::set_value(ArgT0&& arg0, ArgT... args) {
  299. _impl_.value_.SetBytes(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
  300. // @@protoc_insertion_point(field_set:google.protobuf.Any.value)
  301. }
  302. inline std::string* Any::mutable_value() {
  303. std::string* _s = _internal_mutable_value();
  304. // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)
  305. return _s;
  306. }
  307. inline const std::string& Any::_internal_value() const {
  308. return _impl_.value_.Get();
  309. }
  310. inline void Any::_internal_set_value(const std::string& value) {
  311. _impl_.value_.Set(value, GetArenaForAllocation());
  312. }
  313. inline std::string* Any::_internal_mutable_value() {
  314. return _impl_.value_.Mutable(GetArenaForAllocation());
  315. }
  316. inline std::string* Any::release_value() {
  317. // @@protoc_insertion_point(field_release:google.protobuf.Any.value)
  318. return _impl_.value_.Release();
  319. }
  320. inline void Any::set_allocated_value(std::string* value) {
  321. if (value != nullptr) {
  322. } else {
  323. }
  324. _impl_.value_.SetAllocated(value, GetArenaForAllocation());
  325. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  326. if (_impl_.value_.IsDefault()) {
  327. _impl_.value_.Set("", GetArenaForAllocation());
  328. }
  329. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  330. // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)
  331. }
  332. #ifdef __GNUC__
  333. #pragma GCC diagnostic pop
  334. #endif // __GNUC__
  335. // @@protoc_insertion_point(namespace_scope)
  336. PROTOBUF_NAMESPACE_CLOSE
  337. // @@protoc_insertion_point(global_scope)
  338. #include <google/protobuf/port_undef.inc>
  339. #endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto