unittest_import_public.pb.cc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_import_public.proto
  3. #include <google/protobuf/unittest_import_public.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 protobuf_unittest_import {
  19. class PublicImportMessageDefaultTypeInternal {
  20. public:
  21. ::google::protobuf::internal::ExplicitlyConstructed<PublicImportMessage>
  22. _instance;
  23. } _PublicImportMessage_default_instance_;
  24. } // namespace protobuf_unittest_import
  25. namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto {
  26. static void InitDefaultsPublicImportMessage() {
  27. GOOGLE_PROTOBUF_VERIFY_VERSION;
  28. {
  29. void* ptr = &::protobuf_unittest_import::_PublicImportMessage_default_instance_;
  30. new (ptr) ::protobuf_unittest_import::PublicImportMessage();
  31. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  32. }
  33. ::protobuf_unittest_import::PublicImportMessage::InitAsDefaultInstance();
  34. }
  35. ::google::protobuf::internal::SCCInfo<0> scc_info_PublicImportMessage =
  36. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPublicImportMessage}, {}};
  37. void InitDefaults() {
  38. ::google::protobuf::internal::InitSCC(&scc_info_PublicImportMessage.base);
  39. }
  40. ::google::protobuf::Metadata file_level_metadata[1];
  41. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  42. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::PublicImportMessage, _has_bits_),
  43. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::PublicImportMessage, _internal_metadata_),
  44. ~0u, // no _extensions_
  45. ~0u, // no _oneof_case_
  46. ~0u, // no _weak_field_map_
  47. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::PublicImportMessage, e_),
  48. 0,
  49. };
  50. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  51. { 0, 6, sizeof(::protobuf_unittest_import::PublicImportMessage)},
  52. };
  53. static ::google::protobuf::Message const * const file_default_instances[] = {
  54. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_import::_PublicImportMessage_default_instance_),
  55. };
  56. void protobuf_AssignDescriptors() {
  57. AddDescriptors();
  58. AssignDescriptors(
  59. "google/protobuf/unittest_import_public.proto", schemas, file_default_instances, TableStruct::offsets,
  60. file_level_metadata, NULL, NULL);
  61. }
  62. void protobuf_AssignDescriptorsOnce() {
  63. static ::google::protobuf::internal::once_flag once;
  64. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  65. }
  66. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  67. void protobuf_RegisterTypes(const ::std::string&) {
  68. protobuf_AssignDescriptorsOnce();
  69. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  70. }
  71. void AddDescriptorsImpl() {
  72. InitDefaults();
  73. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  74. "\n,google/protobuf/unittest_import_public"
  75. ".proto\022\030protobuf_unittest_import\" \n\023Publ"
  76. "icImportMessage\022\t\n\001e\030\001 \001(\005B\032\n\030com.google"
  77. ".protobuf.test"
  78. };
  79. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  80. descriptor, 134);
  81. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  82. "google/protobuf/unittest_import_public.proto", &protobuf_RegisterTypes);
  83. }
  84. void AddDescriptors() {
  85. static ::google::protobuf::internal::once_flag once;
  86. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  87. }
  88. // Force AddDescriptors() to be called at dynamic initialization time.
  89. struct StaticDescriptorInitializer {
  90. StaticDescriptorInitializer() {
  91. AddDescriptors();
  92. }
  93. } static_descriptor_initializer;
  94. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto
  95. namespace protobuf_unittest_import {
  96. // ===================================================================
  97. void PublicImportMessage::InitAsDefaultInstance() {
  98. }
  99. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  100. const int PublicImportMessage::kEFieldNumber;
  101. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  102. PublicImportMessage::PublicImportMessage()
  103. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  104. ::google::protobuf::internal::InitSCC(
  105. &protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::scc_info_PublicImportMessage.base);
  106. SharedCtor();
  107. // @@protoc_insertion_point(constructor:protobuf_unittest_import.PublicImportMessage)
  108. }
  109. PublicImportMessage::PublicImportMessage(const PublicImportMessage& from)
  110. : ::google::protobuf::Message(),
  111. _internal_metadata_(NULL),
  112. _has_bits_(from._has_bits_) {
  113. _internal_metadata_.MergeFrom(from._internal_metadata_);
  114. e_ = from.e_;
  115. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_import.PublicImportMessage)
  116. }
  117. void PublicImportMessage::SharedCtor() {
  118. e_ = 0;
  119. }
  120. PublicImportMessage::~PublicImportMessage() {
  121. // @@protoc_insertion_point(destructor:protobuf_unittest_import.PublicImportMessage)
  122. SharedDtor();
  123. }
  124. void PublicImportMessage::SharedDtor() {
  125. }
  126. void PublicImportMessage::SetCachedSize(int size) const {
  127. _cached_size_.Set(size);
  128. }
  129. const ::google::protobuf::Descriptor* PublicImportMessage::descriptor() {
  130. ::protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::protobuf_AssignDescriptorsOnce();
  131. return ::protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  132. }
  133. const PublicImportMessage& PublicImportMessage::default_instance() {
  134. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::scc_info_PublicImportMessage.base);
  135. return *internal_default_instance();
  136. }
  137. void PublicImportMessage::Clear() {
  138. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_import.PublicImportMessage)
  139. ::google::protobuf::uint32 cached_has_bits = 0;
  140. // Prevent compiler warnings about cached_has_bits being unused
  141. (void) cached_has_bits;
  142. e_ = 0;
  143. _has_bits_.Clear();
  144. _internal_metadata_.Clear();
  145. }
  146. bool PublicImportMessage::MergePartialFromCodedStream(
  147. ::google::protobuf::io::CodedInputStream* input) {
  148. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  149. ::google::protobuf::uint32 tag;
  150. // @@protoc_insertion_point(parse_start:protobuf_unittest_import.PublicImportMessage)
  151. for (;;) {
  152. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  153. tag = p.first;
  154. if (!p.second) goto handle_unusual;
  155. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  156. // optional int32 e = 1;
  157. case 1: {
  158. if (static_cast< ::google::protobuf::uint8>(tag) ==
  159. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  160. set_has_e();
  161. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  162. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  163. input, &e_)));
  164. } else {
  165. goto handle_unusual;
  166. }
  167. break;
  168. }
  169. default: {
  170. handle_unusual:
  171. if (tag == 0) {
  172. goto success;
  173. }
  174. DO_(::google::protobuf::internal::WireFormat::SkipField(
  175. input, tag, _internal_metadata_.mutable_unknown_fields()));
  176. break;
  177. }
  178. }
  179. }
  180. success:
  181. // @@protoc_insertion_point(parse_success:protobuf_unittest_import.PublicImportMessage)
  182. return true;
  183. failure:
  184. // @@protoc_insertion_point(parse_failure:protobuf_unittest_import.PublicImportMessage)
  185. return false;
  186. #undef DO_
  187. }
  188. void PublicImportMessage::SerializeWithCachedSizes(
  189. ::google::protobuf::io::CodedOutputStream* output) const {
  190. // @@protoc_insertion_point(serialize_start:protobuf_unittest_import.PublicImportMessage)
  191. ::google::protobuf::uint32 cached_has_bits = 0;
  192. (void) cached_has_bits;
  193. cached_has_bits = _has_bits_[0];
  194. // optional int32 e = 1;
  195. if (cached_has_bits & 0x00000001u) {
  196. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->e(), output);
  197. }
  198. if (_internal_metadata_.have_unknown_fields()) {
  199. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  200. _internal_metadata_.unknown_fields(), output);
  201. }
  202. // @@protoc_insertion_point(serialize_end:protobuf_unittest_import.PublicImportMessage)
  203. }
  204. ::google::protobuf::uint8* PublicImportMessage::InternalSerializeWithCachedSizesToArray(
  205. bool deterministic, ::google::protobuf::uint8* target) const {
  206. (void)deterministic; // Unused
  207. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_import.PublicImportMessage)
  208. ::google::protobuf::uint32 cached_has_bits = 0;
  209. (void) cached_has_bits;
  210. cached_has_bits = _has_bits_[0];
  211. // optional int32 e = 1;
  212. if (cached_has_bits & 0x00000001u) {
  213. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->e(), target);
  214. }
  215. if (_internal_metadata_.have_unknown_fields()) {
  216. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  217. _internal_metadata_.unknown_fields(), target);
  218. }
  219. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_import.PublicImportMessage)
  220. return target;
  221. }
  222. size_t PublicImportMessage::ByteSizeLong() const {
  223. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_import.PublicImportMessage)
  224. size_t total_size = 0;
  225. if (_internal_metadata_.have_unknown_fields()) {
  226. total_size +=
  227. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  228. _internal_metadata_.unknown_fields());
  229. }
  230. // optional int32 e = 1;
  231. if (has_e()) {
  232. total_size += 1 +
  233. ::google::protobuf::internal::WireFormatLite::Int32Size(
  234. this->e());
  235. }
  236. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  237. SetCachedSize(cached_size);
  238. return total_size;
  239. }
  240. void PublicImportMessage::MergeFrom(const ::google::protobuf::Message& from) {
  241. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_import.PublicImportMessage)
  242. GOOGLE_DCHECK_NE(&from, this);
  243. const PublicImportMessage* source =
  244. ::google::protobuf::internal::DynamicCastToGenerated<const PublicImportMessage>(
  245. &from);
  246. if (source == NULL) {
  247. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_import.PublicImportMessage)
  248. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  249. } else {
  250. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_import.PublicImportMessage)
  251. MergeFrom(*source);
  252. }
  253. }
  254. void PublicImportMessage::MergeFrom(const PublicImportMessage& from) {
  255. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_import.PublicImportMessage)
  256. GOOGLE_DCHECK_NE(&from, this);
  257. _internal_metadata_.MergeFrom(from._internal_metadata_);
  258. ::google::protobuf::uint32 cached_has_bits = 0;
  259. (void) cached_has_bits;
  260. if (from.has_e()) {
  261. set_e(from.e());
  262. }
  263. }
  264. void PublicImportMessage::CopyFrom(const ::google::protobuf::Message& from) {
  265. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_import.PublicImportMessage)
  266. if (&from == this) return;
  267. Clear();
  268. MergeFrom(from);
  269. }
  270. void PublicImportMessage::CopyFrom(const PublicImportMessage& from) {
  271. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_import.PublicImportMessage)
  272. if (&from == this) return;
  273. Clear();
  274. MergeFrom(from);
  275. }
  276. bool PublicImportMessage::IsInitialized() const {
  277. return true;
  278. }
  279. void PublicImportMessage::Swap(PublicImportMessage* other) {
  280. if (other == this) return;
  281. InternalSwap(other);
  282. }
  283. void PublicImportMessage::InternalSwap(PublicImportMessage* other) {
  284. using std::swap;
  285. swap(e_, other->e_);
  286. swap(_has_bits_[0], other->_has_bits_[0]);
  287. _internal_metadata_.Swap(&other->_internal_metadata_);
  288. }
  289. ::google::protobuf::Metadata PublicImportMessage::GetMetadata() const {
  290. protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::protobuf_AssignDescriptorsOnce();
  291. return ::protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::file_level_metadata[kIndexInFileMessages];
  292. }
  293. // @@protoc_insertion_point(namespace_scope)
  294. } // namespace protobuf_unittest_import
  295. namespace google {
  296. namespace protobuf {
  297. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_import::PublicImportMessage* Arena::CreateMaybeMessage< ::protobuf_unittest_import::PublicImportMessage >(Arena* arena) {
  298. return Arena::CreateInternal< ::protobuf_unittest_import::PublicImportMessage >(arena);
  299. }
  300. } // namespace protobuf
  301. } // namespace google
  302. // @@protoc_insertion_point(global_scope)