| // Generated by the protocol buffer compiler. DO NOT EDIT! |
| // source: feature_extractor.proto |
| |
| #include "feature_extractor.pb.h" |
| |
| #include <algorithm> |
| |
| #include <google/protobuf/io/coded_stream.h> |
| #include <google/protobuf/extension_set.h> |
| #include <google/protobuf/wire_format_lite.h> |
| #include <google/protobuf/io/zero_copy_stream_impl_lite.h> |
| // @@protoc_insertion_point(includes) |
| #include <google/protobuf/port_def.inc> |
| extern PROTOBUF_INTERNAL_EXPORT_feature_5fextractor_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto; |
| extern PROTOBUF_INTERNAL_EXPORT_feature_5fextractor_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Parameter_feature_5fextractor_2eproto; |
| namespace chrome_lang_id { |
| class ParameterDefaultTypeInternal { |
| public: |
| ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Parameter> _instance; |
| } _Parameter_default_instance_; |
| class FeatureFunctionDescriptorDefaultTypeInternal { |
| public: |
| ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<FeatureFunctionDescriptor> _instance; |
| } _FeatureFunctionDescriptor_default_instance_; |
| class FeatureExtractorDescriptorDefaultTypeInternal { |
| public: |
| ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<FeatureExtractorDescriptor> _instance; |
| } _FeatureExtractorDescriptor_default_instance_; |
| } // namespace chrome_lang_id |
| static void InitDefaultsscc_info_FeatureExtractorDescriptor_feature_5fextractor_2eproto() { |
| GOOGLE_PROTOBUF_VERIFY_VERSION; |
| |
| { |
| void* ptr = &::chrome_lang_id::_FeatureExtractorDescriptor_default_instance_; |
| new (ptr) ::chrome_lang_id::FeatureExtractorDescriptor(); |
| ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
| } |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FeatureExtractorDescriptor_feature_5fextractor_2eproto = |
| {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_FeatureExtractorDescriptor_feature_5fextractor_2eproto}, { |
| &scc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto.base,}}; |
| |
| static void InitDefaultsscc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto() { |
| GOOGLE_PROTOBUF_VERIFY_VERSION; |
| |
| { |
| void* ptr = &::chrome_lang_id::_FeatureFunctionDescriptor_default_instance_; |
| new (ptr) ::chrome_lang_id::FeatureFunctionDescriptor(); |
| ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
| } |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto = |
| {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto}, { |
| &scc_info_Parameter_feature_5fextractor_2eproto.base,}}; |
| |
| static void InitDefaultsscc_info_Parameter_feature_5fextractor_2eproto() { |
| GOOGLE_PROTOBUF_VERIFY_VERSION; |
| |
| { |
| void* ptr = &::chrome_lang_id::_Parameter_default_instance_; |
| new (ptr) ::chrome_lang_id::Parameter(); |
| ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
| } |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Parameter_feature_5fextractor_2eproto = |
| {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Parameter_feature_5fextractor_2eproto}, {}}; |
| |
| namespace chrome_lang_id { |
| |
| // =================================================================== |
| |
| class Parameter::_Internal { |
| public: |
| using HasBits = decltype(std::declval<Parameter>()._has_bits_); |
| static void set_has_name(HasBits* has_bits) { |
| (*has_bits)[0] |= 1u; |
| } |
| static void set_has_value(HasBits* has_bits) { |
| (*has_bits)[0] |= 2u; |
| } |
| }; |
| |
| Parameter::Parameter(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) { |
| SharedCtor(); |
| RegisterArenaDtor(arena); |
| // @@protoc_insertion_point(arena_constructor:chrome_lang_id.Parameter) |
| } |
| Parameter::Parameter(const Parameter& from) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(), |
| _has_bits_(from._has_bits_) { |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| if (from._internal_has_name()) { |
| name_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), |
| GetArena()); |
| } |
| value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| if (from._internal_has_value()) { |
| value_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_value(), |
| GetArena()); |
| } |
| // @@protoc_insertion_point(copy_constructor:chrome_lang_id.Parameter) |
| } |
| |
| void Parameter::SharedCtor() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Parameter_feature_5fextractor_2eproto.base); |
| name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| } |
| |
| Parameter::~Parameter() { |
| // @@protoc_insertion_point(destructor:chrome_lang_id.Parameter) |
| SharedDtor(); |
| _internal_metadata_.Delete<std::string>(); |
| } |
| |
| void Parameter::SharedDtor() { |
| GOOGLE_DCHECK(GetArena() == nullptr); |
| name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| } |
| |
| void Parameter::ArenaDtor(void* object) { |
| Parameter* _this = reinterpret_cast< Parameter* >(object); |
| (void)_this; |
| } |
| void Parameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
| } |
| void Parameter::SetCachedSize(int size) const { |
| _cached_size_.Set(size); |
| } |
| const Parameter& Parameter::default_instance() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Parameter_feature_5fextractor_2eproto.base); |
| return *internal_default_instance(); |
| } |
| |
| |
| void Parameter::Clear() { |
| // @@protoc_insertion_point(message_clear_start:chrome_lang_id.Parameter) |
| ::PROTOBUF_NAMESPACE_ID::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 & 0x00000003u) { |
| if (cached_has_bits & 0x00000001u) { |
| name_.ClearNonDefaultToEmpty(); |
| } |
| if (cached_has_bits & 0x00000002u) { |
| value_.ClearNonDefaultToEmpty(); |
| } |
| } |
| _has_bits_.Clear(); |
| _internal_metadata_.Clear<std::string>(); |
| } |
| |
| const char* Parameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
| #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
| _Internal::HasBits has_bits{}; |
| while (!ctx->Done(&ptr)) { |
| ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
| CHK_(ptr); |
| switch (tag >> 3) { |
| // optional string name = 1; |
| case 1: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
| auto str = _internal_mutable_name(); |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); |
| CHK_(ptr); |
| } else goto handle_unusual; |
| continue; |
| // optional string value = 2; |
| case 2: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
| auto str = _internal_mutable_value(); |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); |
| CHK_(ptr); |
| } else goto handle_unusual; |
| continue; |
| default: { |
| handle_unusual: |
| if ((tag & 7) == 4 || tag == 0) { |
| ctx->SetLastTag(tag); |
| goto success; |
| } |
| ptr = UnknownFieldParse(tag, |
| _internal_metadata_.mutable_unknown_fields<std::string>(), |
| ptr, ctx); |
| CHK_(ptr != nullptr); |
| continue; |
| } |
| } // switch |
| } // while |
| success: |
| _has_bits_.Or(has_bits); |
| return ptr; |
| failure: |
| ptr = nullptr; |
| goto success; |
| #undef CHK_ |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::uint8* Parameter::_InternalSerialize( |
| ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
| // @@protoc_insertion_point(serialize_to_array_start:chrome_lang_id.Parameter) |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| cached_has_bits = _has_bits_[0]; |
| // optional string name = 1; |
| if (cached_has_bits & 0x00000001u) { |
| target = stream->WriteStringMaybeAliased( |
| 1, this->_internal_name(), target); |
| } |
| |
| // optional string value = 2; |
| if (cached_has_bits & 0x00000002u) { |
| target = stream->WriteStringMaybeAliased( |
| 2, this->_internal_value(), target); |
| } |
| |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), |
| static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); |
| } |
| // @@protoc_insertion_point(serialize_to_array_end:chrome_lang_id.Parameter) |
| return target; |
| } |
| |
| size_t Parameter::ByteSizeLong() const { |
| // @@protoc_insertion_point(message_byte_size_start:chrome_lang_id.Parameter) |
| size_t total_size = 0; |
| |
| ::PROTOBUF_NAMESPACE_ID::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 & 0x00000003u) { |
| // optional string name = 1; |
| if (cached_has_bits & 0x00000001u) { |
| total_size += 1 + |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
| this->_internal_name()); |
| } |
| |
| // optional string value = 2; |
| if (cached_has_bits & 0x00000002u) { |
| total_size += 1 + |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
| this->_internal_value()); |
| } |
| |
| } |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); |
| } |
| int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
| SetCachedSize(cached_size); |
| return total_size; |
| } |
| |
| void Parameter::CheckTypeAndMergeFrom( |
| const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { |
| MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Parameter*>( |
| &from)); |
| } |
| |
| void Parameter::MergeFrom(const Parameter& from) { |
| // @@protoc_insertion_point(class_specific_merge_from_start:chrome_lang_id.Parameter) |
| GOOGLE_DCHECK_NE(&from, this); |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| cached_has_bits = from._has_bits_[0]; |
| if (cached_has_bits & 0x00000003u) { |
| if (cached_has_bits & 0x00000001u) { |
| _internal_set_name(from._internal_name()); |
| } |
| if (cached_has_bits & 0x00000002u) { |
| _internal_set_value(from._internal_value()); |
| } |
| } |
| } |
| |
| void Parameter::CopyFrom(const Parameter& from) { |
| // @@protoc_insertion_point(class_specific_copy_from_start:chrome_lang_id.Parameter) |
| if (&from == this) return; |
| Clear(); |
| MergeFrom(from); |
| } |
| |
| bool Parameter::IsInitialized() const { |
| return true; |
| } |
| |
| void Parameter::InternalSwap(Parameter* other) { |
| using std::swap; |
| _internal_metadata_.Swap<std::string>(&other->_internal_metadata_); |
| swap(_has_bits_[0], other->_has_bits_[0]); |
| name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); |
| value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); |
| } |
| |
| std::string Parameter::GetTypeName() const { |
| return "chrome_lang_id.Parameter"; |
| } |
| |
| |
| // =================================================================== |
| |
| class FeatureFunctionDescriptor::_Internal { |
| public: |
| using HasBits = decltype(std::declval<FeatureFunctionDescriptor>()._has_bits_); |
| static void set_has_type(HasBits* has_bits) { |
| (*has_bits)[0] |= 1u; |
| } |
| static void set_has_name(HasBits* has_bits) { |
| (*has_bits)[0] |= 2u; |
| } |
| static void set_has_argument(HasBits* has_bits) { |
| (*has_bits)[0] |= 4u; |
| } |
| static bool MissingRequiredFields(const HasBits& has_bits) { |
| return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0; |
| } |
| }; |
| |
| FeatureFunctionDescriptor::FeatureFunctionDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena), |
| parameter_(arena), |
| feature_(arena) { |
| SharedCtor(); |
| RegisterArenaDtor(arena); |
| // @@protoc_insertion_point(arena_constructor:chrome_lang_id.FeatureFunctionDescriptor) |
| } |
| FeatureFunctionDescriptor::FeatureFunctionDescriptor(const FeatureFunctionDescriptor& from) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(), |
| _has_bits_(from._has_bits_), |
| parameter_(from.parameter_), |
| feature_(from.feature_) { |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| if (from._internal_has_type()) { |
| type_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_type(), |
| GetArena()); |
| } |
| name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| if (from._internal_has_name()) { |
| name_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), |
| GetArena()); |
| } |
| argument_ = from.argument_; |
| // @@protoc_insertion_point(copy_constructor:chrome_lang_id.FeatureFunctionDescriptor) |
| } |
| |
| void FeatureFunctionDescriptor::SharedCtor() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto.base); |
| type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| argument_ = 0; |
| } |
| |
| FeatureFunctionDescriptor::~FeatureFunctionDescriptor() { |
| // @@protoc_insertion_point(destructor:chrome_lang_id.FeatureFunctionDescriptor) |
| SharedDtor(); |
| _internal_metadata_.Delete<std::string>(); |
| } |
| |
| void FeatureFunctionDescriptor::SharedDtor() { |
| GOOGLE_DCHECK(GetArena() == nullptr); |
| type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
| } |
| |
| void FeatureFunctionDescriptor::ArenaDtor(void* object) { |
| FeatureFunctionDescriptor* _this = reinterpret_cast< FeatureFunctionDescriptor* >(object); |
| (void)_this; |
| } |
| void FeatureFunctionDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
| } |
| void FeatureFunctionDescriptor::SetCachedSize(int size) const { |
| _cached_size_.Set(size); |
| } |
| const FeatureFunctionDescriptor& FeatureFunctionDescriptor::default_instance() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FeatureFunctionDescriptor_feature_5fextractor_2eproto.base); |
| return *internal_default_instance(); |
| } |
| |
| |
| void FeatureFunctionDescriptor::Clear() { |
| // @@protoc_insertion_point(message_clear_start:chrome_lang_id.FeatureFunctionDescriptor) |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| // Prevent compiler warnings about cached_has_bits being unused |
| (void) cached_has_bits; |
| |
| parameter_.Clear(); |
| feature_.Clear(); |
| cached_has_bits = _has_bits_[0]; |
| if (cached_has_bits & 0x00000003u) { |
| if (cached_has_bits & 0x00000001u) { |
| type_.ClearNonDefaultToEmpty(); |
| } |
| if (cached_has_bits & 0x00000002u) { |
| name_.ClearNonDefaultToEmpty(); |
| } |
| } |
| argument_ = 0; |
| _has_bits_.Clear(); |
| _internal_metadata_.Clear<std::string>(); |
| } |
| |
| const char* FeatureFunctionDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
| #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
| _Internal::HasBits has_bits{}; |
| while (!ctx->Done(&ptr)) { |
| ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
| CHK_(ptr); |
| switch (tag >> 3) { |
| // required string type = 1; |
| case 1: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
| auto str = _internal_mutable_type(); |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); |
| CHK_(ptr); |
| } else goto handle_unusual; |
| continue; |
| // optional string name = 2; |
| case 2: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
| auto str = _internal_mutable_name(); |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); |
| CHK_(ptr); |
| } else goto handle_unusual; |
| continue; |
| // optional int32 argument = 3 [default = 0]; |
| case 3: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { |
| _Internal::set_has_argument(&has_bits); |
| argument_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); |
| CHK_(ptr); |
| } else goto handle_unusual; |
| continue; |
| // repeated .chrome_lang_id.Parameter parameter = 4; |
| case 4: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { |
| ptr -= 1; |
| do { |
| ptr += 1; |
| ptr = ctx->ParseMessage(_internal_add_parameter(), ptr); |
| CHK_(ptr); |
| if (!ctx->DataAvailable(ptr)) break; |
| } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); |
| } else goto handle_unusual; |
| continue; |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 7; |
| case 7: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { |
| ptr -= 1; |
| do { |
| ptr += 1; |
| ptr = ctx->ParseMessage(_internal_add_feature(), ptr); |
| CHK_(ptr); |
| if (!ctx->DataAvailable(ptr)) break; |
| } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); |
| } else goto handle_unusual; |
| continue; |
| default: { |
| handle_unusual: |
| if ((tag & 7) == 4 || tag == 0) { |
| ctx->SetLastTag(tag); |
| goto success; |
| } |
| ptr = UnknownFieldParse(tag, |
| _internal_metadata_.mutable_unknown_fields<std::string>(), |
| ptr, ctx); |
| CHK_(ptr != nullptr); |
| continue; |
| } |
| } // switch |
| } // while |
| success: |
| _has_bits_.Or(has_bits); |
| return ptr; |
| failure: |
| ptr = nullptr; |
| goto success; |
| #undef CHK_ |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::uint8* FeatureFunctionDescriptor::_InternalSerialize( |
| ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
| // @@protoc_insertion_point(serialize_to_array_start:chrome_lang_id.FeatureFunctionDescriptor) |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| cached_has_bits = _has_bits_[0]; |
| // required string type = 1; |
| if (cached_has_bits & 0x00000001u) { |
| target = stream->WriteStringMaybeAliased( |
| 1, this->_internal_type(), target); |
| } |
| |
| // optional string name = 2; |
| if (cached_has_bits & 0x00000002u) { |
| target = stream->WriteStringMaybeAliased( |
| 2, this->_internal_name(), target); |
| } |
| |
| // optional int32 argument = 3 [default = 0]; |
| if (cached_has_bits & 0x00000004u) { |
| target = stream->EnsureSpace(target); |
| target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_argument(), target); |
| } |
| |
| // repeated .chrome_lang_id.Parameter parameter = 4; |
| for (unsigned int i = 0, |
| n = static_cast<unsigned int>(this->_internal_parameter_size()); i < n; i++) { |
| target = stream->EnsureSpace(target); |
| target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
| InternalWriteMessage(4, this->_internal_parameter(i), target, stream); |
| } |
| |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 7; |
| for (unsigned int i = 0, |
| n = static_cast<unsigned int>(this->_internal_feature_size()); i < n; i++) { |
| target = stream->EnsureSpace(target); |
| target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
| InternalWriteMessage(7, this->_internal_feature(i), target, stream); |
| } |
| |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), |
| static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); |
| } |
| // @@protoc_insertion_point(serialize_to_array_end:chrome_lang_id.FeatureFunctionDescriptor) |
| return target; |
| } |
| |
| size_t FeatureFunctionDescriptor::ByteSizeLong() const { |
| // @@protoc_insertion_point(message_byte_size_start:chrome_lang_id.FeatureFunctionDescriptor) |
| size_t total_size = 0; |
| |
| // required string type = 1; |
| if (_internal_has_type()) { |
| total_size += 1 + |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
| this->_internal_type()); |
| } |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| // Prevent compiler warnings about cached_has_bits being unused |
| (void) cached_has_bits; |
| |
| // repeated .chrome_lang_id.Parameter parameter = 4; |
| total_size += 1UL * this->_internal_parameter_size(); |
| for (const auto& msg : this->parameter_) { |
| total_size += |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); |
| } |
| |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 7; |
| total_size += 1UL * this->_internal_feature_size(); |
| for (const auto& msg : this->feature_) { |
| total_size += |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); |
| } |
| |
| cached_has_bits = _has_bits_[0]; |
| if (cached_has_bits & 0x00000006u) { |
| // optional string name = 2; |
| if (cached_has_bits & 0x00000002u) { |
| total_size += 1 + |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
| this->_internal_name()); |
| } |
| |
| // optional int32 argument = 3 [default = 0]; |
| if (cached_has_bits & 0x00000004u) { |
| total_size += 1 + |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
| this->_internal_argument()); |
| } |
| |
| } |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); |
| } |
| int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
| SetCachedSize(cached_size); |
| return total_size; |
| } |
| |
| void FeatureFunctionDescriptor::CheckTypeAndMergeFrom( |
| const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { |
| MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const FeatureFunctionDescriptor*>( |
| &from)); |
| } |
| |
| void FeatureFunctionDescriptor::MergeFrom(const FeatureFunctionDescriptor& from) { |
| // @@protoc_insertion_point(class_specific_merge_from_start:chrome_lang_id.FeatureFunctionDescriptor) |
| GOOGLE_DCHECK_NE(&from, this); |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| parameter_.MergeFrom(from.parameter_); |
| feature_.MergeFrom(from.feature_); |
| cached_has_bits = from._has_bits_[0]; |
| if (cached_has_bits & 0x00000007u) { |
| if (cached_has_bits & 0x00000001u) { |
| _internal_set_type(from._internal_type()); |
| } |
| if (cached_has_bits & 0x00000002u) { |
| _internal_set_name(from._internal_name()); |
| } |
| if (cached_has_bits & 0x00000004u) { |
| argument_ = from.argument_; |
| } |
| _has_bits_[0] |= cached_has_bits; |
| } |
| } |
| |
| void FeatureFunctionDescriptor::CopyFrom(const FeatureFunctionDescriptor& from) { |
| // @@protoc_insertion_point(class_specific_copy_from_start:chrome_lang_id.FeatureFunctionDescriptor) |
| if (&from == this) return; |
| Clear(); |
| MergeFrom(from); |
| } |
| |
| bool FeatureFunctionDescriptor::IsInitialized() const { |
| if (_Internal::MissingRequiredFields(_has_bits_)) return false; |
| if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(feature_)) return false; |
| return true; |
| } |
| |
| void FeatureFunctionDescriptor::InternalSwap(FeatureFunctionDescriptor* other) { |
| using std::swap; |
| _internal_metadata_.Swap<std::string>(&other->_internal_metadata_); |
| swap(_has_bits_[0], other->_has_bits_[0]); |
| parameter_.InternalSwap(&other->parameter_); |
| feature_.InternalSwap(&other->feature_); |
| type_.Swap(&other->type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); |
| name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); |
| swap(argument_, other->argument_); |
| } |
| |
| std::string FeatureFunctionDescriptor::GetTypeName() const { |
| return "chrome_lang_id.FeatureFunctionDescriptor"; |
| } |
| |
| |
| // =================================================================== |
| |
| class FeatureExtractorDescriptor::_Internal { |
| public: |
| }; |
| |
| FeatureExtractorDescriptor::FeatureExtractorDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena), |
| feature_(arena) { |
| SharedCtor(); |
| RegisterArenaDtor(arena); |
| // @@protoc_insertion_point(arena_constructor:chrome_lang_id.FeatureExtractorDescriptor) |
| } |
| FeatureExtractorDescriptor::FeatureExtractorDescriptor(const FeatureExtractorDescriptor& from) |
| : ::PROTOBUF_NAMESPACE_ID::MessageLite(), |
| feature_(from.feature_) { |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| // @@protoc_insertion_point(copy_constructor:chrome_lang_id.FeatureExtractorDescriptor) |
| } |
| |
| void FeatureExtractorDescriptor::SharedCtor() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FeatureExtractorDescriptor_feature_5fextractor_2eproto.base); |
| } |
| |
| FeatureExtractorDescriptor::~FeatureExtractorDescriptor() { |
| // @@protoc_insertion_point(destructor:chrome_lang_id.FeatureExtractorDescriptor) |
| SharedDtor(); |
| _internal_metadata_.Delete<std::string>(); |
| } |
| |
| void FeatureExtractorDescriptor::SharedDtor() { |
| GOOGLE_DCHECK(GetArena() == nullptr); |
| } |
| |
| void FeatureExtractorDescriptor::ArenaDtor(void* object) { |
| FeatureExtractorDescriptor* _this = reinterpret_cast< FeatureExtractorDescriptor* >(object); |
| (void)_this; |
| } |
| void FeatureExtractorDescriptor::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
| } |
| void FeatureExtractorDescriptor::SetCachedSize(int size) const { |
| _cached_size_.Set(size); |
| } |
| const FeatureExtractorDescriptor& FeatureExtractorDescriptor::default_instance() { |
| ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FeatureExtractorDescriptor_feature_5fextractor_2eproto.base); |
| return *internal_default_instance(); |
| } |
| |
| |
| void FeatureExtractorDescriptor::Clear() { |
| // @@protoc_insertion_point(message_clear_start:chrome_lang_id.FeatureExtractorDescriptor) |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| // Prevent compiler warnings about cached_has_bits being unused |
| (void) cached_has_bits; |
| |
| feature_.Clear(); |
| _internal_metadata_.Clear<std::string>(); |
| } |
| |
| const char* FeatureExtractorDescriptor::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
| #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
| while (!ctx->Done(&ptr)) { |
| ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
| ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
| CHK_(ptr); |
| switch (tag >> 3) { |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 1; |
| case 1: |
| if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
| ptr -= 1; |
| do { |
| ptr += 1; |
| ptr = ctx->ParseMessage(_internal_add_feature(), ptr); |
| CHK_(ptr); |
| if (!ctx->DataAvailable(ptr)) break; |
| } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); |
| } else goto handle_unusual; |
| continue; |
| default: { |
| handle_unusual: |
| if ((tag & 7) == 4 || tag == 0) { |
| ctx->SetLastTag(tag); |
| goto success; |
| } |
| ptr = UnknownFieldParse(tag, |
| _internal_metadata_.mutable_unknown_fields<std::string>(), |
| ptr, ctx); |
| CHK_(ptr != nullptr); |
| continue; |
| } |
| } // switch |
| } // while |
| success: |
| return ptr; |
| failure: |
| ptr = nullptr; |
| goto success; |
| #undef CHK_ |
| } |
| |
| ::PROTOBUF_NAMESPACE_ID::uint8* FeatureExtractorDescriptor::_InternalSerialize( |
| ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { |
| // @@protoc_insertion_point(serialize_to_array_start:chrome_lang_id.FeatureExtractorDescriptor) |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 1; |
| for (unsigned int i = 0, |
| n = static_cast<unsigned int>(this->_internal_feature_size()); i < n; i++) { |
| target = stream->EnsureSpace(target); |
| target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
| InternalWriteMessage(1, this->_internal_feature(i), target, stream); |
| } |
| |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(), |
| static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target); |
| } |
| // @@protoc_insertion_point(serialize_to_array_end:chrome_lang_id.FeatureExtractorDescriptor) |
| return target; |
| } |
| |
| size_t FeatureExtractorDescriptor::ByteSizeLong() const { |
| // @@protoc_insertion_point(message_byte_size_start:chrome_lang_id.FeatureExtractorDescriptor) |
| size_t total_size = 0; |
| |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| // Prevent compiler warnings about cached_has_bits being unused |
| (void) cached_has_bits; |
| |
| // repeated .chrome_lang_id.FeatureFunctionDescriptor feature = 1; |
| total_size += 1UL * this->_internal_feature_size(); |
| for (const auto& msg : this->feature_) { |
| total_size += |
| ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); |
| } |
| |
| if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { |
| total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size(); |
| } |
| int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
| SetCachedSize(cached_size); |
| return total_size; |
| } |
| |
| void FeatureExtractorDescriptor::CheckTypeAndMergeFrom( |
| const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) { |
| MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const FeatureExtractorDescriptor*>( |
| &from)); |
| } |
| |
| void FeatureExtractorDescriptor::MergeFrom(const FeatureExtractorDescriptor& from) { |
| // @@protoc_insertion_point(class_specific_merge_from_start:chrome_lang_id.FeatureExtractorDescriptor) |
| GOOGLE_DCHECK_NE(&from, this); |
| _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_); |
| ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
| (void) cached_has_bits; |
| |
| feature_.MergeFrom(from.feature_); |
| } |
| |
| void FeatureExtractorDescriptor::CopyFrom(const FeatureExtractorDescriptor& from) { |
| // @@protoc_insertion_point(class_specific_copy_from_start:chrome_lang_id.FeatureExtractorDescriptor) |
| if (&from == this) return; |
| Clear(); |
| MergeFrom(from); |
| } |
| |
| bool FeatureExtractorDescriptor::IsInitialized() const { |
| if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(feature_)) return false; |
| return true; |
| } |
| |
| void FeatureExtractorDescriptor::InternalSwap(FeatureExtractorDescriptor* other) { |
| using std::swap; |
| _internal_metadata_.Swap<std::string>(&other->_internal_metadata_); |
| feature_.InternalSwap(&other->feature_); |
| } |
| |
| std::string FeatureExtractorDescriptor::GetTypeName() const { |
| return "chrome_lang_id.FeatureExtractorDescriptor"; |
| } |
| |
| |
| // @@protoc_insertion_point(namespace_scope) |
| } // namespace chrome_lang_id |
| PROTOBUF_NAMESPACE_OPEN |
| template<> PROTOBUF_NOINLINE ::chrome_lang_id::Parameter* Arena::CreateMaybeMessage< ::chrome_lang_id::Parameter >(Arena* arena) { |
| return Arena::CreateMessageInternal< ::chrome_lang_id::Parameter >(arena); |
| } |
| template<> PROTOBUF_NOINLINE ::chrome_lang_id::FeatureFunctionDescriptor* Arena::CreateMaybeMessage< ::chrome_lang_id::FeatureFunctionDescriptor >(Arena* arena) { |
| return Arena::CreateMessageInternal< ::chrome_lang_id::FeatureFunctionDescriptor >(arena); |
| } |
| template<> PROTOBUF_NOINLINE ::chrome_lang_id::FeatureExtractorDescriptor* Arena::CreateMaybeMessage< ::chrome_lang_id::FeatureExtractorDescriptor >(Arena* arena) { |
| return Arena::CreateMessageInternal< ::chrome_lang_id::FeatureExtractorDescriptor >(arena); |
| } |
| PROTOBUF_NAMESPACE_CLOSE |
| |
| // @@protoc_insertion_point(global_scope) |
| #include <google/protobuf/port_undef.inc> |