1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714 |
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: google/protobuf/unittest_mset.proto
- #include <google/protobuf/unittest_mset.pb.h>
- #include <algorithm>
- #include <google/protobuf/stubs/common.h>
- #include <google/protobuf/stubs/port.h>
- #include <google/protobuf/io/coded_stream.h>
- #include <google/protobuf/wire_format_lite_inl.h>
- #include <google/protobuf/descriptor.h>
- #include <google/protobuf/generated_message_reflection.h>
- #include <google/protobuf/reflection_ops.h>
- #include <google/protobuf/wire_format.h>
- // This is a temporary google only hack
- #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
- #include "third_party/protobuf/version.h"
- #endif
- // @@protoc_insertion_point(includes)
- namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto {
- extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RawMessageSet_Item;
- extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension1;
- extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension2;
- } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto
- namespace protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto {
- extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSet;
- } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto
- namespace protobuf_unittest {
- class TestMessageSetContainerDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetContainer>
- _instance;
- } _TestMessageSetContainer_default_instance_;
- class TestMessageSetExtension1DefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetExtension1>
- _instance;
- } _TestMessageSetExtension1_default_instance_;
- class TestMessageSetExtension2DefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<TestMessageSetExtension2>
- _instance;
- } _TestMessageSetExtension2_default_instance_;
- class RawMessageSet_ItemDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<RawMessageSet_Item>
- _instance;
- } _RawMessageSet_Item_default_instance_;
- class RawMessageSetDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<RawMessageSet>
- _instance;
- } _RawMessageSet_default_instance_;
- } // namespace protobuf_unittest
- namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto {
- static void InitDefaultsTestMessageSetContainer() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::protobuf_unittest::_TestMessageSetContainer_default_instance_;
- new (ptr) ::protobuf_unittest::TestMessageSetContainer();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::protobuf_unittest::TestMessageSetContainer::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<1> scc_info_TestMessageSetContainer =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTestMessageSetContainer}, {
- &protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto::scc_info_TestMessageSet.base,}};
- static void InitDefaultsTestMessageSetExtension1() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::protobuf_unittest::_TestMessageSetExtension1_default_instance_;
- new (ptr) ::protobuf_unittest::TestMessageSetExtension1();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::protobuf_unittest::TestMessageSetExtension1::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension1 =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestMessageSetExtension1}, {}};
- static void InitDefaultsTestMessageSetExtension2() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::protobuf_unittest::_TestMessageSetExtension2_default_instance_;
- new (ptr) ::protobuf_unittest::TestMessageSetExtension2();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::protobuf_unittest::TestMessageSetExtension2::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<0> scc_info_TestMessageSetExtension2 =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTestMessageSetExtension2}, {}};
- static void InitDefaultsRawMessageSet_Item() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::protobuf_unittest::_RawMessageSet_Item_default_instance_;
- new (ptr) ::protobuf_unittest::RawMessageSet_Item();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::protobuf_unittest::RawMessageSet_Item::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<0> scc_info_RawMessageSet_Item =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRawMessageSet_Item}, {}};
- static void InitDefaultsRawMessageSet() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::protobuf_unittest::_RawMessageSet_default_instance_;
- new (ptr) ::protobuf_unittest::RawMessageSet();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::protobuf_unittest::RawMessageSet::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<1> scc_info_RawMessageSet =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsRawMessageSet}, {
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base,}};
- void InitDefaults() {
- ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetContainer.base);
- ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetExtension1.base);
- ::google::protobuf::internal::InitSCC(&scc_info_TestMessageSetExtension2.base);
- ::google::protobuf::internal::InitSCC(&scc_info_RawMessageSet_Item.base);
- ::google::protobuf::internal::InitSCC(&scc_info_RawMessageSet.base);
- }
- ::google::protobuf::Metadata file_level_metadata[5];
- const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetContainer, message_set_),
- 0,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension1, i_),
- 0,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::TestMessageSetExtension2, str_),
- 0,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, type_id_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet_Item, message_),
- 1,
- 0,
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::protobuf_unittest::RawMessageSet, item_),
- ~0u,
- };
- static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- { 0, 6, sizeof(::protobuf_unittest::TestMessageSetContainer)},
- { 7, 13, sizeof(::protobuf_unittest::TestMessageSetExtension1)},
- { 14, 20, sizeof(::protobuf_unittest::TestMessageSetExtension2)},
- { 21, 28, sizeof(::protobuf_unittest::RawMessageSet_Item)},
- { 30, 36, sizeof(::protobuf_unittest::RawMessageSet)},
- };
- static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetContainer_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetExtension1_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_TestMessageSetExtension2_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_RawMessageSet_Item_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::protobuf_unittest::_RawMessageSet_default_instance_),
- };
- void protobuf_AssignDescriptors() {
- AddDescriptors();
- AssignDescriptors(
- "google/protobuf/unittest_mset.proto", schemas, file_default_instances, TableStruct::offsets,
- file_level_metadata, NULL, NULL);
- }
- void protobuf_AssignDescriptorsOnce() {
- static ::google::protobuf::internal::once_flag once;
- ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
- }
- void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
- void protobuf_RegisterTypes(const ::std::string&) {
- protobuf_AssignDescriptorsOnce();
- ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5);
- }
- void AddDescriptorsImpl() {
- InitDefaults();
- static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- "\n#google/protobuf/unittest_mset.proto\022\021p"
- "rotobuf_unittest\032/google/protobuf/unitte"
- "st_mset_wire_format.proto\"Z\n\027TestMessage"
- "SetContainer\022\?\n\013message_set\030\001 \001(\0132*.prot"
- "o2_wireformat_unittest.TestMessageSet\"\237\001"
- "\n\030TestMessageSetExtension1\022\t\n\001i\030\017 \001(\0052x\n"
- "\025message_set_extension\022*.proto2_wireform"
- "at_unittest.TestMessageSet\030\260\246^ \001(\0132+.pro"
- "tobuf_unittest.TestMessageSetExtension1\""
- "\241\001\n\030TestMessageSetExtension2\022\013\n\003str\030\031 \001("
- "\t2x\n\025message_set_extension\022*.proto2_wire"
- "format_unittest.TestMessageSet\030\371\273^ \001(\0132+"
- ".protobuf_unittest.TestMessageSetExtensi"
- "on2\"n\n\rRawMessageSet\0223\n\004item\030\001 \003(\n2%.pro"
- "tobuf_unittest.RawMessageSet.Item\032(\n\004Ite"
- "m\022\017\n\007type_id\030\002 \002(\005\022\017\n\007message\030\003 \002(\014B\005H\001\370"
- "\001\001"
- };
- ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
- descriptor, 642);
- ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
- "google/protobuf/unittest_mset.proto", &protobuf_RegisterTypes);
- ::protobuf_google_2fprotobuf_2funittest_5fmset_5fwire_5fformat_2eproto::AddDescriptors();
- }
- void AddDescriptors() {
- static ::google::protobuf::internal::once_flag once;
- ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
- }
- // Force AddDescriptors() to be called at dynamic initialization time.
- struct StaticDescriptorInitializer {
- StaticDescriptorInitializer() {
- AddDescriptors();
- }
- } static_descriptor_initializer;
- } // namespace protobuf_google_2fprotobuf_2funittest_5fmset_2eproto
- namespace protobuf_unittest {
- // ===================================================================
- void TestMessageSetContainer::InitAsDefaultInstance() {
- ::protobuf_unittest::_TestMessageSetContainer_default_instance_._instance.get_mutable()->message_set_ = const_cast< ::proto2_wireformat_unittest::TestMessageSet*>(
- ::proto2_wireformat_unittest::TestMessageSet::internal_default_instance());
- }
- void TestMessageSetContainer::unsafe_arena_set_allocated_message_set(
- ::proto2_wireformat_unittest::TestMessageSet* message_set) {
- if (GetArenaNoVirtual() == NULL) {
- delete message_set_;
- }
- message_set_ = message_set;
- if (message_set) {
- set_has_message_set();
- } else {
- clear_has_message_set();
- }
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf_unittest.TestMessageSetContainer.message_set)
- }
- void TestMessageSetContainer::clear_message_set() {
- if (message_set_ != NULL) message_set_->Clear();
- clear_has_message_set();
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int TestMessageSetContainer::kMessageSetFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- TestMessageSetContainer::TestMessageSetContainer()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetContainer)
- }
- TestMessageSetContainer::TestMessageSetContainer(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetContainer)
- }
- TestMessageSetContainer::TestMessageSetContainer(const TestMessageSetContainer& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- _has_bits_(from._has_bits_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- if (from.has_message_set()) {
- message_set_ = new ::proto2_wireformat_unittest::TestMessageSet(*from.message_set_);
- } else {
- message_set_ = NULL;
- }
- // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetContainer)
- }
- void TestMessageSetContainer::SharedCtor() {
- message_set_ = NULL;
- }
- TestMessageSetContainer::~TestMessageSetContainer() {
- // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetContainer)
- SharedDtor();
- }
- void TestMessageSetContainer::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- if (this != internal_default_instance()) delete message_set_;
- }
- void TestMessageSetContainer::ArenaDtor(void* object) {
- TestMessageSetContainer* _this = reinterpret_cast< TestMessageSetContainer* >(object);
- (void)_this;
- }
- void TestMessageSetContainer::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void TestMessageSetContainer::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* TestMessageSetContainer::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const TestMessageSetContainer& TestMessageSetContainer::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetContainer.base);
- return *internal_default_instance();
- }
- void TestMessageSetContainer::Clear() {
- // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetContainer)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- if (cached_has_bits & 0x00000001u) {
- GOOGLE_DCHECK(message_set_ != NULL);
- message_set_->Clear();
- }
- _has_bits_.Clear();
- _internal_metadata_.Clear();
- }
- bool TestMessageSetContainer::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
- #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
- // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetContainer)
- for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
- tag = p.first;
- if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
- input, mutable_message_set()));
- } else {
- goto handle_unusual;
- }
- break;
- }
- default: {
- handle_unusual:
- if (tag == 0) {
- goto success;
- }
- DO_(::google::protobuf::internal::WireFormat::SkipField(
- input, tag, _internal_metadata_.mutable_unknown_fields()));
- break;
- }
- }
- }
- success:
- // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetContainer)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetContainer)
- return false;
- #undef DO_
- }
- void TestMessageSetContainer::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetContainer)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
- if (cached_has_bits & 0x00000001u) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 1, this->_internal_message_set(), output);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- _internal_metadata_.unknown_fields(), output);
- }
- // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetContainer)
- }
- ::google::protobuf::uint8* TestMessageSetContainer::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetContainer)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
- if (cached_has_bits & 0x00000001u) {
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageToArray(
- 1, this->_internal_message_set(), deterministic, target);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- _internal_metadata_.unknown_fields(), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetContainer)
- return target;
- }
- size_t TestMessageSetContainer::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetContainer)
- size_t total_size = 0;
- if (_internal_metadata_.have_unknown_fields()) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- _internal_metadata_.unknown_fields());
- }
- // optional .proto2_wireformat_unittest.TestMessageSet message_set = 1;
- if (has_message_set()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSize(
- *message_set_);
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void TestMessageSetContainer::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetContainer)
- GOOGLE_DCHECK_NE(&from, this);
- const TestMessageSetContainer* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetContainer>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetContainer)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetContainer)
- MergeFrom(*source);
- }
- }
- void TestMessageSetContainer::MergeFrom(const TestMessageSetContainer& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetContainer)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- if (from.has_message_set()) {
- mutable_message_set()->::proto2_wireformat_unittest::TestMessageSet::MergeFrom(from.message_set());
- }
- }
- void TestMessageSetContainer::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetContainer)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void TestMessageSetContainer::CopyFrom(const TestMessageSetContainer& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetContainer)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool TestMessageSetContainer::IsInitialized() const {
- if (has_message_set()) {
- if (!this->message_set_->IsInitialized()) return false;
- }
- return true;
- }
- void TestMessageSetContainer::Swap(TestMessageSetContainer* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- TestMessageSetContainer* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void TestMessageSetContainer::UnsafeArenaSwap(TestMessageSetContainer* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void TestMessageSetContainer::InternalSwap(TestMessageSetContainer* other) {
- using std::swap;
- swap(message_set_, other->message_set_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata TestMessageSetContainer::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void TestMessageSetExtension1::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int TestMessageSetExtension1::kIFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- TestMessageSetExtension1::TestMessageSetExtension1()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetExtension1)
- }
- TestMessageSetExtension1::TestMessageSetExtension1(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetExtension1)
- }
- TestMessageSetExtension1::TestMessageSetExtension1(const TestMessageSetExtension1& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- _has_bits_(from._has_bits_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- i_ = from.i_;
- // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetExtension1)
- }
- void TestMessageSetExtension1::SharedCtor() {
- i_ = 0;
- }
- TestMessageSetExtension1::~TestMessageSetExtension1() {
- // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetExtension1)
- SharedDtor();
- }
- void TestMessageSetExtension1::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- }
- void TestMessageSetExtension1::ArenaDtor(void* object) {
- TestMessageSetExtension1* _this = reinterpret_cast< TestMessageSetExtension1* >(object);
- (void)_this;
- }
- void TestMessageSetExtension1::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void TestMessageSetExtension1::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* TestMessageSetExtension1::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const TestMessageSetExtension1& TestMessageSetExtension1::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension1.base);
- return *internal_default_instance();
- }
- void TestMessageSetExtension1::Clear() {
- // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetExtension1)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- i_ = 0;
- _has_bits_.Clear();
- _internal_metadata_.Clear();
- }
- bool TestMessageSetExtension1::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
- #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
- // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetExtension1)
- for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
- tag = p.first;
- if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // optional int32 i = 15;
- case 15: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) {
- set_has_i();
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &i_)));
- } else {
- goto handle_unusual;
- }
- break;
- }
- default: {
- handle_unusual:
- if (tag == 0) {
- goto success;
- }
- DO_(::google::protobuf::internal::WireFormat::SkipField(
- input, tag, _internal_metadata_.mutable_unknown_fields()));
- break;
- }
- }
- }
- success:
- // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetExtension1)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetExtension1)
- return false;
- #undef DO_
- }
- void TestMessageSetExtension1::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetExtension1)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional int32 i = 15;
- if (cached_has_bits & 0x00000001u) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->i(), output);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- _internal_metadata_.unknown_fields(), output);
- }
- // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetExtension1)
- }
- ::google::protobuf::uint8* TestMessageSetExtension1::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetExtension1)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional int32 i = 15;
- if (cached_has_bits & 0x00000001u) {
- target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->i(), target);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- _internal_metadata_.unknown_fields(), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetExtension1)
- return target;
- }
- size_t TestMessageSetExtension1::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetExtension1)
- size_t total_size = 0;
- if (_internal_metadata_.have_unknown_fields()) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- _internal_metadata_.unknown_fields());
- }
- // optional int32 i = 15;
- if (has_i()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->i());
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void TestMessageSetExtension1::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetExtension1)
- GOOGLE_DCHECK_NE(&from, this);
- const TestMessageSetExtension1* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetExtension1>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetExtension1)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetExtension1)
- MergeFrom(*source);
- }
- }
- void TestMessageSetExtension1::MergeFrom(const TestMessageSetExtension1& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetExtension1)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- if (from.has_i()) {
- set_i(from.i());
- }
- }
- void TestMessageSetExtension1::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetExtension1)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void TestMessageSetExtension1::CopyFrom(const TestMessageSetExtension1& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetExtension1)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool TestMessageSetExtension1::IsInitialized() const {
- return true;
- }
- void TestMessageSetExtension1::Swap(TestMessageSetExtension1* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- TestMessageSetExtension1* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void TestMessageSetExtension1::UnsafeArenaSwap(TestMessageSetExtension1* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void TestMessageSetExtension1::InternalSwap(TestMessageSetExtension1* other) {
- using std::swap;
- swap(i_, other->i_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata TestMessageSetExtension1::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void TestMessageSetExtension2::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int TestMessageSetExtension2::kStrFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- TestMessageSetExtension2::TestMessageSetExtension2()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageSetExtension2)
- }
- TestMessageSetExtension2::TestMessageSetExtension2(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:protobuf_unittest.TestMessageSetExtension2)
- }
- TestMessageSetExtension2::TestMessageSetExtension2(const TestMessageSetExtension2& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- _has_bits_(from._has_bits_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- if (from.has_str()) {
- str_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.str(),
- GetArenaNoVirtual());
- }
- // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageSetExtension2)
- }
- void TestMessageSetExtension2::SharedCtor() {
- str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- }
- TestMessageSetExtension2::~TestMessageSetExtension2() {
- // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageSetExtension2)
- SharedDtor();
- }
- void TestMessageSetExtension2::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- }
- void TestMessageSetExtension2::ArenaDtor(void* object) {
- TestMessageSetExtension2* _this = reinterpret_cast< TestMessageSetExtension2* >(object);
- (void)_this;
- }
- void TestMessageSetExtension2::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void TestMessageSetExtension2::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* TestMessageSetExtension2::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const TestMessageSetExtension2& TestMessageSetExtension2::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_TestMessageSetExtension2.base);
- return *internal_default_instance();
- }
- void TestMessageSetExtension2::Clear() {
- // @@protoc_insertion_point(message_clear_start:protobuf_unittest.TestMessageSetExtension2)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- if (cached_has_bits & 0x00000001u) {
- str_.ClearNonDefaultToEmpty();
- }
- _has_bits_.Clear();
- _internal_metadata_.Clear();
- }
- bool TestMessageSetExtension2::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
- #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
- // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageSetExtension2)
- for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
- tag = p.first;
- if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // optional string str = 25;
- case 25: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(202u /* 202 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
- input, this->mutable_str()));
- ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
- this->str().data(), static_cast<int>(this->str().length()),
- ::google::protobuf::internal::WireFormat::PARSE,
- "protobuf_unittest.TestMessageSetExtension2.str");
- } else {
- goto handle_unusual;
- }
- break;
- }
- default: {
- handle_unusual:
- if (tag == 0) {
- goto success;
- }
- DO_(::google::protobuf::internal::WireFormat::SkipField(
- input, tag, _internal_metadata_.mutable_unknown_fields()));
- break;
- }
- }
- }
- success:
- // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageSetExtension2)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageSetExtension2)
- return false;
- #undef DO_
- }
- void TestMessageSetExtension2::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageSetExtension2)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional string str = 25;
- if (cached_has_bits & 0x00000001u) {
- ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
- this->str().data(), static_cast<int>(this->str().length()),
- ::google::protobuf::internal::WireFormat::SERIALIZE,
- "protobuf_unittest.TestMessageSetExtension2.str");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
- 25, this->str(), output);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- _internal_metadata_.unknown_fields(), output);
- }
- // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageSetExtension2)
- }
- ::google::protobuf::uint8* TestMessageSetExtension2::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageSetExtension2)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // optional string str = 25;
- if (cached_has_bits & 0x00000001u) {
- ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
- this->str().data(), static_cast<int>(this->str().length()),
- ::google::protobuf::internal::WireFormat::SERIALIZE,
- "protobuf_unittest.TestMessageSetExtension2.str");
- target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
- 25, this->str(), target);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- _internal_metadata_.unknown_fields(), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageSetExtension2)
- return target;
- }
- size_t TestMessageSetExtension2::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.TestMessageSetExtension2)
- size_t total_size = 0;
- if (_internal_metadata_.have_unknown_fields()) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- _internal_metadata_.unknown_fields());
- }
- // optional string str = 25;
- if (has_str()) {
- total_size += 2 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
- this->str());
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void TestMessageSetExtension2::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.TestMessageSetExtension2)
- GOOGLE_DCHECK_NE(&from, this);
- const TestMessageSetExtension2* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const TestMessageSetExtension2>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.TestMessageSetExtension2)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.TestMessageSetExtension2)
- MergeFrom(*source);
- }
- }
- void TestMessageSetExtension2::MergeFrom(const TestMessageSetExtension2& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.TestMessageSetExtension2)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- if (from.has_str()) {
- set_str(from.str());
- }
- }
- void TestMessageSetExtension2::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.TestMessageSetExtension2)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void TestMessageSetExtension2::CopyFrom(const TestMessageSetExtension2& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.TestMessageSetExtension2)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool TestMessageSetExtension2::IsInitialized() const {
- return true;
- }
- void TestMessageSetExtension2::Swap(TestMessageSetExtension2* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- TestMessageSetExtension2* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void TestMessageSetExtension2::UnsafeArenaSwap(TestMessageSetExtension2* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void TestMessageSetExtension2::InternalSwap(TestMessageSetExtension2* other) {
- using std::swap;
- str_.Swap(&other->str_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
- swap(_has_bits_[0], other->_has_bits_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata TestMessageSetExtension2::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void RawMessageSet_Item::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int RawMessageSet_Item::kTypeIdFieldNumber;
- const int RawMessageSet_Item::kMessageFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- RawMessageSet_Item::RawMessageSet_Item()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:protobuf_unittest.RawMessageSet.Item)
- }
- RawMessageSet_Item::RawMessageSet_Item(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:protobuf_unittest.RawMessageSet.Item)
- }
- RawMessageSet_Item::RawMessageSet_Item(const RawMessageSet_Item& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- _has_bits_(from._has_bits_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- if (from.has_message()) {
- message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message(),
- GetArenaNoVirtual());
- }
- type_id_ = from.type_id_;
- // @@protoc_insertion_point(copy_constructor:protobuf_unittest.RawMessageSet.Item)
- }
- void RawMessageSet_Item::SharedCtor() {
- message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- type_id_ = 0;
- }
- RawMessageSet_Item::~RawMessageSet_Item() {
- // @@protoc_insertion_point(destructor:protobuf_unittest.RawMessageSet.Item)
- SharedDtor();
- }
- void RawMessageSet_Item::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
- }
- void RawMessageSet_Item::ArenaDtor(void* object) {
- RawMessageSet_Item* _this = reinterpret_cast< RawMessageSet_Item* >(object);
- (void)_this;
- }
- void RawMessageSet_Item::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void RawMessageSet_Item::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* RawMessageSet_Item::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const RawMessageSet_Item& RawMessageSet_Item::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet_Item.base);
- return *internal_default_instance();
- }
- void RawMessageSet_Item::Clear() {
- // @@protoc_insertion_point(message_clear_start:protobuf_unittest.RawMessageSet.Item)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- if (cached_has_bits & 0x00000001u) {
- message_.ClearNonDefaultToEmpty();
- }
- type_id_ = 0;
- _has_bits_.Clear();
- _internal_metadata_.Clear();
- }
- bool RawMessageSet_Item::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
- #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
- // @@protoc_insertion_point(parse_start:protobuf_unittest.RawMessageSet.Item)
- for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
- tag = p.first;
- if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // required int32 type_id = 2;
- case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
- set_has_type_id();
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
- input, &type_id_)));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // required bytes message = 3;
- case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
- input, this->mutable_message()));
- } else {
- goto handle_unusual;
- }
- break;
- }
- default: {
- handle_unusual:
- if (tag == 0 ||
- ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
- input->SetLastTag(tag);
- goto success;
- }
- DO_(::google::protobuf::internal::WireFormat::SkipField(
- input, tag, _internal_metadata_.mutable_unknown_fields()));
- break;
- }
- }
- }
- success:
- // @@protoc_insertion_point(parse_success:protobuf_unittest.RawMessageSet.Item)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:protobuf_unittest.RawMessageSet.Item)
- return false;
- #undef DO_
- }
- void RawMessageSet_Item::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:protobuf_unittest.RawMessageSet.Item)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // required int32 type_id = 2;
- if (cached_has_bits & 0x00000002u) {
- ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->type_id(), output);
- }
- // required bytes message = 3;
- if (cached_has_bits & 0x00000001u) {
- ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
- 3, this->message(), output);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- _internal_metadata_.unknown_fields(), output);
- }
- // @@protoc_insertion_point(serialize_end:protobuf_unittest.RawMessageSet.Item)
- }
- ::google::protobuf::uint8* RawMessageSet_Item::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.RawMessageSet.Item)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
- // required int32 type_id = 2;
- if (cached_has_bits & 0x00000002u) {
- target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->type_id(), target);
- }
- // required bytes message = 3;
- if (cached_has_bits & 0x00000001u) {
- target =
- ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
- 3, this->message(), target);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- _internal_metadata_.unknown_fields(), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.RawMessageSet.Item)
- return target;
- }
- size_t RawMessageSet_Item::RequiredFieldsByteSizeFallback() const {
- // @@protoc_insertion_point(required_fields_byte_size_fallback_start:protobuf_unittest.RawMessageSet.Item)
- size_t total_size = 0;
- if (has_message()) {
- // required bytes message = 3;
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::BytesSize(
- this->message());
- }
- if (has_type_id()) {
- // required int32 type_id = 2;
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->type_id());
- }
- return total_size;
- }
- size_t RawMessageSet_Item::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.RawMessageSet.Item)
- size_t total_size = 0;
- if (_internal_metadata_.have_unknown_fields()) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- _internal_metadata_.unknown_fields());
- }
- if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present.
- // required bytes message = 3;
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::BytesSize(
- this->message());
- // required int32 type_id = 2;
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- this->type_id());
- } else {
- total_size += RequiredFieldsByteSizeFallback();
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void RawMessageSet_Item::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.RawMessageSet.Item)
- GOOGLE_DCHECK_NE(&from, this);
- const RawMessageSet_Item* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const RawMessageSet_Item>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.RawMessageSet.Item)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.RawMessageSet.Item)
- MergeFrom(*source);
- }
- }
- void RawMessageSet_Item::MergeFrom(const RawMessageSet_Item& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.RawMessageSet.Item)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- cached_has_bits = from._has_bits_[0];
- if (cached_has_bits & 3u) {
- if (cached_has_bits & 0x00000001u) {
- set_message(from.message());
- }
- if (cached_has_bits & 0x00000002u) {
- type_id_ = from.type_id_;
- }
- _has_bits_[0] |= cached_has_bits;
- }
- }
- void RawMessageSet_Item::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.RawMessageSet.Item)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void RawMessageSet_Item::CopyFrom(const RawMessageSet_Item& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.RawMessageSet.Item)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool RawMessageSet_Item::IsInitialized() const {
- if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
- return true;
- }
- void RawMessageSet_Item::Swap(RawMessageSet_Item* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- RawMessageSet_Item* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void RawMessageSet_Item::UnsafeArenaSwap(RawMessageSet_Item* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void RawMessageSet_Item::InternalSwap(RawMessageSet_Item* other) {
- using std::swap;
- message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
- swap(type_id_, other->type_id_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata RawMessageSet_Item::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void RawMessageSet::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int RawMessageSet::kItemFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- RawMessageSet::RawMessageSet()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:protobuf_unittest.RawMessageSet)
- }
- RawMessageSet::RawMessageSet(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena),
- item_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:protobuf_unittest.RawMessageSet)
- }
- RawMessageSet::RawMessageSet(const RawMessageSet& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- _has_bits_(from._has_bits_),
- item_(from.item_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- // @@protoc_insertion_point(copy_constructor:protobuf_unittest.RawMessageSet)
- }
- void RawMessageSet::SharedCtor() {
- }
- RawMessageSet::~RawMessageSet() {
- // @@protoc_insertion_point(destructor:protobuf_unittest.RawMessageSet)
- SharedDtor();
- }
- void RawMessageSet::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- }
- void RawMessageSet::ArenaDtor(void* object) {
- RawMessageSet* _this = reinterpret_cast< RawMessageSet* >(object);
- (void)_this;
- }
- void RawMessageSet::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void RawMessageSet::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* RawMessageSet::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const RawMessageSet& RawMessageSet::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::scc_info_RawMessageSet.base);
- return *internal_default_instance();
- }
- void RawMessageSet::Clear() {
- // @@protoc_insertion_point(message_clear_start:protobuf_unittest.RawMessageSet)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- item_.Clear();
- _has_bits_.Clear();
- _internal_metadata_.Clear();
- }
- bool RawMessageSet::MergePartialFromCodedStream(
- ::google::protobuf::io::CodedInputStream* input) {
- #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
- ::google::protobuf::uint32 tag;
- // @@protoc_insertion_point(parse_start:protobuf_unittest.RawMessageSet)
- for (;;) {
- ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
- tag = p.first;
- if (!p.second) goto handle_unusual;
- switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
- // repeated group Item = 1 { ... };
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(11u /* 11 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadGroup(1, input, add_item()));
- } else {
- goto handle_unusual;
- }
- break;
- }
- default: {
- handle_unusual:
- if (tag == 0) {
- goto success;
- }
- DO_(::google::protobuf::internal::WireFormat::SkipField(
- input, tag, _internal_metadata_.mutable_unknown_fields()));
- break;
- }
- }
- }
- success:
- // @@protoc_insertion_point(parse_success:protobuf_unittest.RawMessageSet)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:protobuf_unittest.RawMessageSet)
- return false;
- #undef DO_
- }
- void RawMessageSet::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:protobuf_unittest.RawMessageSet)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // repeated group Item = 1 { ... };
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->item_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(
- 1,
- this->item(static_cast<int>(i)),
- output);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- _internal_metadata_.unknown_fields(), output);
- }
- // @@protoc_insertion_point(serialize_end:protobuf_unittest.RawMessageSet)
- }
- ::google::protobuf::uint8* RawMessageSet::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.RawMessageSet)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // repeated group Item = 1 { ... };
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->item_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteGroupToArray(
- 1, this->item(static_cast<int>(i)), deterministic, target);
- }
- if (_internal_metadata_.have_unknown_fields()) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- _internal_metadata_.unknown_fields(), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.RawMessageSet)
- return target;
- }
- size_t RawMessageSet::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:protobuf_unittest.RawMessageSet)
- size_t total_size = 0;
- if (_internal_metadata_.have_unknown_fields()) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- _internal_metadata_.unknown_fields());
- }
- // repeated group Item = 1 { ... };
- {
- unsigned int count = static_cast<unsigned int>(this->item_size());
- total_size += 2UL * count;
- for (unsigned int i = 0; i < count; i++) {
- total_size +=
- ::google::protobuf::internal::WireFormatLite::GroupSize(
- this->item(static_cast<int>(i)));
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void RawMessageSet::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:protobuf_unittest.RawMessageSet)
- GOOGLE_DCHECK_NE(&from, this);
- const RawMessageSet* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const RawMessageSet>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:protobuf_unittest.RawMessageSet)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:protobuf_unittest.RawMessageSet)
- MergeFrom(*source);
- }
- }
- void RawMessageSet::MergeFrom(const RawMessageSet& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:protobuf_unittest.RawMessageSet)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- item_.MergeFrom(from.item_);
- }
- void RawMessageSet::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:protobuf_unittest.RawMessageSet)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void RawMessageSet::CopyFrom(const RawMessageSet& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:protobuf_unittest.RawMessageSet)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool RawMessageSet::IsInitialized() const {
- if (!::google::protobuf::internal::AllAreInitialized(this->item())) return false;
- return true;
- }
- void RawMessageSet::Swap(RawMessageSet* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- RawMessageSet* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void RawMessageSet::UnsafeArenaSwap(RawMessageSet* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void RawMessageSet::InternalSwap(RawMessageSet* other) {
- using std::swap;
- CastToBase(&item_)->InternalSwap(CastToBase(&other->item_));
- swap(_has_bits_[0], other->_has_bits_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata RawMessageSet::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fmset_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int TestMessageSetExtension1::kMessageSetExtensionFieldNumber;
- #endif
- ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
- ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension1 >, 11, false >
- TestMessageSetExtension1::message_set_extension(kMessageSetExtensionFieldNumber, *::protobuf_unittest::TestMessageSetExtension1::internal_default_instance());
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int TestMessageSetExtension2::kMessageSetExtensionFieldNumber;
- #endif
- ::google::protobuf::internal::ExtensionIdentifier< ::proto2_wireformat_unittest::TestMessageSet,
- ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::TestMessageSetExtension2 >, 11, false >
- TestMessageSetExtension2::message_set_extension(kMessageSetExtensionFieldNumber, *::protobuf_unittest::TestMessageSetExtension2::internal_default_instance());
- // @@protoc_insertion_point(namespace_scope)
- } // namespace protobuf_unittest
- namespace google {
- namespace protobuf {
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetContainer* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetContainer >(Arena* arena) {
- return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetContainer >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetExtension1* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetExtension1 >(Arena* arena) {
- return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetExtension1 >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::TestMessageSetExtension2* Arena::CreateMaybeMessage< ::protobuf_unittest::TestMessageSetExtension2 >(Arena* arena) {
- return Arena::CreateMessageInternal< ::protobuf_unittest::TestMessageSetExtension2 >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::RawMessageSet_Item* Arena::CreateMaybeMessage< ::protobuf_unittest::RawMessageSet_Item >(Arena* arena) {
- return Arena::CreateMessageInternal< ::protobuf_unittest::RawMessageSet_Item >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::protobuf_unittest::RawMessageSet* Arena::CreateMaybeMessage< ::protobuf_unittest::RawMessageSet >(Arena* arena) {
- return Arena::CreateMessageInternal< ::protobuf_unittest::RawMessageSet >(arena);
- }
- } // namespace protobuf
- } // namespace google
- // @@protoc_insertion_point(global_scope)
|