any.pb.cc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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/stubs/common.h>
  6. #include <google/protobuf/stubs/port.h>
  7. #include <google/protobuf/io/coded_stream.h>
  8. #include <google/protobuf/wire_format_lite_inl.h>
  9. #include <google/protobuf/descriptor.h>
  10. #include <google/protobuf/generated_message_reflection.h>
  11. #include <google/protobuf/reflection_ops.h>
  12. #include <google/protobuf/wire_format.h>
  13. // This is a temporary google only hack
  14. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  15. #include "third_party/protobuf/version.h"
  16. #endif
  17. // @@protoc_insertion_point(includes)
  18. namespace google {
  19. namespace protobuf {
  20. class AnyDefaultTypeInternal {
  21. public:
  22. ::google::protobuf::internal::ExplicitlyConstructed<Any>
  23. _instance;
  24. } _Any_default_instance_;
  25. } // namespace protobuf
  26. } // namespace google
  27. namespace protobuf_google_2fprotobuf_2fany_2eproto {
  28. static void InitDefaultsAny() {
  29. GOOGLE_PROTOBUF_VERIFY_VERSION;
  30. {
  31. void* ptr = &::google::protobuf::_Any_default_instance_;
  32. new (ptr) ::google::protobuf::Any();
  33. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  34. }
  35. ::google::protobuf::Any::InitAsDefaultInstance();
  36. }
  37. LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_Any =
  38. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAny}, {}};
  39. void InitDefaults() {
  40. ::google::protobuf::internal::InitSCC(&scc_info_Any.base);
  41. }
  42. ::google::protobuf::Metadata file_level_metadata[1];
  43. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  44. ~0u, // no _has_bits_
  45. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, _internal_metadata_),
  46. ~0u, // no _extensions_
  47. ~0u, // no _oneof_case_
  48. ~0u, // no _weak_field_map_
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, type_url_),
  50. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Any, value_),
  51. };
  52. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  53. { 0, -1, sizeof(::google::protobuf::Any)},
  54. };
  55. static ::google::protobuf::Message const * const file_default_instances[] = {
  56. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Any_default_instance_),
  57. };
  58. void protobuf_AssignDescriptors() {
  59. AddDescriptors();
  60. AssignDescriptors(
  61. "google/protobuf/any.proto", schemas, file_default_instances, TableStruct::offsets,
  62. file_level_metadata, NULL, NULL);
  63. }
  64. void protobuf_AssignDescriptorsOnce() {
  65. static ::google::protobuf::internal::once_flag once;
  66. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  67. }
  68. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  69. void protobuf_RegisterTypes(const ::std::string&) {
  70. protobuf_AssignDescriptorsOnce();
  71. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  72. }
  73. void AddDescriptorsImpl() {
  74. InitDefaults();
  75. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  76. "\n\031google/protobuf/any.proto\022\017google.prot"
  77. "obuf\"&\n\003Any\022\020\n\010type_url\030\001 \001(\t\022\r\n\005value\030\002"
  78. " \001(\014Bo\n\023com.google.protobufB\010AnyProtoP\001Z"
  79. "%github.com/golang/protobuf/ptypes/any\242\002"
  80. "\003GPB\252\002\036Google.Protobuf.WellKnownTypesb\006p"
  81. "roto3"
  82. };
  83. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  84. descriptor, 205);
  85. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  86. "google/protobuf/any.proto", &protobuf_RegisterTypes);
  87. }
  88. void AddDescriptors() {
  89. static ::google::protobuf::internal::once_flag once;
  90. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  91. }
  92. // Force AddDescriptors() to be called at dynamic initialization time.
  93. struct StaticDescriptorInitializer {
  94. StaticDescriptorInitializer() {
  95. AddDescriptors();
  96. }
  97. } static_descriptor_initializer;
  98. } // namespace protobuf_google_2fprotobuf_2fany_2eproto
  99. namespace google {
  100. namespace protobuf {
  101. // ===================================================================
  102. void Any::InitAsDefaultInstance() {
  103. }
  104. void Any::PackFrom(const ::google::protobuf::Message& message) {
  105. _any_metadata_.PackFrom(message);
  106. }
  107. void Any::PackFrom(const ::google::protobuf::Message& message,
  108. const ::std::string& type_url_prefix) {
  109. _any_metadata_.PackFrom(message, type_url_prefix);
  110. }
  111. bool Any::UnpackTo(::google::protobuf::Message* message) const {
  112. return _any_metadata_.UnpackTo(message);
  113. }
  114. bool Any::ParseAnyTypeUrl(const string& type_url,
  115. string* full_type_name) {
  116. return ::google::protobuf::internal::ParseAnyTypeUrl(type_url,
  117. full_type_name);
  118. }
  119. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  120. const int Any::kTypeUrlFieldNumber;
  121. const int Any::kValueFieldNumber;
  122. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  123. Any::Any()
  124. : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) {
  125. ::google::protobuf::internal::InitSCC(
  126. &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base);
  127. SharedCtor();
  128. // @@protoc_insertion_point(constructor:google.protobuf.Any)
  129. }
  130. Any::Any(const Any& from)
  131. : ::google::protobuf::Message(),
  132. _internal_metadata_(NULL),
  133. _any_metadata_(&type_url_, &value_) {
  134. _internal_metadata_.MergeFrom(from._internal_metadata_);
  135. type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  136. if (from.type_url().size() > 0) {
  137. type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
  138. }
  139. value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  140. if (from.value().size() > 0) {
  141. value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
  142. }
  143. // @@protoc_insertion_point(copy_constructor:google.protobuf.Any)
  144. }
  145. void Any::SharedCtor() {
  146. type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  147. value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  148. }
  149. Any::~Any() {
  150. // @@protoc_insertion_point(destructor:google.protobuf.Any)
  151. SharedDtor();
  152. }
  153. void Any::SharedDtor() {
  154. type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  155. value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  156. }
  157. void Any::SetCachedSize(int size) const {
  158. _cached_size_.Set(size);
  159. }
  160. const ::google::protobuf::Descriptor* Any::descriptor() {
  161. ::protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce();
  162. return ::protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  163. }
  164. const Any& Any::default_instance() {
  165. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base);
  166. return *internal_default_instance();
  167. }
  168. void Any::Clear() {
  169. // @@protoc_insertion_point(message_clear_start:google.protobuf.Any)
  170. ::google::protobuf::uint32 cached_has_bits = 0;
  171. // Prevent compiler warnings about cached_has_bits being unused
  172. (void) cached_has_bits;
  173. type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  174. value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  175. _internal_metadata_.Clear();
  176. }
  177. bool Any::MergePartialFromCodedStream(
  178. ::google::protobuf::io::CodedInputStream* input) {
  179. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  180. ::google::protobuf::uint32 tag;
  181. // @@protoc_insertion_point(parse_start:google.protobuf.Any)
  182. for (;;) {
  183. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  184. tag = p.first;
  185. if (!p.second) goto handle_unusual;
  186. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  187. // string type_url = 1;
  188. case 1: {
  189. if (static_cast< ::google::protobuf::uint8>(tag) ==
  190. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  191. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  192. input, this->mutable_type_url()));
  193. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  194. this->type_url().data(), static_cast<int>(this->type_url().length()),
  195. ::google::protobuf::internal::WireFormatLite::PARSE,
  196. "google.protobuf.Any.type_url"));
  197. } else {
  198. goto handle_unusual;
  199. }
  200. break;
  201. }
  202. // bytes value = 2;
  203. case 2: {
  204. if (static_cast< ::google::protobuf::uint8>(tag) ==
  205. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  206. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  207. input, this->mutable_value()));
  208. } else {
  209. goto handle_unusual;
  210. }
  211. break;
  212. }
  213. default: {
  214. handle_unusual:
  215. if (tag == 0) {
  216. goto success;
  217. }
  218. DO_(::google::protobuf::internal::WireFormat::SkipField(
  219. input, tag, _internal_metadata_.mutable_unknown_fields()));
  220. break;
  221. }
  222. }
  223. }
  224. success:
  225. // @@protoc_insertion_point(parse_success:google.protobuf.Any)
  226. return true;
  227. failure:
  228. // @@protoc_insertion_point(parse_failure:google.protobuf.Any)
  229. return false;
  230. #undef DO_
  231. }
  232. void Any::SerializeWithCachedSizes(
  233. ::google::protobuf::io::CodedOutputStream* output) const {
  234. // @@protoc_insertion_point(serialize_start:google.protobuf.Any)
  235. ::google::protobuf::uint32 cached_has_bits = 0;
  236. (void) cached_has_bits;
  237. // string type_url = 1;
  238. if (this->type_url().size() > 0) {
  239. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  240. this->type_url().data(), static_cast<int>(this->type_url().length()),
  241. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  242. "google.protobuf.Any.type_url");
  243. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  244. 1, this->type_url(), output);
  245. }
  246. // bytes value = 2;
  247. if (this->value().size() > 0) {
  248. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  249. 2, this->value(), output);
  250. }
  251. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  252. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  253. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  254. }
  255. // @@protoc_insertion_point(serialize_end:google.protobuf.Any)
  256. }
  257. ::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray(
  258. bool deterministic, ::google::protobuf::uint8* target) const {
  259. (void)deterministic; // Unused
  260. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
  261. ::google::protobuf::uint32 cached_has_bits = 0;
  262. (void) cached_has_bits;
  263. // string type_url = 1;
  264. if (this->type_url().size() > 0) {
  265. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  266. this->type_url().data(), static_cast<int>(this->type_url().length()),
  267. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  268. "google.protobuf.Any.type_url");
  269. target =
  270. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  271. 1, this->type_url(), target);
  272. }
  273. // bytes value = 2;
  274. if (this->value().size() > 0) {
  275. target =
  276. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  277. 2, this->value(), target);
  278. }
  279. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  280. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  281. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  282. }
  283. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Any)
  284. return target;
  285. }
  286. size_t Any::ByteSizeLong() const {
  287. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Any)
  288. size_t total_size = 0;
  289. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  290. total_size +=
  291. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  292. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  293. }
  294. // string type_url = 1;
  295. if (this->type_url().size() > 0) {
  296. total_size += 1 +
  297. ::google::protobuf::internal::WireFormatLite::StringSize(
  298. this->type_url());
  299. }
  300. // bytes value = 2;
  301. if (this->value().size() > 0) {
  302. total_size += 1 +
  303. ::google::protobuf::internal::WireFormatLite::BytesSize(
  304. this->value());
  305. }
  306. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  307. SetCachedSize(cached_size);
  308. return total_size;
  309. }
  310. void Any::MergeFrom(const ::google::protobuf::Message& from) {
  311. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Any)
  312. GOOGLE_DCHECK_NE(&from, this);
  313. const Any* source =
  314. ::google::protobuf::internal::DynamicCastToGenerated<const Any>(
  315. &from);
  316. if (source == NULL) {
  317. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any)
  318. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  319. } else {
  320. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Any)
  321. MergeFrom(*source);
  322. }
  323. }
  324. void Any::MergeFrom(const Any& from) {
  325. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Any)
  326. GOOGLE_DCHECK_NE(&from, this);
  327. _internal_metadata_.MergeFrom(from._internal_metadata_);
  328. ::google::protobuf::uint32 cached_has_bits = 0;
  329. (void) cached_has_bits;
  330. if (from.type_url().size() > 0) {
  331. type_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_url_);
  332. }
  333. if (from.value().size() > 0) {
  334. value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
  335. }
  336. }
  337. void Any::CopyFrom(const ::google::protobuf::Message& from) {
  338. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Any)
  339. if (&from == this) return;
  340. Clear();
  341. MergeFrom(from);
  342. }
  343. void Any::CopyFrom(const Any& from) {
  344. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Any)
  345. if (&from == this) return;
  346. Clear();
  347. MergeFrom(from);
  348. }
  349. bool Any::IsInitialized() const {
  350. return true;
  351. }
  352. void Any::Swap(Any* other) {
  353. if (other == this) return;
  354. InternalSwap(other);
  355. }
  356. void Any::InternalSwap(Any* other) {
  357. using std::swap;
  358. type_url_.Swap(&other->type_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  359. GetArenaNoVirtual());
  360. value_.Swap(&other->value_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  361. GetArenaNoVirtual());
  362. _internal_metadata_.Swap(&other->_internal_metadata_);
  363. }
  364. ::google::protobuf::Metadata Any::GetMetadata() const {
  365. protobuf_google_2fprotobuf_2fany_2eproto::protobuf_AssignDescriptorsOnce();
  366. return ::protobuf_google_2fprotobuf_2fany_2eproto::file_level_metadata[kIndexInFileMessages];
  367. }
  368. // @@protoc_insertion_point(namespace_scope)
  369. } // namespace protobuf
  370. } // namespace google
  371. namespace google {
  372. namespace protobuf {
  373. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Any* Arena::CreateMaybeMessage< ::google::protobuf::Any >(Arena* arena) {
  374. return Arena::CreateInternal< ::google::protobuf::Any >(arena);
  375. }
  376. } // namespace protobuf
  377. } // namespace google
  378. // @@protoc_insertion_point(global_scope)