message_differencer_unittest.pb.cc 63 KB

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