unittest_mset.pb.cc 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_mset.proto
  3. #include <google/protobuf/unittest_mset.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_google_2fprotobuf_2funittest_5fmset_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RawMessageSet_Item;
  20. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension1;
  21. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension2;
  22. } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto
  23. namespace protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto {
  24. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSet;
  25. } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto
  26. namespace protobuf_unittest {
  27. class TestMessageSetContainerDefaultTypeInternal {
  28. public:
  29. ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetContainer>
  30. _instance;
  31. } _TestMessageSetContainer_default_instance_;
  32. class TestMessageSetExtension1DefaultTypeInternal {
  33. public:
  34. ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetExtension1>
  35. _instance;
  36. } _TestMessageSetExtension1_default_instance_;
  37. class TestMessageSetExtension2DefaultTypeInternal {
  38. public:
  39. ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetExtension2>
  40. _instance;
  41. } _TestMessageSetExtension2_default_instance_;
  42. class RawMessageSet_ItemDefaultTypeInternal {
  43. public:
  44. ::google::protobuf::internal::ExplicitlyConstructed<RawMessageSet_Item>
  45. _instance;
  46. } _RawMessageSet_Item_default_instance_;
  47. class RawMessageSetDefaultTypeInternal {
  48. public:
  49. ::google::protobuf::internal::ExplicitlyConstructed<RawMessageSet>
  50. _instance;
  51. } _RawMessageSet_default_instance_;
  52. } // namespace protobuf_unittest
  53. namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto {
  54. static void InitDefaultsTestMessageSetContainer() {
  55. GOOGLE_PROTOBUF_VERIFY_VERSION;
  56. {
  57. void* ptr = &::protobuf_unittest::_TestMessageSetContainer_default_instance_;
  58. new (ptr) ::protobuf_unittest::TestMessageSetContainer();
  59. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  60. }
  61. ::protobuf_unittest::TestMessageSetContainer::InitAsDefaultInstance();
  62. }
  63. ::google::protobuf::internal::SCCInfo<1> scc_info_TestMessageSetContainer =
  64. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTestMessageSetContainer}, {
  65. &protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto::scc_info_TestMessageSet.base,}};
  66. static void InitDefaultsTestMessageSetExtension1() {
  67. GOOGLE_PROTOBUF_VERIFY_VERSION;
  68. {
  69. void* ptr = &::protobuf_unittest::_TestMessageSetExtension1_default_instance_;
  70. new (ptr) ::protobuf_unittest::TestMessageSetExtension1();
  71. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  72. }
  73. ::protobuf_unittest::TestMessageSetExtension1::InitAsDefaultInstance();
  74. }
  75. ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension1 =
  76. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestMessageSetExtension1}, {}};
  77. static void InitDefaultsTestMessageSetExtension2() {
  78. GOOGLE_PROTOBUF_VERIFY_VERSION;
  79. {
  80. void* ptr = &::protobuf_unittest::_TestMessageSetExtension2_default_instance_;
  81. new (ptr) ::protobuf_unittest::TestMessageSetExtension2();
  82. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  83. }
  84. ::protobuf_unittest::TestMessageSetExtension2::InitAsDefaultInstance();
  85. }
  86. ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension2 =
  87. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestMessageSetExtension2}, {}};
  88. static void InitDefaultsRawMessageSet_Item() {
  89. GOOGLE_PROTOBUF_VERIFY_VERSION;
  90. {
  91. void* ptr = &::protobuf_unittest::_RawMessageSet_Item_default_instance_;
  92. new (ptr) ::protobuf_unittest::RawMessageSet_Item();
  93. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  94. }
  95. ::protobuf_unittest::RawMessageSet_Item::InitAsDefaultInstance();
  96. }
  97. ::google::protobuf::internal::SCCInfo<0> scc_info_RawMessageSet_Item =
  98. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRawMessageSet_Item}, {}};
  99. static void InitDefaultsRawMessageSet() {
  100. GOOGLE_PROTOBUF_VERIFY_VERSION;
  101. {
  102. void* ptr = &::protobuf_unittest::_RawMessageSet_default_instance_;
  103. new (ptr) ::protobuf_unittest::RawMessageSet();
  104. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  105. }
  106. ::protobuf_unittest::RawMessageSet::InitAsDefaultInstance();
  107. }
  108. ::google::protobuf::internal::SCCInfo<1> scc_info_RawMessageSet =
  109. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsRawMessageSet}, {
  110. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base,}};
  111. void InitDefaults() {
  112. ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetContainer.base);
  113. ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetExtension1.base);
  114. ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetExtension2.base);
  115. ::google::protobuf::internal::InitSCC(&scc_info_RawMessageSet_Item.base);
  116. ::google::protobuf::internal::InitSCC(&scc_info_RawMessageSet.base);
  117. }
  118. ::google::protobuf::Metadata file_level_metadata[5];
  119. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  120. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, _has_bits_),
  121. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, _internal_metadata_),
  122. ~0u, // no _extensions_
  123. ~0u, // no _oneof_case_
  124. ~0u, // no _weak_field_map_
  125. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, message_set_),
  126. 0,
  127. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, _has_bits_),
  128. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, _internal_metadata_),
  129. ~0u, // no _extensions_
  130. ~0u, // no _oneof_case_
  131. ~0u, // no _weak_field_map_
  132. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, i_),
  133. 0,
  134. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, _has_bits_),
  135. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, _internal_metadata_),
  136. ~0u, // no _extensions_
  137. ~0u, // no _oneof_case_
  138. ~0u, // no _weak_field_map_
  139. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, str_),
  140. 0,
  141. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, _has_bits_),
  142. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, _internal_metadata_),
  143. ~0u, // no _extensions_
  144. ~0u, // no _oneof_case_
  145. ~0u, // no _weak_field_map_
  146. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, type_id_),
  147. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, message_),
  148. 1,
  149. 0,
  150. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, _has_bits_),
  151. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, _internal_metadata_),
  152. ~0u, // no _extensions_
  153. ~0u, // no _oneof_case_
  154. ~0u, // no _weak_field_map_
  155. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, item_),
  156. ~0u,
  157. };
  158. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  159. { 0, 6, sizeof(::protobuf_unittest::TestMessageSetContainer)},
  160. { 7, 13, sizeof(::protobuf_unittest::TestMessageSetExtension1)},
  161. { 14, 20, sizeof(::protobuf_unittest::TestMessageSetExtension2)},
  162. { 21, 28, sizeof(::protobuf_unittest::RawMessageSet_Item)},
  163. { 30, 36, sizeof(::protobuf_unittest::RawMessageSet)},
  164. };
  165. static ::google::protobuf::Message const * const file_default_instances[] = {
  166. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetContainer_default_instance_),
  167. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetExtension1_default_instance_),
  168. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetExtension2_default_instance_),
  169. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_RawMessageSet_Item_default_instance_),
  170. reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_RawMessageSet_default_instance_),
  171. };
  172. void protobuf_AssignDescriptors() {
  173. AddDescriptors();
  174. AssignDescriptors(
  175. "google/protobuf/unittest_mset.proto", schemas, file_default_instances, TableStruct::offsets,
  176. file_level_metadata, NULL, NULL);
  177. }
  178. void protobuf_AssignDescriptorsOnce() {
  179. static ::google::protobuf::internal::once_flag once;
  180. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  181. }
  182. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  183. void protobuf_RegisterTypes(const ::std::string&) {
  184. protobuf_AssignDescriptorsOnce();
  185. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5);
  186. }
  187. void AddDescriptorsImpl() {
  188. InitDefaults();
  189. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  190. "\n#google/protobuf/unittest_mset.proto\022\021p"
  191. "rotobuf_unittest\032/google/protobuf/unitte"
  192. "st_mset_wire_format.proto\"Z\n\027TestMessage"
  193. "SetContainer\022\?\n\013message_set\030\001 \001(\0132*.prot"
  194. "o2_wireformat_unittest.TestMessageSet\"\237\001"
  195. "\n\030TestMessageSetExtension1\022\t\n\001i\030\017 \001(\0052x\n"
  196. "\025message_set_extension\022*.proto2_wireform"
  197. "at_unittest.TestMessageSet\030\260\246^ \001(\0132+.pro"
  198. "tobuf_unittest.TestMessageSetExtension1\""
  199. "\241\001\n\030TestMessageSetExtension2\022\013\n\003str\030\031 \001("
  200. "\t2x\n\025message_set_extension\022*.proto2_wire"
  201. "format_unittest.TestMessageSet\030\371\273^ \001(\0132+"
  202. ".protobuf_unittest.TestMessageSetExtensi"
  203. "on2\"n\n\rRawMessageSet\0223\n\004item\030\001 \003(\n2%.pro"
  204. "tobuf_unittest.RawMessageSet.Item\032(\n\004Ite"
  205. "m\022\017\n\007type_id\030\002 \002(\005\022\017\n\007message\030\003 \002(\014B\005H\001\370"
  206. "\001\001"
  207. };
  208. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  209. descriptor, 642);
  210. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  211. "google/protobuf/unittest_mset.proto", &protobuf_RegisterTypes);
  212. ::protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto::AddDescriptors();
  213. }
  214. void AddDescriptors() {
  215. static ::google::protobuf::internal::once_flag once;
  216. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  217. }
  218. // Force AddDescriptors() to be called at dynamic initialization time.
  219. struct StaticDescriptorInitializer {
  220. StaticDescriptorInitializer() {
  221. AddDescriptors();
  222. }
  223. } static_descriptor_initializer;
  224. } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto
  225. namespace protobuf_unittest {
  226. // ===================================================================
  227. void TestMessageSetContainer::InitAsDefaultInstance() {
  228. ::protobuf_unittest::_TestMessageSetContainer_default_instance_._instance.get_mutable()->message_set_ = const_cast< ::proto2_wireformat_unittest::TestMessageSet*>(
  229. ::proto2_wireformat_unittest::TestMessageSet::internal_default_instance());
  230. }
  231. void TestMessageSetContainer::unsafe_arena_set_allocated_message_set(
  232. ::proto2_wireformat_unittest::TestMessageSet* message_set) {
  233. if (GetArenaNoVirtual() == NULL) {
  234. delete message_set_;
  235. }
  236. message_set_ = message_set;
  237. if (message_set) {
  238. set_has_message_set();
  239. } else {
  240. clear_has_message_set();
  241. }
  242. // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestMessageSetContainer.message_set)
  243. }
  244. void TestMessageSetContainer::clear_message_set() {
  245. if (message_set_ != NULL) message_set_->Clear();
  246. clear_has_message_set();
  247. }
  248. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  249. const int TestMessageSetContainer::kMessageSetFieldNumber;
  250. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  251. TestMessageSetContainer::TestMessageSetContainer()
  252. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  253. ::google::protobuf::internal::InitSCC(
  254. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
  255. SharedCtor();
  256. // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetContainer)
  257. }
  258. TestMessageSetContainer::TestMessageSetContainer(::google::protobuf::Arena* arena)
  259. : ::google::protobuf::Message(),
  260. _internal_metadata_(arena) {
  261. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
  262. SharedCtor();
  263. RegisterArenaDtor(arena);
  264. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetContainer)
  265. }
  266. TestMessageSetContainer::TestMessageSetContainer(const TestMessageSetContainer& from)
  267. : ::google::protobuf::Message(),
  268. _internal_metadata_(NULL),
  269. _has_bits_(from._has_bits_) {
  270. _internal_metadata_.MergeFrom(from._internal_metadata_);
  271. if (from.has_message_set()) {
  272. message_set_ = new ::proto2_wireformat_unittest::TestMessageSet(*from.message_set_);
  273. } else {
  274. message_set_ = NULL;
  275. }
  276. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetContainer)
  277. }
  278. void TestMessageSetContainer::SharedCtor() {
  279. message_set_ = NULL;
  280. }
  281. TestMessageSetContainer::~TestMessageSetContainer() {
  282. // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetContainer)
  283. SharedDtor();
  284. }
  285. void TestMessageSetContainer::SharedDtor() {
  286. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  287. if (this != internal_default_instance()) delete message_set_;
  288. }
  289. void TestMessageSetContainer::ArenaDtor(void* object) {
  290. TestMessageSetContainer* _this = reinterpret_cast< TestMessageSetContainer* >(object);
  291. (void)_this;
  292. }
  293. void TestMessageSetContainer::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  294. }
  295. void TestMessageSetContainer::SetCachedSize(int size) const {
  296. _cached_size_.Set(size);
  297. }
  298. const ::google::protobuf::Descriptor* TestMessageSetContainer::descriptor() {
  299. ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  300. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  301. }
  302. const TestMessageSetContainer& TestMessageSetContainer::default_instance() {
  303. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
  304. return *internal_default_instance();
  305. }
  306. void TestMessageSetContainer::Clear() {
  307. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetContainer)
  308. ::google::protobuf::uint32 cached_has_bits = 0;
  309. // Prevent compiler warnings about cached_has_bits being unused
  310. (void) cached_has_bits;
  311. cached_has_bits = _has_bits_[0];
  312. if (cached_has_bits & 0x00000001u) {
  313. GOOGLE_DCHECK(message_set_ != NULL);
  314. message_set_->Clear();
  315. }
  316. _has_bits_.Clear();
  317. _internal_metadata_.Clear();
  318. }
  319. bool TestMessageSetContainer::MergePartialFromCodedStream(
  320. ::google::protobuf::io::CodedInputStream* input) {
  321. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  322. ::google::protobuf::uint32 tag;
  323. // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetContainer)
  324. for (;;) {
  325. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  326. tag = p.first;
  327. if (!p.second) goto handle_unusual;
  328. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  329. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  330. case 1: {
  331. if (static_cast< ::google::protobuf::uint8>(tag) ==
  332. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  333. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  334. input, mutable_message_set()));
  335. } else {
  336. goto handle_unusual;
  337. }
  338. break;
  339. }
  340. default: {
  341. handle_unusual:
  342. if (tag == 0) {
  343. goto success;
  344. }
  345. DO_(::google::protobuf::internal::WireFormat::SkipField(
  346. input, tag, _internal_metadata_.mutable_unknown_fields()));
  347. break;
  348. }
  349. }
  350. }
  351. success:
  352. // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetContainer)
  353. return true;
  354. failure:
  355. // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetContainer)
  356. return false;
  357. #undef DO_
  358. }
  359. void TestMessageSetContainer::SerializeWithCachedSizes(
  360. ::google::protobuf::io::CodedOutputStream* output) const {
  361. // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetContainer)
  362. ::google::protobuf::uint32 cached_has_bits = 0;
  363. (void) cached_has_bits;
  364. cached_has_bits = _has_bits_[0];
  365. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  366. if (cached_has_bits & 0x00000001u) {
  367. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  368. 1, this->_internal_message_set(), output);
  369. }
  370. if (_internal_metadata_.have_unknown_fields()) {
  371. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  372. _internal_metadata_.unknown_fields(), output);
  373. }
  374. // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetContainer)
  375. }
  376. ::google::protobuf::uint8* TestMessageSetContainer::InternalSerializeWithCachedSizesToArray(
  377. bool deterministic, ::google::protobuf::uint8* target) const {
  378. (void)deterministic; // Unused
  379. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetContainer)
  380. ::google::protobuf::uint32 cached_has_bits = 0;
  381. (void) cached_has_bits;
  382. cached_has_bits = _has_bits_[0];
  383. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  384. if (cached_has_bits & 0x00000001u) {
  385. target = ::google::protobuf::internal::WireFormatLite::
  386. InternalWriteMessageToArray(
  387. 1, this->_internal_message_set(), deterministic, target);
  388. }
  389. if (_internal_metadata_.have_unknown_fields()) {
  390. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  391. _internal_metadata_.unknown_fields(), target);
  392. }
  393. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetContainer)
  394. return target;
  395. }
  396. size_t TestMessageSetContainer::ByteSizeLong() const {
  397. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetContainer)
  398. size_t total_size = 0;
  399. if (_internal_metadata_.have_unknown_fields()) {
  400. total_size +=
  401. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  402. _internal_metadata_.unknown_fields());
  403. }
  404. // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
  405. if (has_message_set()) {
  406. total_size += 1 +
  407. ::google::protobuf::internal::WireFormatLite::MessageSize(
  408. *message_set_);
  409. }
  410. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  411. SetCachedSize(cached_size);
  412. return total_size;
  413. }
  414. void TestMessageSetContainer::MergeFrom(const ::google::protobuf::Message& from) {
  415. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetContainer)
  416. GOOGLE_DCHECK_NE(&from, this);
  417. const TestMessageSetContainer* source =
  418. ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetContainer>(
  419. &from);
  420. if (source == NULL) {
  421. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetContainer)
  422. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  423. } else {
  424. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetContainer)
  425. MergeFrom(*source);
  426. }
  427. }
  428. void TestMessageSetContainer::MergeFrom(const TestMessageSetContainer& from) {
  429. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetContainer)
  430. GOOGLE_DCHECK_NE(&from, this);
  431. _internal_metadata_.MergeFrom(from._internal_metadata_);
  432. ::google::protobuf::uint32 cached_has_bits = 0;
  433. (void) cached_has_bits;
  434. if (from.has_message_set()) {
  435. mutable_message_set()->::proto2_wireformat_unittest::TestMessageSet::MergeFrom(from.message_set());
  436. }
  437. }
  438. void TestMessageSetContainer::CopyFrom(const ::google::protobuf::Message& from) {
  439. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetContainer)
  440. if (&from == this) return;
  441. Clear();
  442. MergeFrom(from);
  443. }
  444. void TestMessageSetContainer::CopyFrom(const TestMessageSetContainer& from) {
  445. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetContainer)
  446. if (&from == this) return;
  447. Clear();
  448. MergeFrom(from);
  449. }
  450. bool TestMessageSetContainer::IsInitialized() const {
  451. if (has_message_set()) {
  452. if (!this->message_set_->IsInitialized()) return false;
  453. }
  454. return true;
  455. }
  456. void TestMessageSetContainer::Swap(TestMessageSetContainer* other) {
  457. if (other == this) return;
  458. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  459. InternalSwap(other);
  460. } else {
  461. TestMessageSetContainer* temp = New(GetArenaNoVirtual());
  462. temp->MergeFrom(*other);
  463. other->CopyFrom(*this);
  464. InternalSwap(temp);
  465. if (GetArenaNoVirtual() == NULL) {
  466. delete temp;
  467. }
  468. }
  469. }
  470. void TestMessageSetContainer::UnsafeArenaSwap(TestMessageSetContainer* other) {
  471. if (other == this) return;
  472. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  473. InternalSwap(other);
  474. }
  475. void TestMessageSetContainer::InternalSwap(TestMessageSetContainer* other) {
  476. using std::swap;
  477. swap(message_set_, other->message_set_);
  478. swap(_has_bits_[0], other->_has_bits_[0]);
  479. _internal_metadata_.Swap(&other->_internal_metadata_);
  480. }
  481. ::google::protobuf::Metadata TestMessageSetContainer::GetMetadata() const {
  482. protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  483. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
  484. }
  485. // ===================================================================
  486. void TestMessageSetExtension1::InitAsDefaultInstance() {
  487. }
  488. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  489. const int TestMessageSetExtension1::kIFieldNumber;
  490. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  491. TestMessageSetExtension1::TestMessageSetExtension1()
  492. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  493. ::google::protobuf::internal::InitSCC(
  494. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
  495. SharedCtor();
  496. // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetExtension1)
  497. }
  498. TestMessageSetExtension1::TestMessageSetExtension1(::google::protobuf::Arena* arena)
  499. : ::google::protobuf::Message(),
  500. _internal_metadata_(arena) {
  501. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
  502. SharedCtor();
  503. RegisterArenaDtor(arena);
  504. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetExtension1)
  505. }
  506. TestMessageSetExtension1::TestMessageSetExtension1(const TestMessageSetExtension1& from)
  507. : ::google::protobuf::Message(),
  508. _internal_metadata_(NULL),
  509. _has_bits_(from._has_bits_) {
  510. _internal_metadata_.MergeFrom(from._internal_metadata_);
  511. i_ = from.i_;
  512. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetExtension1)
  513. }
  514. void TestMessageSetExtension1::SharedCtor() {
  515. i_ = 0;
  516. }
  517. TestMessageSetExtension1::~TestMessageSetExtension1() {
  518. // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetExtension1)
  519. SharedDtor();
  520. }
  521. void TestMessageSetExtension1::SharedDtor() {
  522. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  523. }
  524. void TestMessageSetExtension1::ArenaDtor(void* object) {
  525. TestMessageSetExtension1* _this = reinterpret_cast< TestMessageSetExtension1* >(object);
  526. (void)_this;
  527. }
  528. void TestMessageSetExtension1::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  529. }
  530. void TestMessageSetExtension1::SetCachedSize(int size) const {
  531. _cached_size_.Set(size);
  532. }
  533. const ::google::protobuf::Descriptor* TestMessageSetExtension1::descriptor() {
  534. ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  535. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  536. }
  537. const TestMessageSetExtension1& TestMessageSetExtension1::default_instance() {
  538. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
  539. return *internal_default_instance();
  540. }
  541. void TestMessageSetExtension1::Clear() {
  542. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetExtension1)
  543. ::google::protobuf::uint32 cached_has_bits = 0;
  544. // Prevent compiler warnings about cached_has_bits being unused
  545. (void) cached_has_bits;
  546. i_ = 0;
  547. _has_bits_.Clear();
  548. _internal_metadata_.Clear();
  549. }
  550. bool TestMessageSetExtension1::MergePartialFromCodedStream(
  551. ::google::protobuf::io::CodedInputStream* input) {
  552. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  553. ::google::protobuf::uint32 tag;
  554. // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetExtension1)
  555. for (;;) {
  556. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  557. tag = p.first;
  558. if (!p.second) goto handle_unusual;
  559. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  560. // optional int32 i = 15;
  561. case 15: {
  562. if (static_cast< ::google::protobuf::uint8>(tag) ==
  563. static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) {
  564. set_has_i();
  565. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  566. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  567. input, &i_)));
  568. } else {
  569. goto handle_unusual;
  570. }
  571. break;
  572. }
  573. default: {
  574. handle_unusual:
  575. if (tag == 0) {
  576. goto success;
  577. }
  578. DO_(::google::protobuf::internal::WireFormat::SkipField(
  579. input, tag, _internal_metadata_.mutable_unknown_fields()));
  580. break;
  581. }
  582. }
  583. }
  584. success:
  585. // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetExtension1)
  586. return true;
  587. failure:
  588. // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetExtension1)
  589. return false;
  590. #undef DO_
  591. }
  592. void TestMessageSetExtension1::SerializeWithCachedSizes(
  593. ::google::protobuf::io::CodedOutputStream* output) const {
  594. // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetExtension1)
  595. ::google::protobuf::uint32 cached_has_bits = 0;
  596. (void) cached_has_bits;
  597. cached_has_bits = _has_bits_[0];
  598. // optional int32 i = 15;
  599. if (cached_has_bits & 0x00000001u) {
  600. ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->i(), output);
  601. }
  602. if (_internal_metadata_.have_unknown_fields()) {
  603. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  604. _internal_metadata_.unknown_fields(), output);
  605. }
  606. // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetExtension1)
  607. }
  608. ::google::protobuf::uint8* TestMessageSetExtension1::InternalSerializeWithCachedSizesToArray(
  609. bool deterministic, ::google::protobuf::uint8* target) const {
  610. (void)deterministic; // Unused
  611. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetExtension1)
  612. ::google::protobuf::uint32 cached_has_bits = 0;
  613. (void) cached_has_bits;
  614. cached_has_bits = _has_bits_[0];
  615. // optional int32 i = 15;
  616. if (cached_has_bits & 0x00000001u) {
  617. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->i(), target);
  618. }
  619. if (_internal_metadata_.have_unknown_fields()) {
  620. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  621. _internal_metadata_.unknown_fields(), target);
  622. }
  623. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetExtension1)
  624. return target;
  625. }
  626. size_t TestMessageSetExtension1::ByteSizeLong() const {
  627. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetExtension1)
  628. size_t total_size = 0;
  629. if (_internal_metadata_.have_unknown_fields()) {
  630. total_size +=
  631. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  632. _internal_metadata_.unknown_fields());
  633. }
  634. // optional int32 i = 15;
  635. if (has_i()) {
  636. total_size += 1 +
  637. ::google::protobuf::internal::WireFormatLite::Int32Size(
  638. this->i());
  639. }
  640. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  641. SetCachedSize(cached_size);
  642. return total_size;
  643. }
  644. void TestMessageSetExtension1::MergeFrom(const ::google::protobuf::Message& from) {
  645. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetExtension1)
  646. GOOGLE_DCHECK_NE(&from, this);
  647. const TestMessageSetExtension1* source =
  648. ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetExtension1>(
  649. &from);
  650. if (source == NULL) {
  651. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetExtension1)
  652. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  653. } else {
  654. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetExtension1)
  655. MergeFrom(*source);
  656. }
  657. }
  658. void TestMessageSetExtension1::MergeFrom(const TestMessageSetExtension1& from) {
  659. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetExtension1)
  660. GOOGLE_DCHECK_NE(&from, this);
  661. _internal_metadata_.MergeFrom(from._internal_metadata_);
  662. ::google::protobuf::uint32 cached_has_bits = 0;
  663. (void) cached_has_bits;
  664. if (from.has_i()) {
  665. set_i(from.i());
  666. }
  667. }
  668. void TestMessageSetExtension1::CopyFrom(const ::google::protobuf::Message& from) {
  669. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetExtension1)
  670. if (&from == this) return;
  671. Clear();
  672. MergeFrom(from);
  673. }
  674. void TestMessageSetExtension1::CopyFrom(const TestMessageSetExtension1& from) {
  675. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetExtension1)
  676. if (&from == this) return;
  677. Clear();
  678. MergeFrom(from);
  679. }
  680. bool TestMessageSetExtension1::IsInitialized() const {
  681. return true;
  682. }
  683. void TestMessageSetExtension1::Swap(TestMessageSetExtension1* other) {
  684. if (other == this) return;
  685. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  686. InternalSwap(other);
  687. } else {
  688. TestMessageSetExtension1* temp = New(GetArenaNoVirtual());
  689. temp->MergeFrom(*other);
  690. other->CopyFrom(*this);
  691. InternalSwap(temp);
  692. if (GetArenaNoVirtual() == NULL) {
  693. delete temp;
  694. }
  695. }
  696. }
  697. void TestMessageSetExtension1::UnsafeArenaSwap(TestMessageSetExtension1* other) {
  698. if (other == this) return;
  699. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  700. InternalSwap(other);
  701. }
  702. void TestMessageSetExtension1::InternalSwap(TestMessageSetExtension1* other) {
  703. using std::swap;
  704. swap(i_, other->i_);
  705. swap(_has_bits_[0], other->_has_bits_[0]);
  706. _internal_metadata_.Swap(&other->_internal_metadata_);
  707. }
  708. ::google::protobuf::Metadata TestMessageSetExtension1::GetMetadata() const {
  709. protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  710. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
  711. }
  712. // ===================================================================
  713. void TestMessageSetExtension2::InitAsDefaultInstance() {
  714. }
  715. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  716. const int TestMessageSetExtension2::kStrFieldNumber;
  717. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  718. TestMessageSetExtension2::TestMessageSetExtension2()
  719. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  720. ::google::protobuf::internal::InitSCC(
  721. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
  722. SharedCtor();
  723. // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetExtension2)
  724. }
  725. TestMessageSetExtension2::TestMessageSetExtension2(::google::protobuf::Arena* arena)
  726. : ::google::protobuf::Message(),
  727. _internal_metadata_(arena) {
  728. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
  729. SharedCtor();
  730. RegisterArenaDtor(arena);
  731. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetExtension2)
  732. }
  733. TestMessageSetExtension2::TestMessageSetExtension2(const TestMessageSetExtension2& from)
  734. : ::google::protobuf::Message(),
  735. _internal_metadata_(NULL),
  736. _has_bits_(from._has_bits_) {
  737. _internal_metadata_.MergeFrom(from._internal_metadata_);
  738. str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  739. if (from.has_str()) {
  740. str_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.str(),
  741. GetArenaNoVirtual());
  742. }
  743. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetExtension2)
  744. }
  745. void TestMessageSetExtension2::SharedCtor() {
  746. str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  747. }
  748. TestMessageSetExtension2::~TestMessageSetExtension2() {
  749. // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetExtension2)
  750. SharedDtor();
  751. }
  752. void TestMessageSetExtension2::SharedDtor() {
  753. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  754. str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  755. }
  756. void TestMessageSetExtension2::ArenaDtor(void* object) {
  757. TestMessageSetExtension2* _this = reinterpret_cast< TestMessageSetExtension2* >(object);
  758. (void)_this;
  759. }
  760. void TestMessageSetExtension2::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  761. }
  762. void TestMessageSetExtension2::SetCachedSize(int size) const {
  763. _cached_size_.Set(size);
  764. }
  765. const ::google::protobuf::Descriptor* TestMessageSetExtension2::descriptor() {
  766. ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  767. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  768. }
  769. const TestMessageSetExtension2& TestMessageSetExtension2::default_instance() {
  770. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
  771. return *internal_default_instance();
  772. }
  773. void TestMessageSetExtension2::Clear() {
  774. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetExtension2)
  775. ::google::protobuf::uint32 cached_has_bits = 0;
  776. // Prevent compiler warnings about cached_has_bits being unused
  777. (void) cached_has_bits;
  778. cached_has_bits = _has_bits_[0];
  779. if (cached_has_bits & 0x00000001u) {
  780. str_.ClearNonDefaultToEmpty();
  781. }
  782. _has_bits_.Clear();
  783. _internal_metadata_.Clear();
  784. }
  785. bool TestMessageSetExtension2::MergePartialFromCodedStream(
  786. ::google::protobuf::io::CodedInputStream* input) {
  787. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  788. ::google::protobuf::uint32 tag;
  789. // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetExtension2)
  790. for (;;) {
  791. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  792. tag = p.first;
  793. if (!p.second) goto handle_unusual;
  794. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  795. // optional string str = 25;
  796. case 25: {
  797. if (static_cast< ::google::protobuf::uint8>(tag) ==
  798. static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
  799. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  800. input, this->mutable_str()));
  801. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  802. this->str().data(), static_cast<int>(this->str().length()),
  803. ::google::protobuf::internal::WireFormat::PARSE,
  804. "protobuf_unittest.TestMessageSetExtension2.str");
  805. } else {
  806. goto handle_unusual;
  807. }
  808. break;
  809. }
  810. default: {
  811. handle_unusual:
  812. if (tag == 0) {
  813. goto success;
  814. }
  815. DO_(::google::protobuf::internal::WireFormat::SkipField(
  816. input, tag, _internal_metadata_.mutable_unknown_fields()));
  817. break;
  818. }
  819. }
  820. }
  821. success:
  822. // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetExtension2)
  823. return true;
  824. failure:
  825. // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetExtension2)
  826. return false;
  827. #undef DO_
  828. }
  829. void TestMessageSetExtension2::SerializeWithCachedSizes(
  830. ::google::protobuf::io::CodedOutputStream* output) const {
  831. // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetExtension2)
  832. ::google::protobuf::uint32 cached_has_bits = 0;
  833. (void) cached_has_bits;
  834. cached_has_bits = _has_bits_[0];
  835. // optional string str = 25;
  836. if (cached_has_bits & 0x00000001u) {
  837. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  838. this->str().data(), static_cast<int>(this->str().length()),
  839. ::google::protobuf::internal::WireFormat::SERIALIZE,
  840. "protobuf_unittest.TestMessageSetExtension2.str");
  841. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  842. 25, this->str(), output);
  843. }
  844. if (_internal_metadata_.have_unknown_fields()) {
  845. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  846. _internal_metadata_.unknown_fields(), output);
  847. }
  848. // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetExtension2)
  849. }
  850. ::google::protobuf::uint8* TestMessageSetExtension2::InternalSerializeWithCachedSizesToArray(
  851. bool deterministic, ::google::protobuf::uint8* target) const {
  852. (void)deterministic; // Unused
  853. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetExtension2)
  854. ::google::protobuf::uint32 cached_has_bits = 0;
  855. (void) cached_has_bits;
  856. cached_has_bits = _has_bits_[0];
  857. // optional string str = 25;
  858. if (cached_has_bits & 0x00000001u) {
  859. ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
  860. this->str().data(), static_cast<int>(this->str().length()),
  861. ::google::protobuf::internal::WireFormat::SERIALIZE,
  862. "protobuf_unittest.TestMessageSetExtension2.str");
  863. target =
  864. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  865. 25, this->str(), target);
  866. }
  867. if (_internal_metadata_.have_unknown_fields()) {
  868. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  869. _internal_metadata_.unknown_fields(), target);
  870. }
  871. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetExtension2)
  872. return target;
  873. }
  874. size_t TestMessageSetExtension2::ByteSizeLong() const {
  875. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetExtension2)
  876. size_t total_size = 0;
  877. if (_internal_metadata_.have_unknown_fields()) {
  878. total_size +=
  879. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  880. _internal_metadata_.unknown_fields());
  881. }
  882. // optional string str = 25;
  883. if (has_str()) {
  884. total_size += 2 +
  885. ::google::protobuf::internal::WireFormatLite::StringSize(
  886. this->str());
  887. }
  888. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  889. SetCachedSize(cached_size);
  890. return total_size;
  891. }
  892. void TestMessageSetExtension2::MergeFrom(const ::google::protobuf::Message& from) {
  893. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetExtension2)
  894. GOOGLE_DCHECK_NE(&from, this);
  895. const TestMessageSetExtension2* source =
  896. ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetExtension2>(
  897. &from);
  898. if (source == NULL) {
  899. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetExtension2)
  900. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  901. } else {
  902. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetExtension2)
  903. MergeFrom(*source);
  904. }
  905. }
  906. void TestMessageSetExtension2::MergeFrom(const TestMessageSetExtension2& from) {
  907. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetExtension2)
  908. GOOGLE_DCHECK_NE(&from, this);
  909. _internal_metadata_.MergeFrom(from._internal_metadata_);
  910. ::google::protobuf::uint32 cached_has_bits = 0;
  911. (void) cached_has_bits;
  912. if (from.has_str()) {
  913. set_str(from.str());
  914. }
  915. }
  916. void TestMessageSetExtension2::CopyFrom(const ::google::protobuf::Message& from) {
  917. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetExtension2)
  918. if (&from == this) return;
  919. Clear();
  920. MergeFrom(from);
  921. }
  922. void TestMessageSetExtension2::CopyFrom(const TestMessageSetExtension2& from) {
  923. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetExtension2)
  924. if (&from == this) return;
  925. Clear();
  926. MergeFrom(from);
  927. }
  928. bool TestMessageSetExtension2::IsInitialized() const {
  929. return true;
  930. }
  931. void TestMessageSetExtension2::Swap(TestMessageSetExtension2* other) {
  932. if (other == this) return;
  933. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  934. InternalSwap(other);
  935. } else {
  936. TestMessageSetExtension2* temp = New(GetArenaNoVirtual());
  937. temp->MergeFrom(*other);
  938. other->CopyFrom(*this);
  939. InternalSwap(temp);
  940. if (GetArenaNoVirtual() == NULL) {
  941. delete temp;
  942. }
  943. }
  944. }
  945. void TestMessageSetExtension2::UnsafeArenaSwap(TestMessageSetExtension2* other) {
  946. if (other == this) return;
  947. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  948. InternalSwap(other);
  949. }
  950. void TestMessageSetExtension2::InternalSwap(TestMessageSetExtension2* other) {
  951. using std::swap;
  952. str_.Swap(&other->str_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  953. GetArenaNoVirtual());
  954. swap(_has_bits_[0], other->_has_bits_[0]);
  955. _internal_metadata_.Swap(&other->_internal_metadata_);
  956. }
  957. ::google::protobuf::Metadata TestMessageSetExtension2::GetMetadata() const {
  958. protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  959. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
  960. }
  961. // ===================================================================
  962. void RawMessageSet_Item::InitAsDefaultInstance() {
  963. }
  964. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  965. const int RawMessageSet_Item::kTypeIdFieldNumber;
  966. const int RawMessageSet_Item::kMessageFieldNumber;
  967. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  968. RawMessageSet_Item::RawMessageSet_Item()
  969. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  970. ::google::protobuf::internal::InitSCC(
  971. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
  972. SharedCtor();
  973. // @@protoc_insertion_point(constructor:protobuf_unittest.RawMessageSet.Item)
  974. }
  975. RawMessageSet_Item::RawMessageSet_Item(::google::protobuf::Arena* arena)
  976. : ::google::protobuf::Message(),
  977. _internal_metadata_(arena) {
  978. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
  979. SharedCtor();
  980. RegisterArenaDtor(arena);
  981. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.RawMessageSet.Item)
  982. }
  983. RawMessageSet_Item::RawMessageSet_Item(const RawMessageSet_Item& from)
  984. : ::google::protobuf::Message(),
  985. _internal_metadata_(NULL),
  986. _has_bits_(from._has_bits_) {
  987. _internal_metadata_.MergeFrom(from._internal_metadata_);
  988. message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  989. if (from.has_message()) {
  990. message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message(),
  991. GetArenaNoVirtual());
  992. }
  993. type_id_ = from.type_id_;
  994. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.RawMessageSet.Item)
  995. }
  996. void RawMessageSet_Item::SharedCtor() {
  997. message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  998. type_id_ = 0;
  999. }
  1000. RawMessageSet_Item::~RawMessageSet_Item() {
  1001. // @@protoc_insertion_point(destructor:protobuf_unittest.RawMessageSet.Item)
  1002. SharedDtor();
  1003. }
  1004. void RawMessageSet_Item::SharedDtor() {
  1005. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  1006. message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1007. }
  1008. void RawMessageSet_Item::ArenaDtor(void* object) {
  1009. RawMessageSet_Item* _this = reinterpret_cast< RawMessageSet_Item* >(object);
  1010. (void)_this;
  1011. }
  1012. void RawMessageSet_Item::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  1013. }
  1014. void RawMessageSet_Item::SetCachedSize(int size) const {
  1015. _cached_size_.Set(size);
  1016. }
  1017. const ::google::protobuf::Descriptor* RawMessageSet_Item::descriptor() {
  1018. ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  1019. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1020. }
  1021. const RawMessageSet_Item& RawMessageSet_Item::default_instance() {
  1022. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
  1023. return *internal_default_instance();
  1024. }
  1025. void RawMessageSet_Item::Clear() {
  1026. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.RawMessageSet.Item)
  1027. ::google::protobuf::uint32 cached_has_bits = 0;
  1028. // Prevent compiler warnings about cached_has_bits being unused
  1029. (void) cached_has_bits;
  1030. cached_has_bits = _has_bits_[0];
  1031. if (cached_has_bits & 0x00000001u) {
  1032. message_.ClearNonDefaultToEmpty();
  1033. }
  1034. type_id_ = 0;
  1035. _has_bits_.Clear();
  1036. _internal_metadata_.Clear();
  1037. }
  1038. bool RawMessageSet_Item::MergePartialFromCodedStream(
  1039. ::google::protobuf::io::CodedInputStream* input) {
  1040. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1041. ::google::protobuf::uint32 tag;
  1042. // @@protoc_insertion_point(parse_start:protobuf_unittest.RawMessageSet.Item)
  1043. for (;;) {
  1044. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1045. tag = p.first;
  1046. if (!p.second) goto handle_unusual;
  1047. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1048. // required int32 type_id = 2;
  1049. case 2: {
  1050. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1051. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  1052. set_has_type_id();
  1053. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1054. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  1055. input, &type_id_)));
  1056. } else {
  1057. goto handle_unusual;
  1058. }
  1059. break;
  1060. }
  1061. // required bytes message = 3;
  1062. case 3: {
  1063. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1064. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  1065. DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
  1066. input, this->mutable_message()));
  1067. } else {
  1068. goto handle_unusual;
  1069. }
  1070. break;
  1071. }
  1072. default: {
  1073. handle_unusual:
  1074. if (tag == 0 ||
  1075. ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  1076. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  1077. input->SetLastTag(tag);
  1078. goto success;
  1079. }
  1080. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1081. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1082. break;
  1083. }
  1084. }
  1085. }
  1086. success:
  1087. // @@protoc_insertion_point(parse_success:protobuf_unittest.RawMessageSet.Item)
  1088. return true;
  1089. failure:
  1090. // @@protoc_insertion_point(parse_failure:protobuf_unittest.RawMessageSet.Item)
  1091. return false;
  1092. #undef DO_
  1093. }
  1094. void RawMessageSet_Item::SerializeWithCachedSizes(
  1095. ::google::protobuf::io::CodedOutputStream* output) const {
  1096. // @@protoc_insertion_point(serialize_start:protobuf_unittest.RawMessageSet.Item)
  1097. ::google::protobuf::uint32 cached_has_bits = 0;
  1098. (void) cached_has_bits;
  1099. cached_has_bits = _has_bits_[0];
  1100. // required int32 type_id = 2;
  1101. if (cached_has_bits & 0x00000002u) {
  1102. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->type_id(), output);
  1103. }
  1104. // required bytes message = 3;
  1105. if (cached_has_bits & 0x00000001u) {
  1106. ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
  1107. 3, this->message(), output);
  1108. }
  1109. if (_internal_metadata_.have_unknown_fields()) {
  1110. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1111. _internal_metadata_.unknown_fields(), output);
  1112. }
  1113. // @@protoc_insertion_point(serialize_end:protobuf_unittest.RawMessageSet.Item)
  1114. }
  1115. ::google::protobuf::uint8* RawMessageSet_Item::InternalSerializeWithCachedSizesToArray(
  1116. bool deterministic, ::google::protobuf::uint8* target) const {
  1117. (void)deterministic; // Unused
  1118. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.RawMessageSet.Item)
  1119. ::google::protobuf::uint32 cached_has_bits = 0;
  1120. (void) cached_has_bits;
  1121. cached_has_bits = _has_bits_[0];
  1122. // required int32 type_id = 2;
  1123. if (cached_has_bits & 0x00000002u) {
  1124. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->type_id(), target);
  1125. }
  1126. // required bytes message = 3;
  1127. if (cached_has_bits & 0x00000001u) {
  1128. target =
  1129. ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
  1130. 3, this->message(), target);
  1131. }
  1132. if (_internal_metadata_.have_unknown_fields()) {
  1133. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1134. _internal_metadata_.unknown_fields(), target);
  1135. }
  1136. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.RawMessageSet.Item)
  1137. return target;
  1138. }
  1139. size_t RawMessageSet_Item::RequiredFieldsByteSizeFallback() const {
  1140. // @@protoc_insertion_point(required_fields_byte_size_fallback_start:protobuf_unittest.RawMessageSet.Item)
  1141. size_t total_size = 0;
  1142. if (has_message()) {
  1143. // required bytes message = 3;
  1144. total_size += 1 +
  1145. ::google::protobuf::internal::WireFormatLite::BytesSize(
  1146. this->message());
  1147. }
  1148. if (has_type_id()) {
  1149. // required int32 type_id = 2;
  1150. total_size += 1 +
  1151. ::google::protobuf::internal::WireFormatLite::Int32Size(
  1152. this->type_id());
  1153. }
  1154. return total_size;
  1155. }
  1156. size_t RawMessageSet_Item::ByteSizeLong() const {
  1157. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.RawMessageSet.Item)
  1158. size_t total_size = 0;
  1159. if (_internal_metadata_.have_unknown_fields()) {
  1160. total_size +=
  1161. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1162. _internal_metadata_.unknown_fields());
  1163. }
  1164. if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present.
  1165. // required bytes message = 3;
  1166. total_size += 1 +
  1167. ::google::protobuf::internal::WireFormatLite::BytesSize(
  1168. this->message());
  1169. // required int32 type_id = 2;
  1170. total_size += 1 +
  1171. ::google::protobuf::internal::WireFormatLite::Int32Size(
  1172. this->type_id());
  1173. } else {
  1174. total_size += RequiredFieldsByteSizeFallback();
  1175. }
  1176. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1177. SetCachedSize(cached_size);
  1178. return total_size;
  1179. }
  1180. void RawMessageSet_Item::MergeFrom(const ::google::protobuf::Message& from) {
  1181. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.RawMessageSet.Item)
  1182. GOOGLE_DCHECK_NE(&from, this);
  1183. const RawMessageSet_Item* source =
  1184. ::google::protobuf::internal::DynamicCastToGenerated<const RawMessageSet_Item>(
  1185. &from);
  1186. if (source == NULL) {
  1187. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.RawMessageSet.Item)
  1188. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1189. } else {
  1190. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.RawMessageSet.Item)
  1191. MergeFrom(*source);
  1192. }
  1193. }
  1194. void RawMessageSet_Item::MergeFrom(const RawMessageSet_Item& from) {
  1195. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.RawMessageSet.Item)
  1196. GOOGLE_DCHECK_NE(&from, this);
  1197. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1198. ::google::protobuf::uint32 cached_has_bits = 0;
  1199. (void) cached_has_bits;
  1200. cached_has_bits = from._has_bits_[0];
  1201. if (cached_has_bits & 3u) {
  1202. if (cached_has_bits & 0x00000001u) {
  1203. set_message(from.message());
  1204. }
  1205. if (cached_has_bits & 0x00000002u) {
  1206. type_id_ = from.type_id_;
  1207. }
  1208. _has_bits_[0] |= cached_has_bits;
  1209. }
  1210. }
  1211. void RawMessageSet_Item::CopyFrom(const ::google::protobuf::Message& from) {
  1212. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.RawMessageSet.Item)
  1213. if (&from == this) return;
  1214. Clear();
  1215. MergeFrom(from);
  1216. }
  1217. void RawMessageSet_Item::CopyFrom(const RawMessageSet_Item& from) {
  1218. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.RawMessageSet.Item)
  1219. if (&from == this) return;
  1220. Clear();
  1221. MergeFrom(from);
  1222. }
  1223. bool RawMessageSet_Item::IsInitialized() const {
  1224. if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
  1225. return true;
  1226. }
  1227. void RawMessageSet_Item::Swap(RawMessageSet_Item* other) {
  1228. if (other == this) return;
  1229. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  1230. InternalSwap(other);
  1231. } else {
  1232. RawMessageSet_Item* temp = New(GetArenaNoVirtual());
  1233. temp->MergeFrom(*other);
  1234. other->CopyFrom(*this);
  1235. InternalSwap(temp);
  1236. if (GetArenaNoVirtual() == NULL) {
  1237. delete temp;
  1238. }
  1239. }
  1240. }
  1241. void RawMessageSet_Item::UnsafeArenaSwap(RawMessageSet_Item* other) {
  1242. if (other == this) return;
  1243. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  1244. InternalSwap(other);
  1245. }
  1246. void RawMessageSet_Item::InternalSwap(RawMessageSet_Item* other) {
  1247. using std::swap;
  1248. message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1249. GetArenaNoVirtual());
  1250. swap(type_id_, other->type_id_);
  1251. swap(_has_bits_[0], other->_has_bits_[0]);
  1252. _internal_metadata_.Swap(&other->_internal_metadata_);
  1253. }
  1254. ::google::protobuf::Metadata RawMessageSet_Item::GetMetadata() const {
  1255. protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  1256. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
  1257. }
  1258. // ===================================================================
  1259. void RawMessageSet::InitAsDefaultInstance() {
  1260. }
  1261. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1262. const int RawMessageSet::kItemFieldNumber;
  1263. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1264. RawMessageSet::RawMessageSet()
  1265. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1266. ::google::protobuf::internal::InitSCC(
  1267. &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
  1268. SharedCtor();
  1269. // @@protoc_insertion_point(constructor:protobuf_unittest.RawMessageSet)
  1270. }
  1271. RawMessageSet::RawMessageSet(::google::protobuf::Arena* arena)
  1272. : ::google::protobuf::Message(),
  1273. _internal_metadata_(arena),
  1274. item_(arena) {
  1275. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
  1276. SharedCtor();
  1277. RegisterArenaDtor(arena);
  1278. // @@protoc_insertion_point(arena_constructor:protobuf_unittest.RawMessageSet)
  1279. }
  1280. RawMessageSet::RawMessageSet(const RawMessageSet& from)
  1281. : ::google::protobuf::Message(),
  1282. _internal_metadata_(NULL),
  1283. _has_bits_(from._has_bits_),
  1284. item_(from.item_) {
  1285. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1286. // @@protoc_insertion_point(copy_constructor:protobuf_unittest.RawMessageSet)
  1287. }
  1288. void RawMessageSet::SharedCtor() {
  1289. }
  1290. RawMessageSet::~RawMessageSet() {
  1291. // @@protoc_insertion_point(destructor:protobuf_unittest.RawMessageSet)
  1292. SharedDtor();
  1293. }
  1294. void RawMessageSet::SharedDtor() {
  1295. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  1296. }
  1297. void RawMessageSet::ArenaDtor(void* object) {
  1298. RawMessageSet* _this = reinterpret_cast< RawMessageSet* >(object);
  1299. (void)_this;
  1300. }
  1301. void RawMessageSet::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  1302. }
  1303. void RawMessageSet::SetCachedSize(int size) const {
  1304. _cached_size_.Set(size);
  1305. }
  1306. const ::google::protobuf::Descriptor* RawMessageSet::descriptor() {
  1307. ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  1308. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1309. }
  1310. const RawMessageSet& RawMessageSet::default_instance() {
  1311. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
  1312. return *internal_default_instance();
  1313. }
  1314. void RawMessageSet::Clear() {
  1315. // @@protoc_insertion_point(message_clear_start:protobuf_unittest.RawMessageSet)
  1316. ::google::protobuf::uint32 cached_has_bits = 0;
  1317. // Prevent compiler warnings about cached_has_bits being unused
  1318. (void) cached_has_bits;
  1319. item_.Clear();
  1320. _has_bits_.Clear();
  1321. _internal_metadata_.Clear();
  1322. }
  1323. bool RawMessageSet::MergePartialFromCodedStream(
  1324. ::google::protobuf::io::CodedInputStream* input) {
  1325. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1326. ::google::protobuf::uint32 tag;
  1327. // @@protoc_insertion_point(parse_start:protobuf_unittest.RawMessageSet)
  1328. for (;;) {
  1329. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1330. tag = p.first;
  1331. if (!p.second) goto handle_unusual;
  1332. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1333. // repeated group Item = 1 { ... };
  1334. case 1: {
  1335. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1336. static_cast< ::google::protobuf::uint8>(11u /* 11 & 0xFF */)) {
  1337. DO_(::google::protobuf::internal::WireFormatLite::ReadGroup(1, input, add_item()));
  1338. } else {
  1339. goto handle_unusual;
  1340. }
  1341. break;
  1342. }
  1343. default: {
  1344. handle_unusual:
  1345. if (tag == 0) {
  1346. goto success;
  1347. }
  1348. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1349. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1350. break;
  1351. }
  1352. }
  1353. }
  1354. success:
  1355. // @@protoc_insertion_point(parse_success:protobuf_unittest.RawMessageSet)
  1356. return true;
  1357. failure:
  1358. // @@protoc_insertion_point(parse_failure:protobuf_unittest.RawMessageSet)
  1359. return false;
  1360. #undef DO_
  1361. }
  1362. void RawMessageSet::SerializeWithCachedSizes(
  1363. ::google::protobuf::io::CodedOutputStream* output) const {
  1364. // @@protoc_insertion_point(serialize_start:protobuf_unittest.RawMessageSet)
  1365. ::google::protobuf::uint32 cached_has_bits = 0;
  1366. (void) cached_has_bits;
  1367. // repeated group Item = 1 { ... };
  1368. for (unsigned int i = 0,
  1369. n = static_cast<unsigned int>(this->item_size()); i < n; i++) {
  1370. ::google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(
  1371. 1,
  1372. this->item(static_cast<int>(i)),
  1373. output);
  1374. }
  1375. if (_internal_metadata_.have_unknown_fields()) {
  1376. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1377. _internal_metadata_.unknown_fields(), output);
  1378. }
  1379. // @@protoc_insertion_point(serialize_end:protobuf_unittest.RawMessageSet)
  1380. }
  1381. ::google::protobuf::uint8* RawMessageSet::InternalSerializeWithCachedSizesToArray(
  1382. bool deterministic, ::google::protobuf::uint8* target) const {
  1383. (void)deterministic; // Unused
  1384. // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.RawMessageSet)
  1385. ::google::protobuf::uint32 cached_has_bits = 0;
  1386. (void) cached_has_bits;
  1387. // repeated group Item = 1 { ... };
  1388. for (unsigned int i = 0,
  1389. n = static_cast<unsigned int>(this->item_size()); i < n; i++) {
  1390. target = ::google::protobuf::internal::WireFormatLite::
  1391. InternalWriteGroupToArray(
  1392. 1, this->item(static_cast<int>(i)), deterministic, target);
  1393. }
  1394. if (_internal_metadata_.have_unknown_fields()) {
  1395. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1396. _internal_metadata_.unknown_fields(), target);
  1397. }
  1398. // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.RawMessageSet)
  1399. return target;
  1400. }
  1401. size_t RawMessageSet::ByteSizeLong() const {
  1402. // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.RawMessageSet)
  1403. size_t total_size = 0;
  1404. if (_internal_metadata_.have_unknown_fields()) {
  1405. total_size +=
  1406. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1407. _internal_metadata_.unknown_fields());
  1408. }
  1409. // repeated group Item = 1 { ... };
  1410. {
  1411. unsigned int count = static_cast<unsigned int>(this->item_size());
  1412. total_size += 2UL * count;
  1413. for (unsigned int i = 0; i < count; i++) {
  1414. total_size +=
  1415. ::google::protobuf::internal::WireFormatLite::GroupSize(
  1416. this->item(static_cast<int>(i)));
  1417. }
  1418. }
  1419. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1420. SetCachedSize(cached_size);
  1421. return total_size;
  1422. }
  1423. void RawMessageSet::MergeFrom(const ::google::protobuf::Message& from) {
  1424. // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.RawMessageSet)
  1425. GOOGLE_DCHECK_NE(&from, this);
  1426. const RawMessageSet* source =
  1427. ::google::protobuf::internal::DynamicCastToGenerated<const RawMessageSet>(
  1428. &from);
  1429. if (source == NULL) {
  1430. // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.RawMessageSet)
  1431. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1432. } else {
  1433. // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.RawMessageSet)
  1434. MergeFrom(*source);
  1435. }
  1436. }
  1437. void RawMessageSet::MergeFrom(const RawMessageSet& from) {
  1438. // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.RawMessageSet)
  1439. GOOGLE_DCHECK_NE(&from, this);
  1440. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1441. ::google::protobuf::uint32 cached_has_bits = 0;
  1442. (void) cached_has_bits;
  1443. item_.MergeFrom(from.item_);
  1444. }
  1445. void RawMessageSet::CopyFrom(const ::google::protobuf::Message& from) {
  1446. // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.RawMessageSet)
  1447. if (&from == this) return;
  1448. Clear();
  1449. MergeFrom(from);
  1450. }
  1451. void RawMessageSet::CopyFrom(const RawMessageSet& from) {
  1452. // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.RawMessageSet)
  1453. if (&from == this) return;
  1454. Clear();
  1455. MergeFrom(from);
  1456. }
  1457. bool RawMessageSet::IsInitialized() const {
  1458. if (!::google::protobuf::internal::AllAreInitialized(this->item())) return false;
  1459. return true;
  1460. }
  1461. void RawMessageSet::Swap(RawMessageSet* other) {
  1462. if (other == this) return;
  1463. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  1464. InternalSwap(other);
  1465. } else {
  1466. RawMessageSet* temp = New(GetArenaNoVirtual());
  1467. temp->MergeFrom(*other);
  1468. other->CopyFrom(*this);
  1469. InternalSwap(temp);
  1470. if (GetArenaNoVirtual() == NULL) {
  1471. delete temp;
  1472. }
  1473. }
  1474. }
  1475. void RawMessageSet::UnsafeArenaSwap(RawMessageSet* other) {
  1476. if (other == this) return;
  1477. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  1478. InternalSwap(other);
  1479. }
  1480. void RawMessageSet::InternalSwap(RawMessageSet* other) {
  1481. using std::swap;
  1482. CastToBase(&item_)->InternalSwap(CastToBase(&other->item_));
  1483. swap(_has_bits_[0], other->_has_bits_[0]);
  1484. _internal_metadata_.Swap(&other->_internal_metadata_);
  1485. }
  1486. ::google::protobuf::Metadata RawMessageSet::GetMetadata() const {
  1487. protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
  1488. return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
  1489. }
  1490. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1491. const int TestMessageSetExtension1::kMessageSetExtensionFieldNumber;
  1492. #endif
  1493. ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
  1494. ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension1 >, 11, false >
  1495. TestMessageSetExtension1::message_set_extension(kMessageSetExtensionFieldNumber, *::protobuf_unittest::TestMessageSetExtension1::internal_default_instance());
  1496. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1497. const int TestMessageSetExtension2::kMessageSetExtensionFieldNumber;
  1498. #endif
  1499. ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
  1500. ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension2 >, 11, false >
  1501. TestMessageSetExtension2::message_set_extension(kMessageSetExtensionFieldNumber, *::protobuf_unittest::TestMessageSetExtension2::internal_default_instance());
  1502. // @@protoc_insertion_point(namespace_scope)
  1503. } // namespace protobuf_unittest
  1504. namespace google {
  1505. namespace protobuf {
  1506. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetContainer* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetContainer >(Arena* arena) {
  1507. return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetContainer >(arena);
  1508. }
  1509. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetExtension1* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetExtension1 >(Arena* arena) {
  1510. return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetExtension1 >(arena);
  1511. }
  1512. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetExtension2* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetExtension2 >(Arena* arena) {
  1513. return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetExtension2 >(arena);
  1514. }
  1515. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::RawMessageSet_Item* Arena::CreateMaybeMessage< ::protobuf_unittest::RawMessageSet_Item >(Arena* arena) {
  1516. return Arena::CreateMessageInternal< ::protobuf_unittest::RawMessageSet_Item >(arena);
  1517. }
  1518. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::RawMessageSet* Arena::CreateMaybeMessage< ::protobuf_unittest::RawMessageSet >(Arena* arena) {
  1519. return Arena::CreateMessageInternal< ::protobuf_unittest::RawMessageSet >(arena);
  1520. }
  1521. } // namespace protobuf
  1522. } // namespace google
  1523. // @@protoc_insertion_point(global_scope)