12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460 |
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: google/protobuf/struct.proto
- #include <google/protobuf/struct.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_2fstruct_2eproto {
- extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fstruct_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue;
- } // namespace protobuf_google_2fprotobuf_2fstruct_2eproto
- namespace google {
- namespace protobuf {
- class Struct_FieldsEntry_DoNotUseDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<Struct_FieldsEntry_DoNotUse>
- _instance;
- } _Struct_FieldsEntry_DoNotUse_default_instance_;
- class StructDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<Struct>
- _instance;
- } _Struct_default_instance_;
- class ValueDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<Value>
- _instance;
- int null_value_;
- double number_value_;
- ::google::protobuf::internal::ArenaStringPtr string_value_;
- bool bool_value_;
- const ::google::protobuf::Struct* struct_value_;
- const ::google::protobuf::ListValue* list_value_;
- } _Value_default_instance_;
- class ListValueDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<ListValue>
- _instance;
- } _ListValue_default_instance_;
- } // namespace protobuf
- } // namespace google
- namespace protobuf_google_2fprotobuf_2fstruct_2eproto {
- static void InitDefaultsListValue() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_;
- new (ptr) ::google::protobuf::Struct_FieldsEntry_DoNotUse();
- }
- {
- void* ptr = &::google::protobuf::_Struct_default_instance_;
- new (ptr) ::google::protobuf::Struct();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- {
- void* ptr = &::google::protobuf::_Value_default_instance_;
- new (ptr) ::google::protobuf::Value();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- {
- void* ptr = &::google::protobuf::_ListValue_default_instance_;
- new (ptr) ::google::protobuf::ListValue();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::google::protobuf::Struct_FieldsEntry_DoNotUse::InitAsDefaultInstance();
- ::google::protobuf::Struct::InitAsDefaultInstance();
- ::google::protobuf::Value::InitAsDefaultInstance();
- ::google::protobuf::ListValue::InitAsDefaultInstance();
- }
- LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsListValue}, {}};
- void InitDefaults() {
- ::google::protobuf::internal::InitSCC(&scc_info_ListValue.base);
- }
- ::google::protobuf::Metadata file_level_metadata[4];
- const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
- const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _has_bits_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, key_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, value_),
- 0,
- 1,
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, fields_),
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _internal_metadata_),
- ~0u, // no _extensions_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _oneof_case_[0]),
- ~0u, // no _weak_field_map_
- offsetof(::google::protobuf::ValueDefaultTypeInternal, null_value_),
- offsetof(::google::protobuf::ValueDefaultTypeInternal, number_value_),
- offsetof(::google::protobuf::ValueDefaultTypeInternal, string_value_),
- offsetof(::google::protobuf::ValueDefaultTypeInternal, bool_value_),
- offsetof(::google::protobuf::ValueDefaultTypeInternal, struct_value_),
- offsetof(::google::protobuf::ValueDefaultTypeInternal, list_value_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, kind_),
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, values_),
- };
- static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- { 0, 7, sizeof(::google::protobuf::Struct_FieldsEntry_DoNotUse)},
- { 9, -1, sizeof(::google::protobuf::Struct)},
- { 15, -1, sizeof(::google::protobuf::Value)},
- { 27, -1, sizeof(::google::protobuf::ListValue)},
- };
- static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Value_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_ListValue_default_instance_),
- };
- void protobuf_AssignDescriptors() {
- AddDescriptors();
- AssignDescriptors(
- "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets,
- file_level_metadata, file_level_enum_descriptors, 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, 4);
- }
- void AddDescriptorsImpl() {
- InitDefaults();
- static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- "\n\034google/protobuf/struct.proto\022\017google.p"
- "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
- "gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
- "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
- "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
- "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
- "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
- "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
- "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
- "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
- "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
- "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
- "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro"
- "tobufB\013StructProtoP\001Z1github.com/golang/"
- "protobuf/ptypes/struct;structpb\370\001\001\242\002\003GPB"
- "\252\002\036Google.Protobuf.WellKnownTypesb\006proto"
- "3"
- };
- ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
- descriptor, 641);
- ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
- "google/protobuf/struct.proto", &protobuf_RegisterTypes);
- }
- 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_2fstruct_2eproto
- namespace google {
- namespace protobuf {
- const ::google::protobuf::EnumDescriptor* NullValue_descriptor() {
- protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_enum_descriptors[0];
- }
- bool NullValue_IsValid(int value) {
- switch (value) {
- case 0:
- return true;
- default:
- return false;
- }
- }
- // ===================================================================
- Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse() {}
- Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
- void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& other) {
- MergeFromInternal(other);
- }
- ::google::protobuf::Metadata Struct_FieldsEntry_DoNotUse::GetMetadata() const {
- ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0];
- }
- void Struct_FieldsEntry_DoNotUse::MergeFrom(
- const ::google::protobuf::Message& other) {
- ::google::protobuf::Message::MergeFrom(other);
- }
- // ===================================================================
- void Struct::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int Struct::kFieldsFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- Struct::Struct()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:google.protobuf.Struct)
- }
- Struct::Struct(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena),
- fields_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct)
- }
- Struct::Struct(const Struct& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- fields_.MergeFrom(from.fields_);
- // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct)
- }
- void Struct::SharedCtor() {
- }
- Struct::~Struct() {
- // @@protoc_insertion_point(destructor:google.protobuf.Struct)
- SharedDtor();
- }
- void Struct::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- }
- void Struct::ArenaDtor(void* object) {
- Struct* _this = reinterpret_cast< Struct* >(object);
- (void)_this;
- }
- void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void Struct::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* Struct::descriptor() {
- ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const Struct& Struct::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- return *internal_default_instance();
- }
- void Struct::Clear() {
- // @@protoc_insertion_point(message_clear_start:google.protobuf.Struct)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- fields_.Clear();
- _internal_metadata_.Clear();
- }
- bool Struct::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:google.protobuf.Struct)
- 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)) {
- // map<string, .google.protobuf.Value> fields = 1;
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
- Struct_FieldsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
- Struct_FieldsEntry_DoNotUse,
- ::std::string, ::google::protobuf::Value,
- ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
- ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
- 0 >,
- ::google::protobuf::Map< ::std::string, ::google::protobuf::Value > > parser(&fields_);
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
- input, &parser));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- parser.key().data(), static_cast<int>(parser.key().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
- "google.protobuf.Struct.FieldsEntry.key"));
- } 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:google.protobuf.Struct)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:google.protobuf.Struct)
- return false;
- #undef DO_
- }
- void Struct::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:google.protobuf.Struct)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // map<string, .google.protobuf.Value> fields = 1;
- if (!this->fields().empty()) {
- typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
- ConstPtr;
- typedef ConstPtr SortItem;
- typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
- struct Utf8Check {
- static void Check(ConstPtr p) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- p->first.data(), static_cast<int>(p->first.length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
- "google.protobuf.Struct.FieldsEntry.key");
- }
- };
- if (output->IsSerializationDeterministic() &&
- this->fields().size() > 1) {
- ::std::unique_ptr<SortItem[]> items(
- new SortItem[this->fields().size()]);
- typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
- size_type n = 0;
- for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
- it = this->fields().begin();
- it != this->fields().end(); ++it, ++n) {
- items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
- }
- ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
- ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
- for (size_type i = 0; i < n; i++) {
- entry.reset(fields_.NewEntryWrapper(
- items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 1, *entry, output);
- if (entry->GetArena() != NULL) {
- entry.release();
- }
- Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
- }
- } else {
- ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
- for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
- it = this->fields().begin();
- it != this->fields().end(); ++it) {
- entry.reset(fields_.NewEntryWrapper(
- it->first, it->second));
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 1, *entry, output);
- if (entry->GetArena() != NULL) {
- entry.release();
- }
- Utf8Check::Check(&*it);
- }
- }
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
- }
- // @@protoc_insertion_point(serialize_end:google.protobuf.Struct)
- }
- ::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // map<string, .google.protobuf.Value> fields = 1;
- if (!this->fields().empty()) {
- typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
- ConstPtr;
- typedef ConstPtr SortItem;
- typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
- struct Utf8Check {
- static void Check(ConstPtr p) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- p->first.data(), static_cast<int>(p->first.length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
- "google.protobuf.Struct.FieldsEntry.key");
- }
- };
- if (deterministic &&
- this->fields().size() > 1) {
- ::std::unique_ptr<SortItem[]> items(
- new SortItem[this->fields().size()]);
- typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
- size_type n = 0;
- for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
- it = this->fields().begin();
- it != this->fields().end(); ++it, ++n) {
- items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
- }
- ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
- ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
- for (size_type i = 0; i < n; i++) {
- entry.reset(fields_.NewEntryWrapper(
- items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageNoVirtualToArray(
- 1, *entry, deterministic, target);
- ;
- if (entry->GetArena() != NULL) {
- entry.release();
- }
- Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
- }
- } else {
- ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
- for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
- it = this->fields().begin();
- it != this->fields().end(); ++it) {
- entry.reset(fields_.NewEntryWrapper(
- it->first, it->second));
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageNoVirtualToArray(
- 1, *entry, deterministic, target);
- ;
- if (entry->GetArena() != NULL) {
- entry.release();
- }
- Utf8Check::Check(&*it);
- }
- }
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct)
- return target;
- }
- size_t Struct::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Struct)
- size_t total_size = 0;
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
- }
- // map<string, .google.protobuf.Value> fields = 1;
- total_size += 1 *
- ::google::protobuf::internal::FromIntSize(this->fields_size());
- {
- ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
- for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
- it = this->fields().begin();
- it != this->fields().end(); ++it) {
- if (entry.get() != NULL && entry->GetArena() != NULL) {
- entry.release();
- }
- entry.reset(fields_.NewEntryWrapper(it->first, it->second));
- total_size += ::google::protobuf::internal::WireFormatLite::
- MessageSizeNoVirtual(*entry);
- }
- if (entry.get() != NULL && entry->GetArena() != NULL) {
- entry.release();
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void Struct::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Struct)
- GOOGLE_DCHECK_NE(&from, this);
- const Struct* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const Struct>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Struct)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Struct)
- MergeFrom(*source);
- }
- }
- void Struct::MergeFrom(const Struct& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Struct)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- fields_.MergeFrom(from.fields_);
- }
- void Struct::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Struct)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void Struct::CopyFrom(const Struct& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Struct)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool Struct::IsInitialized() const {
- return true;
- }
- void Struct::Swap(Struct* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- Struct* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void Struct::UnsafeArenaSwap(Struct* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void Struct::InternalSwap(Struct* other) {
- using std::swap;
- fields_.Swap(&other->fields_);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata Struct::GetMetadata() const {
- protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void Value::InitAsDefaultInstance() {
- ::google::protobuf::_Value_default_instance_.null_value_ = 0;
- ::google::protobuf::_Value_default_instance_.number_value_ = 0;
- ::google::protobuf::_Value_default_instance_.string_value_.UnsafeSetDefault(
- &::google::protobuf::internal::GetEmptyStringAlreadyInited());
- ::google::protobuf::_Value_default_instance_.bool_value_ = false;
- ::google::protobuf::_Value_default_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>(
- ::google::protobuf::Struct::internal_default_instance());
- ::google::protobuf::_Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>(
- ::google::protobuf::ListValue::internal_default_instance());
- }
- void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
- clear_kind();
- if (struct_value) {
- ::google::protobuf::Arena* submessage_arena =
- ::google::protobuf::Arena::GetArena(struct_value);
- if (message_arena != submessage_arena) {
- struct_value = ::google::protobuf::internal::GetOwnedMessage(
- message_arena, struct_value, submessage_arena);
- }
- set_has_struct_value();
- kind_.struct_value_ = struct_value;
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value)
- }
- void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) {
- ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
- clear_kind();
- if (list_value) {
- ::google::protobuf::Arena* submessage_arena =
- ::google::protobuf::Arena::GetArena(list_value);
- if (message_arena != submessage_arena) {
- list_value = ::google::protobuf::internal::GetOwnedMessage(
- message_arena, list_value, submessage_arena);
- }
- set_has_list_value();
- kind_.list_value_ = list_value;
- }
- // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value)
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int Value::kNullValueFieldNumber;
- const int Value::kNumberValueFieldNumber;
- const int Value::kStringValueFieldNumber;
- const int Value::kBoolValueFieldNumber;
- const int Value::kStructValueFieldNumber;
- const int Value::kListValueFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- Value::Value()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:google.protobuf.Value)
- }
- Value::Value(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:google.protobuf.Value)
- }
- Value::Value(const Value& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- clear_has_kind();
- switch (from.kind_case()) {
- case kNullValue: {
- set_null_value(from.null_value());
- break;
- }
- case kNumberValue: {
- set_number_value(from.number_value());
- break;
- }
- case kStringValue: {
- set_string_value(from.string_value());
- break;
- }
- case kBoolValue: {
- set_bool_value(from.bool_value());
- break;
- }
- case kStructValue: {
- mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
- break;
- }
- case kListValue: {
- mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
- break;
- }
- case KIND_NOT_SET: {
- break;
- }
- }
- // @@protoc_insertion_point(copy_constructor:google.protobuf.Value)
- }
- void Value::SharedCtor() {
- clear_has_kind();
- }
- Value::~Value() {
- // @@protoc_insertion_point(destructor:google.protobuf.Value)
- SharedDtor();
- }
- void Value::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- if (has_kind()) {
- clear_kind();
- }
- }
- void Value::ArenaDtor(void* object) {
- Value* _this = reinterpret_cast< Value* >(object);
- (void)_this;
- }
- void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void Value::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* Value::descriptor() {
- ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const Value& Value::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- return *internal_default_instance();
- }
- void Value::clear_kind() {
- // @@protoc_insertion_point(one_of_clear_start:google.protobuf.Value)
- switch (kind_case()) {
- case kNullValue: {
- // No need to clear
- break;
- }
- case kNumberValue: {
- // No need to clear
- break;
- }
- case kStringValue: {
- kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
- GetArenaNoVirtual());
- break;
- }
- case kBoolValue: {
- // No need to clear
- break;
- }
- case kStructValue: {
- if (GetArenaNoVirtual() == NULL) {
- delete kind_.struct_value_;
- }
- break;
- }
- case kListValue: {
- if (GetArenaNoVirtual() == NULL) {
- delete kind_.list_value_;
- }
- break;
- }
- case KIND_NOT_SET: {
- break;
- }
- }
- _oneof_case_[0] = KIND_NOT_SET;
- }
- void Value::Clear() {
- // @@protoc_insertion_point(message_clear_start:google.protobuf.Value)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- clear_kind();
- _internal_metadata_.Clear();
- }
- bool Value::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:google.protobuf.Value)
- 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)) {
- // .google.protobuf.NullValue null_value = 1;
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_null_value(static_cast< ::google::protobuf::NullValue >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // double number_value = 2;
- case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) {
- clear_kind();
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
- input, &kind_.number_value_)));
- set_has_number_value();
- } else {
- goto handle_unusual;
- }
- break;
- }
- // string string_value = 3;
- case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadString(
- input, this->mutable_string_value()));
- DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- this->string_value().data(), static_cast<int>(this->string_value().length()),
- ::google::protobuf::internal::WireFormatLite::PARSE,
- "google.protobuf.Value.string_value"));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // bool bool_value = 4;
- case 4: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
- clear_kind();
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
- input, &kind_.bool_value_)));
- set_has_bool_value();
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .google.protobuf.Struct struct_value = 5;
- case 5: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
- input, mutable_struct_value()));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .google.protobuf.ListValue list_value = 6;
- case 6: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
- DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
- input, mutable_list_value()));
- } 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:google.protobuf.Value)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:google.protobuf.Value)
- return false;
- #undef DO_
- }
- void Value::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:google.protobuf.Value)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .google.protobuf.NullValue null_value = 1;
- if (has_null_value()) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 1, this->null_value(), output);
- }
- // double number_value = 2;
- if (has_number_value()) {
- ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output);
- }
- // string string_value = 3;
- if (has_string_value()) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- this->string_value().data(), static_cast<int>(this->string_value().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
- "google.protobuf.Value.string_value");
- ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
- 3, this->string_value(), output);
- }
- // bool bool_value = 4;
- if (has_bool_value()) {
- ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output);
- }
- // .google.protobuf.Struct struct_value = 5;
- if (has_struct_value()) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 5, this->_internal_struct_value(), output);
- }
- // .google.protobuf.ListValue list_value = 6;
- if (has_list_value()) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 6, this->_internal_list_value(), output);
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
- }
- // @@protoc_insertion_point(serialize_end:google.protobuf.Value)
- }
- ::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .google.protobuf.NullValue null_value = 1;
- if (has_null_value()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 1, this->null_value(), target);
- }
- // double number_value = 2;
- if (has_number_value()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target);
- }
- // string string_value = 3;
- if (has_string_value()) {
- ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
- this->string_value().data(), static_cast<int>(this->string_value().length()),
- ::google::protobuf::internal::WireFormatLite::SERIALIZE,
- "google.protobuf.Value.string_value");
- target =
- ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
- 3, this->string_value(), target);
- }
- // bool bool_value = 4;
- if (has_bool_value()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target);
- }
- // .google.protobuf.Struct struct_value = 5;
- if (has_struct_value()) {
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageToArray(
- 5, this->_internal_struct_value(), deterministic, target);
- }
- // .google.protobuf.ListValue list_value = 6;
- if (has_list_value()) {
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageToArray(
- 6, this->_internal_list_value(), deterministic, target);
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value)
- return target;
- }
- size_t Value::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Value)
- size_t total_size = 0;
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
- }
- switch (kind_case()) {
- // .google.protobuf.NullValue null_value = 1;
- case kNullValue: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value());
- break;
- }
- // double number_value = 2;
- case kNumberValue: {
- total_size += 1 + 8;
- break;
- }
- // string string_value = 3;
- case kStringValue: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::StringSize(
- this->string_value());
- break;
- }
- // bool bool_value = 4;
- case kBoolValue: {
- total_size += 1 + 1;
- break;
- }
- // .google.protobuf.Struct struct_value = 5;
- case kStructValue: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSize(
- *kind_.struct_value_);
- break;
- }
- // .google.protobuf.ListValue list_value = 6;
- case kListValue: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::MessageSize(
- *kind_.list_value_);
- break;
- }
- case KIND_NOT_SET: {
- break;
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void Value::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Value)
- GOOGLE_DCHECK_NE(&from, this);
- const Value* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const Value>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Value)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Value)
- MergeFrom(*source);
- }
- }
- void Value::MergeFrom(const Value& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Value)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- switch (from.kind_case()) {
- case kNullValue: {
- set_null_value(from.null_value());
- break;
- }
- case kNumberValue: {
- set_number_value(from.number_value());
- break;
- }
- case kStringValue: {
- set_string_value(from.string_value());
- break;
- }
- case kBoolValue: {
- set_bool_value(from.bool_value());
- break;
- }
- case kStructValue: {
- mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
- break;
- }
- case kListValue: {
- mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
- break;
- }
- case KIND_NOT_SET: {
- break;
- }
- }
- }
- void Value::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Value)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void Value::CopyFrom(const Value& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Value)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool Value::IsInitialized() const {
- return true;
- }
- void Value::Swap(Value* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- Value* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void Value::UnsafeArenaSwap(Value* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void Value::InternalSwap(Value* other) {
- using std::swap;
- swap(kind_, other->kind_);
- swap(_oneof_case_[0], other->_oneof_case_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata Value::GetMetadata() const {
- protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void ListValue::InitAsDefaultInstance() {
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int ListValue::kValuesFieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- ListValue::ListValue()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:google.protobuf.ListValue)
- }
- ListValue::ListValue(::google::protobuf::Arena* arena)
- : ::google::protobuf::Message(),
- _internal_metadata_(arena),
- values_(arena) {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- SharedCtor();
- RegisterArenaDtor(arena);
- // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue)
- }
- ListValue::ListValue(const ListValue& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- values_(from.values_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue)
- }
- void ListValue::SharedCtor() {
- }
- ListValue::~ListValue() {
- // @@protoc_insertion_point(destructor:google.protobuf.ListValue)
- SharedDtor();
- }
- void ListValue::SharedDtor() {
- GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
- }
- void ListValue::ArenaDtor(void* object) {
- ListValue* _this = reinterpret_cast< ListValue* >(object);
- (void)_this;
- }
- void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
- }
- void ListValue::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* ListValue::descriptor() {
- ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const ListValue& ListValue::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
- return *internal_default_instance();
- }
- void ListValue::Clear() {
- // @@protoc_insertion_point(message_clear_start:google.protobuf.ListValue)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- values_.Clear();
- _internal_metadata_.Clear();
- }
- bool ListValue::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:google.protobuf.ListValue)
- 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 .google.protobuf.Value values = 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, add_values()));
- } 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:google.protobuf.ListValue)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue)
- return false;
- #undef DO_
- }
- void ListValue::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // repeated .google.protobuf.Value values = 1;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
- 1,
- this->values(static_cast<int>(i)),
- output);
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
- }
- // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue)
- }
- ::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // repeated .google.protobuf.Value values = 1;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
- target = ::google::protobuf::internal::WireFormatLite::
- InternalWriteMessageToArray(
- 1, this->values(static_cast<int>(i)), deterministic, target);
- }
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
- }
- // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue)
- return target;
- }
- size_t ListValue::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:google.protobuf.ListValue)
- size_t total_size = 0;
- if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
- total_size +=
- ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
- (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
- }
- // repeated .google.protobuf.Value values = 1;
- {
- unsigned int count = static_cast<unsigned int>(this->values_size());
- total_size += 1UL * count;
- for (unsigned int i = 0; i < count; i++) {
- total_size +=
- ::google::protobuf::internal::WireFormatLite::MessageSize(
- this->values(static_cast<int>(i)));
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void ListValue::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ListValue)
- GOOGLE_DCHECK_NE(&from, this);
- const ListValue* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ListValue)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ListValue)
- MergeFrom(*source);
- }
- }
- void ListValue::MergeFrom(const ListValue& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ListValue)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- values_.MergeFrom(from.values_);
- }
- void ListValue::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ListValue)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void ListValue::CopyFrom(const ListValue& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ListValue)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool ListValue::IsInitialized() const {
- return true;
- }
- void ListValue::Swap(ListValue* other) {
- if (other == this) return;
- if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
- InternalSwap(other);
- } else {
- ListValue* temp = New(GetArenaNoVirtual());
- temp->MergeFrom(*other);
- other->CopyFrom(*this);
- InternalSwap(temp);
- if (GetArenaNoVirtual() == NULL) {
- delete temp;
- }
- }
- }
- void ListValue::UnsafeArenaSwap(ListValue* other) {
- if (other == this) return;
- GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
- InternalSwap(other);
- }
- void ListValue::InternalSwap(ListValue* other) {
- using std::swap;
- CastToBase(&values_)->InternalSwap(CastToBase(&other->values_));
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata ListValue::GetMetadata() const {
- protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // @@protoc_insertion_point(namespace_scope)
- } // namespace protobuf
- } // namespace google
- namespace google {
- namespace protobuf {
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(Arena* arena) {
- return Arena::CreateMessageInternal< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct* Arena::CreateMaybeMessage< ::google::protobuf::Struct >(Arena* arena) {
- return Arena::CreateMessageInternal< ::google::protobuf::Struct >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Value* Arena::CreateMaybeMessage< ::google::protobuf::Value >(Arena* arena) {
- return Arena::CreateMessageInternal< ::google::protobuf::Value >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::ListValue* Arena::CreateMaybeMessage< ::google::protobuf::ListValue >(Arena* arena) {
- return Arena::CreateMessageInternal< ::google::protobuf::ListValue >(arena);
- }
- } // namespace protobuf
- } // namespace google
- // @@protoc_insertion_point(global_scope)
|