unittest_import.pb.cc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_import.proto
  3. #include <google/protobuf/unittest_import.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 ImportMessageDefaultTypeInternal {
  20. public:
  21. ::google::protobuf::internal::ExplicitlyConstructed<ImportMessage>
  22. _instance;
  23. } _ImportMessage_default_instance_;
  24. } // namespace protobuf_unittest_import
  25. namespace protobuf_google_2fprotobuf_2funittest_5fimport_2eproto {
  26. static void InitDefaultsImportMessage() {
  27. GOOGLE_PROTOBUF_VERIFY_VERSION;
  28. {
  29. void* ptr = &::protobuf_unittest_import::_ImportMessage_default_instance_;
  30. new (ptr) ::protobuf_unittest_import::ImportMessage();
  31. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  32. }
  33. ::protobuf_unittest_import::ImportMessage::InitAsDefaultInstance();
  34. }
  35. ::google::protobuf::internal::SCCInfo<0> scc_info_ImportMessage =
  36. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsImportMessage}, {}};
  37. void InitDefaults() {
  38. ::google::protobuf::internal::InitSCC(&scc_info_ImportMessage.base);
  39. }
  40. ::google::protobuf::Metadata file_level_metadata[1];
  41. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
  42. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  43. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::ImportMessage, _has_bits_),
  44. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::ImportMessage, _internal_metadata_),
  45. ~0u, // no _extensions_
  46. ~0u, // no _oneof_case_
  47. ~0u, // no _weak_field_map_
  48. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest_import::ImportMessage, d_),
  49. 0,
  50. };
  51. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  52. { 0, 6, sizeof(::protobuf_unittest_import::ImportMessage)},
  53. };
  54. static ::google::protobuf::Message const * const file_default_instances[] = {
  55. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest_import::_ImportMessage_default_instance_),
  56. };
  57. void protobuf_AssignDescriptors() {
  58. AddDescriptors();
  59. AssignDescriptors(
  60. "google/protobuf/unittest_import.proto", schemas, file_default_instances, TableStruct::offsets,
  61. file_level_metadata, file_level_enum_descriptors, NULL);
  62. }
  63. void protobuf_AssignDescriptorsOnce() {
  64. static ::google::protobuf::internal::once_flag once;
  65. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  66. }
  67. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  68. void protobuf_RegisterTypes(const ::std::string&) {
  69. protobuf_AssignDescriptorsOnce();
  70. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  71. }
  72. void AddDescriptorsImpl() {
  73. InitDefaults();
  74. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  75. "\n%google/protobuf/unittest_import.proto\022"
  76. "\030protobuf_unittest_import\032,google/protob"
  77. "uf/unittest_import_public.proto\"\032\n\rImpor"
  78. "tMessage\022\t\n\001d\030\001 \001(\005*<\n\nImportEnum\022\016\n\nIMP"
  79. "ORT_FOO\020\007\022\016\n\nIMPORT_BAR\020\010\022\016\n\nIMPORT_BAZ\020"
  80. "\t*1\n\020ImportEnumForMap\022\013\n\007UNKNOWN\020\000\022\007\n\003FO"
  81. "O\020\001\022\007\n\003BAR\020\002B\037\n\030com.google.protobuf.test"
  82. "H\001\370\001\001P\000"
  83. };
  84. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  85. descriptor, 287);
  86. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  87. "google/protobuf/unittest_import.proto", &protobuf_RegisterTypes);
  88. ::protobuf_google_2fprotobuf_2funittest_5fimport_5fpublic_2eproto::AddDescriptors();
  89. }
  90. void AddDescriptors() {
  91. static ::google::protobuf::internal::once_flag once;
  92. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  93. }
  94. // Force AddDescriptors() to be called at dynamic initialization time.
  95. struct StaticDescriptorInitializer {
  96. StaticDescriptorInitializer() {
  97. AddDescriptors();
  98. }
  99. } static_descriptor_initializer;
  100. } // namespace protobuf_google_2fprotobuf_2funittest_5fimport_2eproto
  101. namespace protobuf_unittest_import {
  102. const ::google::protobuf::EnumDescriptor* ImportEnum_descriptor() {
  103. protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  104. return protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::file_level_enum_descriptors[0];
  105. }
  106. bool ImportEnum_IsValid(int value) {
  107. switch (value) {
  108. case 7:
  109. case 8:
  110. case 9:
  111. return true;
  112. default:
  113. return false;
  114. }
  115. }
  116. const ::google::protobuf::EnumDescriptor* ImportEnumForMap_descriptor() {
  117. protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  118. return protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::file_level_enum_descriptors[1];
  119. }
  120. bool ImportEnumForMap_IsValid(int value) {
  121. switch (value) {
  122. case 0:
  123. case 1:
  124. case 2:
  125. return true;
  126. default:
  127. return false;
  128. }
  129. }
  130. // ===================================================================
  131. void ImportMessage::InitAsDefaultInstance() {
  132. }
  133. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  134. const int ImportMessage::kDFieldNumber;
  135. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  136. ImportMessage::ImportMessage()
  137. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  138. ::google::protobuf::internal::InitSCC(
  139. &protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::scc_info_ImportMessage.base);
  140. SharedCtor();
  141. // @@protoc_insertion_point(constructor:protobuf_unittest_import.ImportMessage)
  142. }
  143. ImportMessage::ImportMessage(::google::protobuf::Arena* arena)
  144. : ::google::protobuf::Message(),
  145. _internal_metadata_(arena) {
  146. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::scc_info_ImportMessage.base);
  147. SharedCtor();
  148. RegisterArenaDtor(arena);
  149. // @@protoc_insertion_point(arena_constructor:protobuf_unittest_import.ImportMessage)
  150. }
  151. ImportMessage::ImportMessage(const ImportMessage& from)
  152. : ::google::protobuf::Message(),
  153. _internal_metadata_(NULL),
  154. _has_bits_(from._has_bits_) {
  155. _internal_metadata_.MergeFrom(from._internal_metadata_);
  156. d_ = from.d_;
  157. // @@protoc_insertion_point(copy_constructor:protobuf_unittest_import.ImportMessage)
  158. }
  159. void ImportMessage::SharedCtor() {
  160. d_ = 0;
  161. }
  162. ImportMessage::~ImportMessage() {
  163. // @@protoc_insertion_point(destructor:protobuf_unittest_import.ImportMessage)
  164. SharedDtor();
  165. }
  166. void ImportMessage::SharedDtor() {
  167. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  168. }
  169. void ImportMessage::ArenaDtor(void* object) {
  170. ImportMessage* _this = reinterpret_cast< ImportMessage* >(object);
  171. (void)_this;
  172. }
  173. void ImportMessage::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  174. }
  175. void ImportMessage::SetCachedSize(int size) const {
  176. _cached_size_.Set(size);
  177. }
  178. const ::google::protobuf::Descriptor* ImportMessage::descriptor() {
  179. ::protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  180. return ::protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  181. }
  182. const ImportMessage& ImportMessage::default_instance() {
  183. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::scc_info_ImportMessage.base);
  184. return *internal_default_instance();
  185. }
  186. void ImportMessage::Clear() {
  187. // @@protoc_insertion_point(message_clear_start:protobuf_unittest_import.ImportMessage)
  188. ::google::protobuf::uint32 cached_has_bits = 0;
  189. // Prevent compiler warnings about cached_has_bits being unused
  190. (void) cached_has_bits;
  191. d_ = 0;
  192. _has_bits_.Clear();
  193. _internal_metadata_.Clear();
  194. }
  195. bool ImportMessage::MergePartialFromCodedStream(
  196. ::google::protobuf::io::CodedInputStream* input) {
  197. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  198. ::google::protobuf::uint32 tag;
  199. // @@protoc_insertion_point(parse_start:protobuf_unittest_import.ImportMessage)
  200. for (;;) {
  201. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  202. tag = p.first;
  203. if (!p.second) goto handle_unusual;
  204. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  205. // optional int32 d = 1;
  206. case 1: {
  207. if (static_cast< ::google::protobuf::uint8>(tag) ==
  208. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  209. set_has_d();
  210. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  211. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  212. input, &d_)));
  213. } else {
  214. goto handle_unusual;
  215. }
  216. break;
  217. }
  218. default: {
  219. handle_unusual:
  220. if (tag == 0) {
  221. goto success;
  222. }
  223. DO_(::google::protobuf::internal::WireFormat::SkipField(
  224. input, tag, _internal_metadata_.mutable_unknown_fields()));
  225. break;
  226. }
  227. }
  228. }
  229. success:
  230. // @@protoc_insertion_point(parse_success:protobuf_unittest_import.ImportMessage)
  231. return true;
  232. failure:
  233. // @@protoc_insertion_point(parse_failure:protobuf_unittest_import.ImportMessage)
  234. return false;
  235. #undef DO_
  236. }
  237. void ImportMessage::SerializeWithCachedSizes(
  238. ::google::protobuf::io::CodedOutputStream* output) const {
  239. // @@protoc_insertion_point(serialize_start:protobuf_unittest_import.ImportMessage)
  240. ::google::protobuf::uint32 cached_has_bits = 0;
  241. (void) cached_has_bits;
  242. cached_has_bits = _has_bits_[0];
  243. // optional int32 d = 1;
  244. if (cached_has_bits & 0x00000001u) {
  245. ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->d(), output);
  246. }
  247. if (_internal_metadata_.have_unknown_fields()) {
  248. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  249. _internal_metadata_.unknown_fields(), output);
  250. }
  251. // @@protoc_insertion_point(serialize_end:protobuf_unittest_import.ImportMessage)
  252. }
  253. ::google::protobuf::uint8* ImportMessage::InternalSerializeWithCachedSizesToArray(
  254. bool deterministic, ::google::protobuf::uint8* target) const {
  255. (void)deterministic; // Unused
  256. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest_import.ImportMessage)
  257. ::google::protobuf::uint32 cached_has_bits = 0;
  258. (void) cached_has_bits;
  259. cached_has_bits = _has_bits_[0];
  260. // optional int32 d = 1;
  261. if (cached_has_bits & 0x00000001u) {
  262. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->d(), target);
  263. }
  264. if (_internal_metadata_.have_unknown_fields()) {
  265. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  266. _internal_metadata_.unknown_fields(), target);
  267. }
  268. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest_import.ImportMessage)
  269. return target;
  270. }
  271. size_t ImportMessage::ByteSizeLong() const {
  272. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest_import.ImportMessage)
  273. size_t total_size = 0;
  274. if (_internal_metadata_.have_unknown_fields()) {
  275. total_size +=
  276. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  277. _internal_metadata_.unknown_fields());
  278. }
  279. // optional int32 d = 1;
  280. if (has_d()) {
  281. total_size += 1 +
  282. ::google::protobuf::internal::WireFormatLite::Int32Size(
  283. this->d());
  284. }
  285. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  286. SetCachedSize(cached_size);
  287. return total_size;
  288. }
  289. void ImportMessage::MergeFrom(const ::google::protobuf::Message& from) {
  290. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest_import.ImportMessage)
  291. GOOGLE_DCHECK_NE(&from, this);
  292. const ImportMessage* source =
  293. ::google::protobuf::internal::DynamicCastToGenerated<const ImportMessage>(
  294. &from);
  295. if (source == NULL) {
  296. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest_import.ImportMessage)
  297. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  298. } else {
  299. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest_import.ImportMessage)
  300. MergeFrom(*source);
  301. }
  302. }
  303. void ImportMessage::MergeFrom(const ImportMessage& from) {
  304. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest_import.ImportMessage)
  305. GOOGLE_DCHECK_NE(&from, this);
  306. _internal_metadata_.MergeFrom(from._internal_metadata_);
  307. ::google::protobuf::uint32 cached_has_bits = 0;
  308. (void) cached_has_bits;
  309. if (from.has_d()) {
  310. set_d(from.d());
  311. }
  312. }
  313. void ImportMessage::CopyFrom(const ::google::protobuf::Message& from) {
  314. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest_import.ImportMessage)
  315. if (&from == this) return;
  316. Clear();
  317. MergeFrom(from);
  318. }
  319. void ImportMessage::CopyFrom(const ImportMessage& from) {
  320. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest_import.ImportMessage)
  321. if (&from == this) return;
  322. Clear();
  323. MergeFrom(from);
  324. }
  325. bool ImportMessage::IsInitialized() const {
  326. return true;
  327. }
  328. void ImportMessage::Swap(ImportMessage* other) {
  329. if (other == this) return;
  330. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  331. InternalSwap(other);
  332. } else {
  333. ImportMessage* temp = New(GetArenaNoVirtual());
  334. temp->MergeFrom(*other);
  335. other->CopyFrom(*this);
  336. InternalSwap(temp);
  337. if (GetArenaNoVirtual() == NULL) {
  338. delete temp;
  339. }
  340. }
  341. }
  342. void ImportMessage::UnsafeArenaSwap(ImportMessage* other) {
  343. if (other == this) return;
  344. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  345. InternalSwap(other);
  346. }
  347. void ImportMessage::InternalSwap(ImportMessage* other) {
  348. using std::swap;
  349. swap(d_, other->d_);
  350. swap(_has_bits_[0], other->_has_bits_[0]);
  351. _internal_metadata_.Swap(&other->_internal_metadata_);
  352. }
  353. ::google::protobuf::Metadata ImportMessage::GetMetadata() const {
  354. protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::protobuf_AssignDescriptorsOnce();
  355. return ::protobuf_google_2fprotobuf_2funittest_5fimport_2eproto::file_level_metadata[kIndexInFileMessages];
  356. }
  357. // @@protoc_insertion_point(namespace_scope)
  358. } // namespace protobuf_unittest_import
  359. namespace google {
  360. namespace protobuf {
  361. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest_import::ImportMessage* Arena::CreateMaybeMessage< ::protobuf_unittest_import::ImportMessage >(Arena* arena) {
  362. return Arena::CreateMessageInternal< ::protobuf_unittest_import::ImportMessage >(arena);
  363. }
  364. } // namespace protobuf
  365. } // namespace google
  366. // @@protoc_insertion_point(global_scope)