onnxruntime-extensions/cmake/externals/sentencepieceproject_pb.patch

13081 строка
569 KiB
Diff

diff --git a/src/builtin_pb/sentencepiece.pb.cc b/src/builtin_pb/sentencepiece.pb.cc
index 7bc5494..301a39c 100644
--- a/src/builtin_pb/sentencepiece.pb.cc
+++ b/src/builtin_pb/sentencepiece.pb.cc
@@ -11,70 +11,70 @@
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SentencePieceText_sentencepiece_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto;
-namespace sentencepiece {
-class SentencePieceText_SentencePieceDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SentencePieceText_SentencePiece> _instance;
-} _SentencePieceText_SentencePiece_default_instance_;
-class SentencePieceTextDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SentencePieceText> _instance;
-} _SentencePieceText_default_instance_;
-class NBestSentencePieceTextDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NBestSentencePieceText> _instance;
-} _NBestSentencePieceText_default_instance_;
-} // namespace sentencepiece
-static void InitDefaultsscc_info_NBestSentencePieceText_sentencepiece_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_NBestSentencePieceText_default_instance_;
- new (ptr) ::sentencepiece::NBestSentencePieceText();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_NBestSentencePieceText_sentencepiece_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_NBestSentencePieceText_sentencepiece_2eproto}, {
- &scc_info_SentencePieceText_sentencepiece_2eproto.base,}};
-
-static void InitDefaultsscc_info_SentencePieceText_sentencepiece_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_SentencePieceText_default_instance_;
- new (ptr) ::sentencepiece::SentencePieceText();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SentencePieceText_sentencepiece_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_SentencePieceText_sentencepiece_2eproto}, {
- &scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base,}};
-
-static void InitDefaultsscc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::sentencepiece::_SentencePieceText_SentencePiece_default_instance_;
- new (ptr) ::sentencepiece::SentencePieceText_SentencePiece();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
+PROTOBUF_PRAGMA_INIT_SEG
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto}, {}};
+namespace _pb = ::PROTOBUF_NAMESPACE_ID;
+namespace _pbi = _pb::internal;
+namespace sentencepiece {
+PROTOBUF_CONSTEXPR SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.piece_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.surface_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.id_)*/0u
+ , /*decltype(_impl_.begin_)*/0u
+ , /*decltype(_impl_.end_)*/0u} {}
+struct SentencePieceText_SentencePieceDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR SentencePieceText_SentencePieceDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~SentencePieceText_SentencePieceDefaultTypeInternal() {}
+ union {
+ SentencePieceText_SentencePiece _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SentencePieceText_SentencePieceDefaultTypeInternal _SentencePieceText_SentencePiece_default_instance_;
+PROTOBUF_CONSTEXPR SentencePieceText::SentencePieceText(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.pieces_)*/{}
+ , /*decltype(_impl_.text_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.score_)*/0} {}
+struct SentencePieceTextDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR SentencePieceTextDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~SentencePieceTextDefaultTypeInternal() {}
+ union {
+ SentencePieceText _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SentencePieceTextDefaultTypeInternal _SentencePieceText_default_instance_;
+PROTOBUF_CONSTEXPR NBestSentencePieceText::NBestSentencePieceText(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_.nbests_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}} {}
+struct NBestSentencePieceTextDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR NBestSentencePieceTextDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~NBestSentencePieceTextDefaultTypeInternal() {}
+ union {
+ NBestSentencePieceText _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NBestSentencePieceTextDefaultTypeInternal _NBestSentencePieceText_default_instance_;
+} // namespace sentencepiece
namespace sentencepiece {
// ===================================================================
class SentencePieceText_SentencePiece::_Internal {
public:
- using HasBits = decltype(std::declval<SentencePieceText_SentencePiece>()._has_bits_);
+ using HasBits = decltype(std::declval<SentencePieceText_SentencePiece>()._impl_._has_bits_);
static void set_has_piece(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
@@ -92,180 +92,206 @@ class SentencePieceText_SentencePiece::_Internal {
}
};
-SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.SentencePieceText.SentencePiece)
}
SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(const SentencePieceText_SentencePiece& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ SentencePieceText_SentencePiece* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.piece_){}
+ , decltype(_impl_.surface_){}
+ , decltype(_impl_.id_){}
+ , decltype(_impl_.begin_){}
+ , decltype(_impl_.end_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
- piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _impl_.piece_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_piece()) {
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_piece(),
- GetArena());
+ _this->_impl_.piece_.Set(from._internal_piece(),
+ _this->GetArenaForAllocation());
}
- surface_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.surface_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.surface_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_surface()) {
- surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_surface(),
- GetArena());
+ _this->_impl_.surface_.Set(from._internal_surface(),
+ _this->GetArenaForAllocation());
}
- ::memcpy(&id_, &from.id_,
- static_cast<size_t>(reinterpret_cast<char*>(&end_) -
- reinterpret_cast<char*>(&id_)) + sizeof(end_));
+ ::memcpy(&_impl_.id_, &from._impl_.id_,
+ static_cast<size_t>(reinterpret_cast<char*>(&_impl_.end_) -
+ reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.end_));
// @@protoc_insertion_point(copy_constructor:sentencepiece.SentencePieceText.SentencePiece)
}
-void SentencePieceText_SentencePiece::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base);
- piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- surface_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
- reinterpret_cast<char*>(&id_) - reinterpret_cast<char*>(this)),
- 0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
- reinterpret_cast<char*>(&id_)) + sizeof(end_));
+inline void SentencePieceText_SentencePiece::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.piece_){}
+ , decltype(_impl_.surface_){}
+ , decltype(_impl_.id_){0u}
+ , decltype(_impl_.begin_){0u}
+ , decltype(_impl_.end_){0u}
+ };
+ _impl_.piece_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.surface_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.surface_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
SentencePieceText_SentencePiece::~SentencePieceText_SentencePiece() {
// @@protoc_insertion_point(destructor:sentencepiece.SentencePieceText.SentencePiece)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void SentencePieceText_SentencePiece::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- piece_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- surface_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SentencePieceText_SentencePiece::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.piece_.Destroy();
+ _impl_.surface_.Destroy();
}
-void SentencePieceText_SentencePiece::ArenaDtor(void* object) {
- SentencePieceText_SentencePiece* _this = reinterpret_cast< SentencePieceText_SentencePiece* >(object);
- (void)_this;
-}
-void SentencePieceText_SentencePiece::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void SentencePieceText_SentencePiece::SetCachedSize(int size) const {
- _cached_size_.Set(size);
-}
-const SentencePieceText_SentencePiece& SentencePieceText_SentencePiece::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base);
- return *internal_default_instance();
+ _impl_._cached_size_.Set(size);
}
-
void SentencePieceText_SentencePiece::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.SentencePieceText.SentencePiece)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
- piece_.ClearNonDefaultToEmpty();
+ _impl_.piece_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
- surface_.ClearNonDefaultToEmpty();
+ _impl_.surface_.ClearNonDefaultToEmpty();
}
}
if (cached_has_bits & 0x0000001cu) {
- ::memset(&id_, 0, static_cast<size_t>(
- reinterpret_cast<char*>(&end_) -
- reinterpret_cast<char*>(&id_)) + sizeof(end_));
+ ::memset(&_impl_.id_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&_impl_.end_) -
+ reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.end_));
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* SentencePieceText_SentencePiece::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SentencePieceText_SentencePiece::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string piece = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional uint32 id = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_Internal::set_has_id(&has_bits);
- id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+ _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string surface = 3;
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
auto str = _internal_mutable_surface();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional uint32 begin = 4;
case 4:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
_Internal::set_has_begin(&has_bits);
- begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+ _impl_.begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional uint32 end = 5;
case 5:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_Internal::set_has_end(&has_bits);
- end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+ _impl_.end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
- continue;
- default: {
- handle_unusual:
- if ((tag & 7) == 4 || tag == 0) {
- ctx->SetLastTag(tag);
- goto success;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
+ } else
+ goto handle_unusual;
continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* SentencePieceText_SentencePiece::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SentencePieceText_SentencePiece::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SentencePieceText.SentencePiece)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string piece = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -275,7 +301,7 @@ failure:
// optional uint32 id = 2;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_id(), target);
+ target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_id(), target);
}
// optional string surface = 3;
@@ -287,18 +313,18 @@ failure:
// optional uint32 begin = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_begin(), target);
+ target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_begin(), target);
}
// optional uint32 end = 5;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_end(), target);
+ target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_end(), target);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -312,13 +338,13 @@ size_t SentencePieceText_SentencePiece::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.SentencePieceText.SentencePiece)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
// optional string piece = 1;
if (cached_has_bits & 0x00000001u) {
@@ -336,67 +362,62 @@ size_t SentencePieceText_SentencePiece::ByteSizeLong() const {
// optional uint32 id = 2;
if (cached_has_bits & 0x00000004u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
- this->_internal_id());
+ total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id());
}
// optional uint32 begin = 4;
if (cached_has_bits & 0x00000008u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
- this->_internal_begin());
+ total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_begin());
}
// optional uint32 end = 5;
if (cached_has_bits & 0x00000010u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
- this->_internal_end());
+ total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_end());
}
}
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void SentencePieceText_SentencePiece::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SentencePieceText_SentencePiece*>(
+ MergeFrom(*::_pbi::DownCast<const SentencePieceText_SentencePiece*>(
&from));
}
void SentencePieceText_SentencePiece::MergeFrom(const SentencePieceText_SentencePiece& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText.SentencePiece)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ SentencePieceText_SentencePiece* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText.SentencePiece)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = from._has_bits_[0];
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x0000001fu) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_piece(from._internal_piece());
+ _this->_internal_set_piece(from._internal_piece());
}
if (cached_has_bits & 0x00000002u) {
- _internal_set_surface(from._internal_surface());
+ _this->_internal_set_surface(from._internal_surface());
}
if (cached_has_bits & 0x00000004u) {
- id_ = from.id_;
+ _this->_impl_.id_ = from._impl_.id_;
}
if (cached_has_bits & 0x00000008u) {
- begin_ = from.begin_;
+ _this->_impl_.begin_ = from._impl_.begin_;
}
if (cached_has_bits & 0x00000010u) {
- end_ = from.end_;
+ _this->_impl_.end_ = from._impl_.end_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void SentencePieceText_SentencePiece::CopyFrom(const SentencePieceText_SentencePiece& from) {
@@ -407,7 +428,7 @@ void SentencePieceText_SentencePiece::CopyFrom(const SentencePieceText_SentenceP
}
bool SentencePieceText_SentencePiece::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
@@ -416,17 +437,25 @@ bool SentencePieceText_SentencePiece::IsInitialized() const {
void SentencePieceText_SentencePiece::InternalSwap(SentencePieceText_SentencePiece* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- piece_.Swap(&other->piece_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- surface_.Swap(&other->surface_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.piece_, lhs_arena,
+ &other->_impl_.piece_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.surface_, lhs_arena,
+ &other->_impl_.surface_, rhs_arena
+ );
::PROTOBUF_NAMESPACE_ID::internal::memswap<
- PROTOBUF_FIELD_OFFSET(SentencePieceText_SentencePiece, end_)
- + sizeof(SentencePieceText_SentencePiece::end_)
- - PROTOBUF_FIELD_OFFSET(SentencePieceText_SentencePiece, id_)>(
- reinterpret_cast<char*>(&id_),
- reinterpret_cast<char*>(&other->id_));
+ PROTOBUF_FIELD_OFFSET(SentencePieceText_SentencePiece, _impl_.end_)
+ + sizeof(SentencePieceText_SentencePiece::_impl_.end_)
+ - PROTOBUF_FIELD_OFFSET(SentencePieceText_SentencePiece, _impl_.id_)>(
+ reinterpret_cast<char*>(&_impl_.id_),
+ reinterpret_cast<char*>(&other->_impl_.id_));
}
std::string SentencePieceText_SentencePiece::GetTypeName() const {
@@ -438,7 +467,7 @@ std::string SentencePieceText_SentencePiece::GetTypeName() const {
class SentencePieceText::_Internal {
public:
- using HasBits = decltype(std::declval<SentencePieceText>()._has_bits_);
+ using HasBits = decltype(std::declval<SentencePieceText>()._impl_._has_bits_);
static void set_has_text(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
@@ -447,97 +476,111 @@ class SentencePieceText::_Internal {
}
};
-SentencePieceText::SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena),
- pieces_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+SentencePieceText::SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.SentencePieceText)
}
SentencePieceText::SentencePieceText(const SentencePieceText& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_),
- pieces_(from.pieces_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ SentencePieceText* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.pieces_){from._impl_.pieces_}
+ , decltype(_impl_.text_){}
+ , decltype(_impl_.score_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
- text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _impl_.text_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.text_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_text()) {
- text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_text(),
- GetArena());
+ _this->_impl_.text_.Set(from._internal_text(),
+ _this->GetArenaForAllocation());
}
- score_ = from.score_;
+ _this->_impl_.score_ = from._impl_.score_;
// @@protoc_insertion_point(copy_constructor:sentencepiece.SentencePieceText)
}
-void SentencePieceText::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SentencePieceText_sentencepiece_2eproto.base);
- text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- score_ = 0;
+inline void SentencePieceText::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.pieces_){arena}
+ , decltype(_impl_.text_){}
+ , decltype(_impl_.score_){0}
+ };
+ _impl_.text_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.text_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
SentencePieceText::~SentencePieceText() {
// @@protoc_insertion_point(destructor:sentencepiece.SentencePieceText)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void SentencePieceText::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SentencePieceText::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.pieces_.~RepeatedPtrField();
+ _impl_.text_.Destroy();
}
-void SentencePieceText::ArenaDtor(void* object) {
- SentencePieceText* _this = reinterpret_cast< SentencePieceText* >(object);
- (void)_this;
-}
-void SentencePieceText::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void SentencePieceText::SetCachedSize(int size) const {
- _cached_size_.Set(size);
+ _impl_._cached_size_.Set(size);
}
-const SentencePieceText& SentencePieceText::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SentencePieceText_sentencepiece_2eproto.base);
- return *internal_default_instance();
-}
-
void SentencePieceText::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.SentencePieceText)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- pieces_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ _impl_.pieces_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
- text_.ClearNonDefaultToEmpty();
+ _impl_.text_.ClearNonDefaultToEmpty();
}
- score_ = 0;
- _has_bits_.Clear();
+ _impl_.score_ = 0;
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* SentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SentencePieceText::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string text = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_text();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
ptr -= 1;
do {
ptr += 1;
@@ -545,52 +588,54 @@ const char* SentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional float score = 3;
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
_Internal::set_has_score(&has_bits);
- score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+ _impl_.score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
- default: {
- handle_unusual:
- if ((tag & 7) == 4 || tag == 0) {
- ctx->SetLastTag(tag);
- goto success;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* SentencePieceText::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SentencePieceText::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SentencePieceText)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string text = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -598,22 +643,22 @@ failure:
}
// repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->_internal_pieces_size()); i < n; i++) {
- target = stream->EnsureSpace(target);
+ for (unsigned i = 0,
+ n = static_cast<unsigned>(this->_internal_pieces_size()); i < n; i++) {
+ const auto& repfield = this->_internal_pieces(i);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(2, this->_internal_pieces(i), target, stream);
+ InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
}
// optional float score = 3;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_score(), target);
+ target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_score(), target);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -627,20 +672,20 @@ size_t SentencePieceText::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.SentencePieceText)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
total_size += 1UL * this->_internal_pieces_size();
- for (const auto& msg : this->pieces_) {
+ for (const auto& msg : this->_impl_.pieces_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional string text = 1;
if (cached_has_bits & 0x00000001u) {
@@ -658,36 +703,37 @@ size_t SentencePieceText::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void SentencePieceText::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SentencePieceText*>(
+ MergeFrom(*::_pbi::DownCast<const SentencePieceText*>(
&from));
}
void SentencePieceText::MergeFrom(const SentencePieceText& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ SentencePieceText* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- pieces_.MergeFrom(from.pieces_);
- cached_has_bits = from._has_bits_[0];
+ _this->_impl_.pieces_.MergeFrom(from._impl_.pieces_);
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_text(from._internal_text());
+ _this->_internal_set_text(from._internal_text());
}
if (cached_has_bits & 0x00000002u) {
- score_ = from.score_;
+ _this->_impl_.score_ = from._impl_.score_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void SentencePieceText::CopyFrom(const SentencePieceText& from) {
@@ -698,22 +744,28 @@ void SentencePieceText::CopyFrom(const SentencePieceText& from) {
}
bool SentencePieceText::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
- if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_)) return false;
+ if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.pieces_))
+ return false;
return true;
}
void SentencePieceText::InternalSwap(SentencePieceText* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- pieces_.InternalSwap(&other->pieces_);
- text_.Swap(&other->text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- swap(score_, other->score_);
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ _impl_.pieces_.InternalSwap(&other->_impl_.pieces_);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.text_, lhs_arena,
+ &other->_impl_.text_, rhs_arena
+ );
+ swap(_impl_.score_, other->_impl_.score_);
}
std::string SentencePieceText::GetTypeName() const {
@@ -727,69 +779,70 @@ class NBestSentencePieceText::_Internal {
public:
};
-NBestSentencePieceText::NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- nbests_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+NBestSentencePieceText::NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.NBestSentencePieceText)
}
NBestSentencePieceText::NBestSentencePieceText(const NBestSentencePieceText& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- nbests_(from.nbests_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ NBestSentencePieceText* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ decltype(_impl_.nbests_){from._impl_.nbests_}
+ , /*decltype(_impl_._cached_size_)*/{}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:sentencepiece.NBestSentencePieceText)
}
-void NBestSentencePieceText::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NBestSentencePieceText_sentencepiece_2eproto.base);
+inline void NBestSentencePieceText::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ decltype(_impl_.nbests_){arena}
+ , /*decltype(_impl_._cached_size_)*/{}
+ };
}
NBestSentencePieceText::~NBestSentencePieceText() {
// @@protoc_insertion_point(destructor:sentencepiece.NBestSentencePieceText)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void NBestSentencePieceText::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
+inline void NBestSentencePieceText::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_.nbests_.~RepeatedPtrField();
}
-void NBestSentencePieceText::ArenaDtor(void* object) {
- NBestSentencePieceText* _this = reinterpret_cast< NBestSentencePieceText* >(object);
- (void)_this;
-}
-void NBestSentencePieceText::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void NBestSentencePieceText::SetCachedSize(int size) const {
- _cached_size_.Set(size);
+ _impl_._cached_size_.Set(size);
}
-const NBestSentencePieceText& NBestSentencePieceText::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NBestSentencePieceText_sentencepiece_2eproto.base);
- return *internal_default_instance();
-}
-
void NBestSentencePieceText::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.NBestSentencePieceText)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- nbests_.Clear();
+ _impl_.nbests_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// repeated .sentencepiece.SentencePieceText nbests = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
@@ -797,42 +850,44 @@ const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_N
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
- } else goto handle_unusual;
+ } 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;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
+message_done:
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* NBestSentencePieceText::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* NBestSentencePieceText::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.NBestSentencePieceText)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// repeated .sentencepiece.SentencePieceText nbests = 1;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->_internal_nbests_size()); i < n; i++) {
- target = stream->EnsureSpace(target);
+ for (unsigned i = 0,
+ n = static_cast<unsigned>(this->_internal_nbests_size()); i < n; i++) {
+ const auto& repfield = this->_internal_nbests(i);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(1, this->_internal_nbests(i), target, stream);
+ InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
@@ -847,13 +902,13 @@ size_t NBestSentencePieceText::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.NBestSentencePieceText)
size_t total_size = 0;
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .sentencepiece.SentencePieceText nbests = 1;
total_size += 1UL * this->_internal_nbests_size();
- for (const auto& msg : this->nbests_) {
+ for (const auto& msg : this->_impl_.nbests_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
@@ -861,25 +916,26 @@ size_t NBestSentencePieceText::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void NBestSentencePieceText::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const NBestSentencePieceText*>(
+ MergeFrom(*::_pbi::DownCast<const NBestSentencePieceText*>(
&from));
}
void NBestSentencePieceText::MergeFrom(const NBestSentencePieceText& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NBestSentencePieceText)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ NBestSentencePieceText* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NBestSentencePieceText)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- nbests_.MergeFrom(from.nbests_);
+ _this->_impl_.nbests_.MergeFrom(from._impl_.nbests_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void NBestSentencePieceText::CopyFrom(const NBestSentencePieceText& from) {
@@ -890,14 +946,15 @@ void NBestSentencePieceText::CopyFrom(const NBestSentencePieceText& from) {
}
bool NBestSentencePieceText::IsInitialized() const {
- if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(nbests_)) return false;
+ if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.nbests_))
+ return false;
return true;
}
void NBestSentencePieceText::InternalSwap(NBestSentencePieceText* other) {
using std::swap;
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- nbests_.InternalSwap(&other->nbests_);
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ _impl_.nbests_.InternalSwap(&other->_impl_.nbests_);
}
std::string NBestSentencePieceText::GetTypeName() const {
@@ -908,13 +965,16 @@ std::string NBestSentencePieceText::GetTypeName() const {
// @@protoc_insertion_point(namespace_scope)
} // namespace sentencepiece
PROTOBUF_NAMESPACE_OPEN
-template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText_SentencePiece* Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText_SentencePiece >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText_SentencePiece*
+Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText_SentencePiece >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::SentencePieceText_SentencePiece >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText* Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText*
+Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::SentencePieceText >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::NBestSentencePieceText* Arena::CreateMaybeMessage< ::sentencepiece::NBestSentencePieceText >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::NBestSentencePieceText*
+Arena::CreateMaybeMessage< ::sentencepiece::NBestSentencePieceText >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::NBestSentencePieceText >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
diff --git a/src/builtin_pb/sentencepiece.pb.h b/src/builtin_pb/sentencepiece.pb.h
index 24ec337..7a3be31 100644
--- a/src/builtin_pb/sentencepiece.pb.h
+++ b/src/builtin_pb/sentencepiece.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3014000
+#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3014000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -23,7 +23,6 @@
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/message_lite.h>
@@ -40,25 +39,17 @@ PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_sentencepiece_2eproto {
- static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
- static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
- static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+ static const uint32_t offsets[];
};
namespace sentencepiece {
class NBestSentencePieceText;
-class NBestSentencePieceTextDefaultTypeInternal;
+struct NBestSentencePieceTextDefaultTypeInternal;
extern NBestSentencePieceTextDefaultTypeInternal _NBestSentencePieceText_default_instance_;
class SentencePieceText;
-class SentencePieceTextDefaultTypeInternal;
+struct SentencePieceTextDefaultTypeInternal;
extern SentencePieceTextDefaultTypeInternal _SentencePieceText_default_instance_;
class SentencePieceText_SentencePiece;
-class SentencePieceText_SentencePieceDefaultTypeInternal;
+struct SentencePieceText_SentencePieceDefaultTypeInternal;
extern SentencePieceText_SentencePieceDefaultTypeInternal _SentencePieceText_SentencePiece_default_instance_;
} // namespace sentencepiece
PROTOBUF_NAMESPACE_OPEN
@@ -70,11 +61,12 @@ namespace sentencepiece {
// ===================================================================
-class SentencePieceText_SentencePiece PROTOBUF_FINAL :
+class SentencePieceText_SentencePiece final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SentencePieceText.SentencePiece) */ {
public:
inline SentencePieceText_SentencePiece() : SentencePieceText_SentencePiece(nullptr) {}
- virtual ~SentencePieceText_SentencePiece();
+ ~SentencePieceText_SentencePiece() override;
+ explicit PROTOBUF_CONSTEXPR SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
SentencePieceText_SentencePiece(const SentencePieceText_SentencePiece& from);
SentencePieceText_SentencePiece(SentencePieceText_SentencePiece&& from) noexcept
@@ -87,8 +79,13 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
return *this;
}
inline SentencePieceText_SentencePiece& operator=(SentencePieceText_SentencePiece&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -102,8 +99,9 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const SentencePieceText_SentencePiece& default_instance();
-
+ static const SentencePieceText_SentencePiece& default_instance() {
+ return *internal_default_instance();
+ }
static inline const SentencePieceText_SentencePiece* internal_default_instance() {
return reinterpret_cast<const SentencePieceText_SentencePiece*>(
&_SentencePieceText_SentencePiece_default_instance_);
@@ -116,7 +114,12 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
}
inline void Swap(SentencePieceText_SentencePiece* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -124,21 +127,16 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
}
void UnsafeArenaSwap(SentencePieceText_SentencePiece* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline SentencePieceText_SentencePiece* New() const final {
- return CreateMaybeMessage<SentencePieceText_SentencePiece>(nullptr);
- }
-
- SentencePieceText_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ SentencePieceText_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<SentencePieceText_SentencePiece>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const SentencePieceText_SentencePiece& from);
void MergeFrom(const SentencePieceText_SentencePiece& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -146,25 +144,24 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(SentencePieceText_SentencePiece* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.SentencePieceText.SentencePiece";
}
protected:
- explicit SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -187,16 +184,14 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
public:
void clear_piece();
const std::string& piece() const;
- void set_piece(const std::string& value);
- void set_piece(std::string&& value);
- void set_piece(const char* value);
- void set_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_piece();
- std::string* release_piece();
+ PROTOBUF_NODISCARD std::string* release_piece();
void set_allocated_piece(std::string* piece);
private:
const std::string& _internal_piece() const;
- void _internal_set_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_piece(const std::string& value);
std::string* _internal_mutable_piece();
public:
@@ -207,16 +202,14 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
public:
void clear_surface();
const std::string& surface() const;
- void set_surface(const std::string& value);
- void set_surface(std::string&& value);
- void set_surface(const char* value);
- void set_surface(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_surface(ArgT0&& arg0, ArgT... args);
std::string* mutable_surface();
- std::string* release_surface();
+ PROTOBUF_NODISCARD std::string* release_surface();
void set_allocated_surface(std::string* surface);
private:
const std::string& _internal_surface() const;
- void _internal_set_surface(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_surface(const std::string& value);
std::string* _internal_mutable_surface();
public:
@@ -226,11 +219,11 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
bool _internal_has_id() const;
public:
void clear_id();
- ::PROTOBUF_NAMESPACE_ID::uint32 id() const;
- void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t id() const;
+ void set_id(uint32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const;
- void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t _internal_id() const;
+ void _internal_set_id(uint32_t value);
public:
// optional uint32 begin = 4;
@@ -239,11 +232,11 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
bool _internal_has_begin() const;
public:
void clear_begin();
- ::PROTOBUF_NAMESPACE_ID::uint32 begin() const;
- void set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t begin() const;
+ void set_begin(uint32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::uint32 _internal_begin() const;
- void _internal_set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t _internal_begin() const;
+ void _internal_set_begin(uint32_t value);
public:
// optional uint32 end = 5;
@@ -252,39 +245,232 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
bool _internal_has_end() const;
public:
void clear_end();
- ::PROTOBUF_NAMESPACE_ID::uint32 end() const;
- void set_end(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t end() const;
+ void set_end(uint32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::uint32 _internal_end() const;
- void _internal_set_end(::PROTOBUF_NAMESPACE_ID::uint32 value);
+ uint32_t _internal_end() const;
+ void _internal_set_end(uint32_t value);
public:
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SentencePieceText_SentencePiece)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.SentencePieceText.SentencePiece)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr piece_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr surface_;
- ::PROTOBUF_NAMESPACE_ID::uint32 id_;
- ::PROTOBUF_NAMESPACE_ID::uint32 begin_;
- ::PROTOBUF_NAMESPACE_ID::uint32 end_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr piece_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr surface_;
+ uint32_t id_;
+ uint32_t begin_;
+ uint32_t end_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_2eproto;
};
// -------------------------------------------------------------------
-class SentencePieceText PROTOBUF_FINAL :
+class SentencePieceText final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SentencePieceText) */ {
public:
inline SentencePieceText() : SentencePieceText(nullptr) {}
- virtual ~SentencePieceText();
+ ~SentencePieceText() override;
+ explicit PROTOBUF_CONSTEXPR SentencePieceText(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
SentencePieceText(const SentencePieceText& from);
SentencePieceText(SentencePieceText&& from) noexcept
@@ -297,8 +483,13 @@ class SentencePieceText PROTOBUF_FINAL :
return *this;
}
inline SentencePieceText& operator=(SentencePieceText&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -312,8 +503,9 @@ class SentencePieceText PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const SentencePieceText& default_instance();
-
+ static const SentencePieceText& default_instance() {
+ return *internal_default_instance();
+ }
static inline const SentencePieceText* internal_default_instance() {
return reinterpret_cast<const SentencePieceText*>(
&_SentencePieceText_default_instance_);
@@ -326,7 +518,12 @@ class SentencePieceText PROTOBUF_FINAL :
}
inline void Swap(SentencePieceText* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -334,21 +531,16 @@ class SentencePieceText PROTOBUF_FINAL :
}
void UnsafeArenaSwap(SentencePieceText* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline SentencePieceText* New() const final {
- return CreateMaybeMessage<SentencePieceText>(nullptr);
- }
-
- SentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ SentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<SentencePieceText>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const SentencePieceText& from);
void MergeFrom(const SentencePieceText& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -356,25 +548,24 @@ class SentencePieceText PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(SentencePieceText* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.SentencePieceText";
}
protected:
- explicit SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -415,16 +606,14 @@ class SentencePieceText PROTOBUF_FINAL :
public:
void clear_text();
const std::string& text() const;
- void set_text(const std::string& value);
- void set_text(std::string&& value);
- void set_text(const char* value);
- void set_text(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_text(ArgT0&& arg0, ArgT... args);
std::string* mutable_text();
- std::string* release_text();
+ PROTOBUF_NODISCARD std::string* release_text();
void set_allocated_text(std::string* text);
private:
const std::string& _internal_text() const;
- void _internal_set_text(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value);
std::string* _internal_mutable_text();
public:
@@ -441,30 +630,223 @@ class SentencePieceText PROTOBUF_FINAL :
void _internal_set_score(float value);
public:
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SentencePieceText)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.SentencePieceText)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText_SentencePiece > pieces_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_;
- float score_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText_SentencePiece > pieces_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr text_;
+ float score_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_2eproto;
};
// -------------------------------------------------------------------
-class NBestSentencePieceText PROTOBUF_FINAL :
+class NBestSentencePieceText final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.NBestSentencePieceText) */ {
public:
inline NBestSentencePieceText() : NBestSentencePieceText(nullptr) {}
- virtual ~NBestSentencePieceText();
+ ~NBestSentencePieceText() override;
+ explicit PROTOBUF_CONSTEXPR NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
NBestSentencePieceText(const NBestSentencePieceText& from);
NBestSentencePieceText(NBestSentencePieceText&& from) noexcept
@@ -477,8 +859,13 @@ class NBestSentencePieceText PROTOBUF_FINAL :
return *this;
}
inline NBestSentencePieceText& operator=(NBestSentencePieceText&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -492,8 +879,9 @@ class NBestSentencePieceText PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const NBestSentencePieceText& default_instance();
-
+ static const NBestSentencePieceText& default_instance() {
+ return *internal_default_instance();
+ }
static inline const NBestSentencePieceText* internal_default_instance() {
return reinterpret_cast<const NBestSentencePieceText*>(
&_NBestSentencePieceText_default_instance_);
@@ -506,7 +894,12 @@ class NBestSentencePieceText PROTOBUF_FINAL :
}
inline void Swap(NBestSentencePieceText* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -514,21 +907,16 @@ class NBestSentencePieceText PROTOBUF_FINAL :
}
void UnsafeArenaSwap(NBestSentencePieceText* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline NBestSentencePieceText* New() const final {
- return CreateMaybeMessage<NBestSentencePieceText>(nullptr);
- }
-
- NBestSentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ NBestSentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<NBestSentencePieceText>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const NBestSentencePieceText& from);
void MergeFrom(const NBestSentencePieceText& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -536,25 +924,24 @@ class NBestSentencePieceText PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(NBestSentencePieceText* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.NBestSentencePieceText";
}
protected:
- explicit NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -591,8 +978,11 @@ class NBestSentencePieceText PROTOBUF_FINAL :
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText > nbests_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText > nbests_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_2eproto;
};
// ===================================================================
@@ -608,230 +998,220 @@ class NBestSentencePieceText PROTOBUF_FINAL :
// optional string piece = 1;
inline bool SentencePieceText_SentencePiece::_internal_has_piece() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool SentencePieceText_SentencePiece::has_piece() const {
return _internal_has_piece();
}
inline void SentencePieceText_SentencePiece::clear_piece() {
- piece_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.piece_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& SentencePieceText_SentencePiece::piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.piece)
return _internal_piece();
}
-inline void SentencePieceText_SentencePiece::set_piece(const std::string& value) {
- _internal_set_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText_SentencePiece::set_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.piece)
}
inline std::string* SentencePieceText_SentencePiece::mutable_piece() {
+ std::string* _s = _internal_mutable_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.SentencePiece.piece)
- return _internal_mutable_piece();
+ return _s;
}
inline const std::string& SentencePieceText_SentencePiece::_internal_piece() const {
- return piece_.Get();
+ return _impl_.piece_.Get();
}
inline void SentencePieceText_SentencePiece::_internal_set_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText_SentencePiece::set_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.SentencePiece.piece)
-}
-inline void SentencePieceText_SentencePiece::set_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.SentencePiece.piece)
-}
-inline void SentencePieceText_SentencePiece::set_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.SentencePiece.piece)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.piece_.Set(value, GetArenaForAllocation());
}
inline std::string* SentencePieceText_SentencePiece::_internal_mutable_piece() {
- _has_bits_[0] |= 0x00000001u;
- return piece_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.piece_.Mutable(GetArenaForAllocation());
}
inline std::string* SentencePieceText_SentencePiece::release_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.SentencePiece.piece)
if (!_internal_has_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return piece_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.piece_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.piece_.IsDefault()) {
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void SentencePieceText_SentencePiece::set_allocated_piece(std::string* piece) {
if (piece != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
- piece_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), piece,
- GetArena());
+ _impl_.piece_.SetAllocated(piece, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.piece_.IsDefault()) {
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.SentencePiece.piece)
}
// optional uint32 id = 2;
inline bool SentencePieceText_SentencePiece::_internal_has_id() const {
- bool value = (_has_bits_[0] & 0x00000004u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool SentencePieceText_SentencePiece::has_id() const {
return _internal_has_id();
}
inline void SentencePieceText_SentencePiece::clear_id() {
- id_ = 0u;
- _has_bits_[0] &= ~0x00000004u;
+ _impl_.id_ = 0u;
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_id() const {
- return id_;
+inline uint32_t SentencePieceText_SentencePiece::_internal_id() const {
+ return _impl_.id_;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::id() const {
+inline uint32_t SentencePieceText_SentencePiece::id() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.id)
return _internal_id();
}
-inline void SentencePieceText_SentencePiece::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) {
- _has_bits_[0] |= 0x00000004u;
- id_ = value;
+inline void SentencePieceText_SentencePiece::_internal_set_id(uint32_t value) {
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.id_ = value;
}
-inline void SentencePieceText_SentencePiece::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_id(uint32_t value) {
_internal_set_id(value);
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.id)
}
// optional string surface = 3;
inline bool SentencePieceText_SentencePiece::_internal_has_surface() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool SentencePieceText_SentencePiece::has_surface() const {
return _internal_has_surface();
}
inline void SentencePieceText_SentencePiece::clear_surface() {
- surface_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.surface_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& SentencePieceText_SentencePiece::surface() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.surface)
return _internal_surface();
}
-inline void SentencePieceText_SentencePiece::set_surface(const std::string& value) {
- _internal_set_surface(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText_SentencePiece::set_surface(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.surface_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.surface)
}
inline std::string* SentencePieceText_SentencePiece::mutable_surface() {
+ std::string* _s = _internal_mutable_surface();
// @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.SentencePiece.surface)
- return _internal_mutable_surface();
+ return _s;
}
inline const std::string& SentencePieceText_SentencePiece::_internal_surface() const {
- return surface_.Get();
+ return _impl_.surface_.Get();
}
inline void SentencePieceText_SentencePiece::_internal_set_surface(const std::string& value) {
- _has_bits_[0] |= 0x00000002u;
- surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText_SentencePiece::set_surface(std::string&& value) {
- _has_bits_[0] |= 0x00000002u;
- surface_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.SentencePiece.surface)
-}
-inline void SentencePieceText_SentencePiece::set_surface(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000002u;
- surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.SentencePiece.surface)
-}
-inline void SentencePieceText_SentencePiece::set_surface(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000002u;
- surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.SentencePiece.surface)
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.surface_.Set(value, GetArenaForAllocation());
}
inline std::string* SentencePieceText_SentencePiece::_internal_mutable_surface() {
- _has_bits_[0] |= 0x00000002u;
- return surface_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000002u;
+ return _impl_.surface_.Mutable(GetArenaForAllocation());
}
inline std::string* SentencePieceText_SentencePiece::release_surface() {
// @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.SentencePiece.surface)
if (!_internal_has_surface()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000002u;
- return surface_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ auto* p = _impl_.surface_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.surface_.IsDefault()) {
+ _impl_.surface_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void SentencePieceText_SentencePiece::set_allocated_surface(std::string* surface) {
if (surface != nullptr) {
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
- surface_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), surface,
- GetArena());
+ _impl_.surface_.SetAllocated(surface, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.surface_.IsDefault()) {
+ _impl_.surface_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.SentencePiece.surface)
}
// optional uint32 begin = 4;
inline bool SentencePieceText_SentencePiece::_internal_has_begin() const {
- bool value = (_has_bits_[0] & 0x00000008u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value;
}
inline bool SentencePieceText_SentencePiece::has_begin() const {
return _internal_has_begin();
}
inline void SentencePieceText_SentencePiece::clear_begin() {
- begin_ = 0u;
- _has_bits_[0] &= ~0x00000008u;
+ _impl_.begin_ = 0u;
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_begin() const {
- return begin_;
+inline uint32_t SentencePieceText_SentencePiece::_internal_begin() const {
+ return _impl_.begin_;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::begin() const {
+inline uint32_t SentencePieceText_SentencePiece::begin() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.begin)
return _internal_begin();
}
-inline void SentencePieceText_SentencePiece::_internal_set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value) {
- _has_bits_[0] |= 0x00000008u;
- begin_ = value;
+inline void SentencePieceText_SentencePiece::_internal_set_begin(uint32_t value) {
+ _impl_._has_bits_[0] |= 0x00000008u;
+ _impl_.begin_ = value;
}
-inline void SentencePieceText_SentencePiece::set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_begin(uint32_t value) {
_internal_set_begin(value);
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.begin)
}
// optional uint32 end = 5;
inline bool SentencePieceText_SentencePiece::_internal_has_end() const {
- bool value = (_has_bits_[0] & 0x00000010u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0;
return value;
}
inline bool SentencePieceText_SentencePiece::has_end() const {
return _internal_has_end();
}
inline void SentencePieceText_SentencePiece::clear_end() {
- end_ = 0u;
- _has_bits_[0] &= ~0x00000010u;
+ _impl_.end_ = 0u;
+ _impl_._has_bits_[0] &= ~0x00000010u;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_end() const {
- return end_;
+inline uint32_t SentencePieceText_SentencePiece::_internal_end() const {
+ return _impl_.end_;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::end() const {
+inline uint32_t SentencePieceText_SentencePiece::end() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.end)
return _internal_end();
}
-inline void SentencePieceText_SentencePiece::_internal_set_end(::PROTOBUF_NAMESPACE_ID::uint32 value) {
- _has_bits_[0] |= 0x00000010u;
- end_ = value;
+inline void SentencePieceText_SentencePiece::_internal_set_end(uint32_t value) {
+ _impl_._has_bits_[0] |= 0x00000010u;
+ _impl_.end_ = value;
}
-inline void SentencePieceText_SentencePiece::set_end(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_end(uint32_t value) {
_internal_set_end(value);
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.end)
}
@@ -842,138 +1222,134 @@ inline void SentencePieceText_SentencePiece::set_end(::PROTOBUF_NAMESPACE_ID::ui
// optional string text = 1;
inline bool SentencePieceText::_internal_has_text() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool SentencePieceText::has_text() const {
return _internal_has_text();
}
inline void SentencePieceText::clear_text() {
- text_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.text_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& SentencePieceText::text() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.text)
return _internal_text();
}
-inline void SentencePieceText::set_text(const std::string& value) {
- _internal_set_text(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText::set_text(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.text_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.text)
}
inline std::string* SentencePieceText::mutable_text() {
+ std::string* _s = _internal_mutable_text();
// @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.text)
- return _internal_mutable_text();
+ return _s;
}
inline const std::string& SentencePieceText::_internal_text() const {
- return text_.Get();
+ return _impl_.text_.Get();
}
inline void SentencePieceText::_internal_set_text(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText::set_text(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- text_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.text)
-}
-inline void SentencePieceText::set_text(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.text)
-}
-inline void SentencePieceText::set_text(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.text)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.text_.Set(value, GetArenaForAllocation());
}
inline std::string* SentencePieceText::_internal_mutable_text() {
- _has_bits_[0] |= 0x00000001u;
- return text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.text_.Mutable(GetArenaForAllocation());
}
inline std::string* SentencePieceText::release_text() {
// @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.text)
if (!_internal_has_text()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return text_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.text_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.text_.IsDefault()) {
+ _impl_.text_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void SentencePieceText::set_allocated_text(std::string* text) {
if (text != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ }
+ _impl_.text_.SetAllocated(text, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.text_.IsDefault()) {
+ _impl_.text_.Set("", GetArenaForAllocation());
}
- text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.text)
}
// repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
inline int SentencePieceText::_internal_pieces_size() const {
- return pieces_.size();
+ return _impl_.pieces_.size();
}
inline int SentencePieceText::pieces_size() const {
return _internal_pieces_size();
}
inline void SentencePieceText::clear_pieces() {
- pieces_.Clear();
+ _impl_.pieces_.Clear();
}
inline ::sentencepiece::SentencePieceText_SentencePiece* SentencePieceText::mutable_pieces(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.pieces)
- return pieces_.Mutable(index);
+ return _impl_.pieces_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText_SentencePiece >*
SentencePieceText::mutable_pieces() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.SentencePieceText.pieces)
- return &pieces_;
+ return &_impl_.pieces_;
}
inline const ::sentencepiece::SentencePieceText_SentencePiece& SentencePieceText::_internal_pieces(int index) const {
- return pieces_.Get(index);
+ return _impl_.pieces_.Get(index);
}
inline const ::sentencepiece::SentencePieceText_SentencePiece& SentencePieceText::pieces(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.pieces)
return _internal_pieces(index);
}
inline ::sentencepiece::SentencePieceText_SentencePiece* SentencePieceText::_internal_add_pieces() {
- return pieces_.Add();
+ return _impl_.pieces_.Add();
}
inline ::sentencepiece::SentencePieceText_SentencePiece* SentencePieceText::add_pieces() {
+ ::sentencepiece::SentencePieceText_SentencePiece* _add = _internal_add_pieces();
// @@protoc_insertion_point(field_add:sentencepiece.SentencePieceText.pieces)
- return _internal_add_pieces();
+ return _add;
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText_SentencePiece >&
SentencePieceText::pieces() const {
// @@protoc_insertion_point(field_list:sentencepiece.SentencePieceText.pieces)
- return pieces_;
+ return _impl_.pieces_;
}
// optional float score = 3;
inline bool SentencePieceText::_internal_has_score() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool SentencePieceText::has_score() const {
return _internal_has_score();
}
inline void SentencePieceText::clear_score() {
- score_ = 0;
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.score_ = 0;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline float SentencePieceText::_internal_score() const {
- return score_;
+ return _impl_.score_;
}
inline float SentencePieceText::score() const {
// @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.score)
return _internal_score();
}
inline void SentencePieceText::_internal_set_score(float value) {
- _has_bits_[0] |= 0x00000002u;
- score_ = value;
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.score_ = value;
}
inline void SentencePieceText::set_score(float value) {
_internal_set_score(value);
@@ -986,41 +1362,42 @@ inline void SentencePieceText::set_score(float value) {
// repeated .sentencepiece.SentencePieceText nbests = 1;
inline int NBestSentencePieceText::_internal_nbests_size() const {
- return nbests_.size();
+ return _impl_.nbests_.size();
}
inline int NBestSentencePieceText::nbests_size() const {
return _internal_nbests_size();
}
inline void NBestSentencePieceText::clear_nbests() {
- nbests_.Clear();
+ _impl_.nbests_.Clear();
}
inline ::sentencepiece::SentencePieceText* NBestSentencePieceText::mutable_nbests(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.NBestSentencePieceText.nbests)
- return nbests_.Mutable(index);
+ return _impl_.nbests_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText >*
NBestSentencePieceText::mutable_nbests() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.NBestSentencePieceText.nbests)
- return &nbests_;
+ return &_impl_.nbests_;
}
inline const ::sentencepiece::SentencePieceText& NBestSentencePieceText::_internal_nbests(int index) const {
- return nbests_.Get(index);
+ return _impl_.nbests_.Get(index);
}
inline const ::sentencepiece::SentencePieceText& NBestSentencePieceText::nbests(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.NBestSentencePieceText.nbests)
return _internal_nbests(index);
}
inline ::sentencepiece::SentencePieceText* NBestSentencePieceText::_internal_add_nbests() {
- return nbests_.Add();
+ return _impl_.nbests_.Add();
}
inline ::sentencepiece::SentencePieceText* NBestSentencePieceText::add_nbests() {
+ ::sentencepiece::SentencePieceText* _add = _internal_add_nbests();
// @@protoc_insertion_point(field_add:sentencepiece.NBestSentencePieceText.nbests)
- return _internal_add_nbests();
+ return _add;
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText >&
NBestSentencePieceText::nbests() const {
// @@protoc_insertion_point(field_list:sentencepiece.NBestSentencePieceText.nbests)
- return nbests_;
+ return _impl_.nbests_;
}
#ifdef __GNUC__
diff --git a/src/builtin_pb/sentencepiece_model.pb.cc b/src/builtin_pb/sentencepiece_model.pb.cc
index e913731..fd656a0 100644
--- a/src/builtin_pb/sentencepiece_model.pb.cc
+++ b/src/builtin_pb/sentencepiece_model.pb.cc
@@ -11,120 +11,154 @@
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SelfTestData_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto;
-namespace sentencepiece {
-class TrainerSpecDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TrainerSpec> _instance;
-} _TrainerSpec_default_instance_;
-class NormalizerSpecDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NormalizerSpec> _instance;
-} _NormalizerSpec_default_instance_;
-class SelfTestData_SampleDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SelfTestData_Sample> _instance;
-} _SelfTestData_Sample_default_instance_;
-class SelfTestDataDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SelfTestData> _instance;
-} _SelfTestData_default_instance_;
-class ModelProto_SentencePieceDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelProto_SentencePiece> _instance;
-} _ModelProto_SentencePiece_default_instance_;
-class ModelProtoDefaultTypeInternal {
- public:
- ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelProto> _instance;
-} _ModelProto_default_instance_;
-} // namespace sentencepiece
-static void InitDefaultsscc_info_ModelProto_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_ModelProto_default_instance_;
- new (ptr) ::sentencepiece::ModelProto();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_ModelProto_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, 0, InitDefaultsscc_info_ModelProto_sentencepiece_5fmodel_2eproto}, {
- &scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base,
- &scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base,
- &scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base,
- &scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base,}};
-
-static void InitDefaultsscc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_ModelProto_SentencePiece_default_instance_;
- new (ptr) ::sentencepiece::ModelProto_SentencePiece();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto}, {}};
-
-static void InitDefaultsscc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_NormalizerSpec_default_instance_;
- new (ptr) ::sentencepiece::NormalizerSpec();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto}, {}};
+PROTOBUF_PRAGMA_INIT_SEG
-static void InitDefaultsscc_info_SelfTestData_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_SelfTestData_default_instance_;
- new (ptr) ::sentencepiece::SelfTestData();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SelfTestData_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_SelfTestData_sentencepiece_5fmodel_2eproto}, {
- &scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base,}};
-
-static void InitDefaultsscc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_SelfTestData_Sample_default_instance_;
- new (ptr) ::sentencepiece::SelfTestData_Sample();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto}, {}};
-
-static void InitDefaultsscc_info_TrainerSpec_sentencepiece_5fmodel_2eproto() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
-
- {
- void* ptr = &::sentencepiece::_TrainerSpec_default_instance_;
- new (ptr) ::sentencepiece::TrainerSpec();
- ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
- }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto =
- {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_TrainerSpec_sentencepiece_5fmodel_2eproto}, {}};
+namespace _pb = ::PROTOBUF_NAMESPACE_ID;
+namespace _pbi = _pb::internal;
+namespace sentencepiece {
+PROTOBUF_CONSTEXPR TrainerSpec::TrainerSpec(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.input_)*/{}
+ , /*decltype(_impl_.accept_language_)*/{}
+ , /*decltype(_impl_.control_symbols_)*/{}
+ , /*decltype(_impl_.user_defined_symbols_)*/{}
+ , /*decltype(_impl_.model_prefix_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.input_format_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.required_chars_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.unk_surface_)*/{nullptr, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.unk_piece_)*/{nullptr, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.bos_piece_)*/{nullptr, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.eos_piece_)*/{nullptr, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.pad_piece_)*/{nullptr, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.self_test_sample_size_)*/0
+ , /*decltype(_impl_.mining_sentence_size_)*/0
+ , /*decltype(_impl_.input_sentence_size_)*/uint64_t{0u}
+ , /*decltype(_impl_.training_sentence_size_)*/0
+ , /*decltype(_impl_.treat_whitespace_as_suffix_)*/false
+ , /*decltype(_impl_.allow_whitespace_only_pieces_)*/false
+ , /*decltype(_impl_.split_digits_)*/false
+ , /*decltype(_impl_.byte_fallback_)*/false
+ , /*decltype(_impl_.unk_id_)*/0
+ , /*decltype(_impl_.use_all_vocab_)*/false
+ , /*decltype(_impl_.train_extremely_large_corpus_)*/false
+ , /*decltype(_impl_.model_type_)*/1
+ , /*decltype(_impl_.vocab_size_)*/8000
+ , /*decltype(_impl_.character_coverage_)*/0.9995f
+ , /*decltype(_impl_.seed_sentencepiece_size_)*/1000000
+ , /*decltype(_impl_.shrinking_factor_)*/0.75f
+ , /*decltype(_impl_.num_threads_)*/16
+ , /*decltype(_impl_.num_sub_iterations_)*/2
+ , /*decltype(_impl_.max_sentence_length_)*/4192
+ , /*decltype(_impl_.max_sentencepiece_length_)*/16
+ , /*decltype(_impl_.shuffle_input_sentence_)*/true
+ , /*decltype(_impl_.split_by_unicode_script_)*/true
+ , /*decltype(_impl_.split_by_number_)*/true
+ , /*decltype(_impl_.split_by_whitespace_)*/true
+ , /*decltype(_impl_.vocabulary_output_piece_score_)*/true
+ , /*decltype(_impl_.hard_vocab_limit_)*/true
+ , /*decltype(_impl_.bos_id_)*/1
+ , /*decltype(_impl_.eos_id_)*/2
+ , /*decltype(_impl_.pad_id_)*/-1} {}
+struct TrainerSpecDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR TrainerSpecDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~TrainerSpecDefaultTypeInternal() {}
+ union {
+ TrainerSpec _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrainerSpecDefaultTypeInternal _TrainerSpec_default_instance_;
+PROTOBUF_CONSTEXPR NormalizerSpec::NormalizerSpec(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.precompiled_charsmap_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.normalization_rule_tsv_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.add_dummy_prefix_)*/true
+ , /*decltype(_impl_.remove_extra_whitespaces_)*/true
+ , /*decltype(_impl_.escape_whitespaces_)*/true} {}
+struct NormalizerSpecDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR NormalizerSpecDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~NormalizerSpecDefaultTypeInternal() {}
+ union {
+ NormalizerSpec _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NormalizerSpecDefaultTypeInternal _NormalizerSpec_default_instance_;
+PROTOBUF_CONSTEXPR SelfTestData_Sample::SelfTestData_Sample(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.input_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.expected_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
+struct SelfTestData_SampleDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR SelfTestData_SampleDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~SelfTestData_SampleDefaultTypeInternal() {}
+ union {
+ SelfTestData_Sample _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelfTestData_SampleDefaultTypeInternal _SelfTestData_Sample_default_instance_;
+PROTOBUF_CONSTEXPR SelfTestData::SelfTestData(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_.samples_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}} {}
+struct SelfTestDataDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR SelfTestDataDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~SelfTestDataDefaultTypeInternal() {}
+ union {
+ SelfTestData _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelfTestDataDefaultTypeInternal _SelfTestData_default_instance_;
+PROTOBUF_CONSTEXPR ModelProto_SentencePiece::ModelProto_SentencePiece(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.piece_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
+ , /*decltype(_impl_.score_)*/0
+ , /*decltype(_impl_.type_)*/1} {}
+struct ModelProto_SentencePieceDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR ModelProto_SentencePieceDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~ModelProto_SentencePieceDefaultTypeInternal() {}
+ union {
+ ModelProto_SentencePiece _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ModelProto_SentencePieceDefaultTypeInternal _ModelProto_SentencePiece_default_instance_;
+PROTOBUF_CONSTEXPR ModelProto::ModelProto(
+ ::_pbi::ConstantInitialized): _impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , /*decltype(_impl_._has_bits_)*/{}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , /*decltype(_impl_.pieces_)*/{}
+ , /*decltype(_impl_.trainer_spec_)*/nullptr
+ , /*decltype(_impl_.normalizer_spec_)*/nullptr
+ , /*decltype(_impl_.self_test_data_)*/nullptr
+ , /*decltype(_impl_.denormalizer_spec_)*/nullptr} {}
+struct ModelProtoDefaultTypeInternal {
+ PROTOBUF_CONSTEXPR ModelProtoDefaultTypeInternal()
+ : _instance(::_pbi::ConstantInitialized{}) {}
+ ~ModelProtoDefaultTypeInternal() {}
+ union {
+ ModelProto _instance;
+ };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
+} // namespace sentencepiece
namespace sentencepiece {
bool TrainerSpec_ModelType_IsValid(int value) {
switch (value) {
@@ -185,7 +219,7 @@ bool TrainerSpec_ModelType_Parse(
}
return success;
}
-#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr TrainerSpec_ModelType TrainerSpec::UNIGRAM;
constexpr TrainerSpec_ModelType TrainerSpec::BPE;
constexpr TrainerSpec_ModelType TrainerSpec::WORD;
@@ -193,7 +227,7 @@ constexpr TrainerSpec_ModelType TrainerSpec::CHAR;
constexpr TrainerSpec_ModelType TrainerSpec::ModelType_MIN;
constexpr TrainerSpec_ModelType TrainerSpec::ModelType_MAX;
constexpr int TrainerSpec::ModelType_ARRAYSIZE;
-#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
bool ModelProto_SentencePiece_Type_IsValid(int value) {
switch (value) {
case 1:
@@ -261,7 +295,7 @@ bool ModelProto_SentencePiece_Type_Parse(
}
return success;
}
-#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::NORMAL;
constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::UNKNOWN;
constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::CONTROL;
@@ -271,13 +305,13 @@ constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::UNUSED;
constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::Type_MIN;
constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::Type_MAX;
constexpr int ModelProto_SentencePiece::Type_ARRAYSIZE;
-#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================
class TrainerSpec::_Internal {
public:
- using HasBits = decltype(std::declval<TrainerSpec>()._has_bits_);
+ using HasBits = decltype(std::declval<TrainerSpec>()._impl_._has_bits_);
static void set_has_input_format(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
@@ -391,610 +425,728 @@ class TrainerSpec::_Internal {
}
};
-const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_{{{"<unk>", 5}}, {nullptr}};
-const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_{{{"<s>", 3}}, {nullptr}};
-const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_{{{"</s>", 4}}, {nullptr}};
-const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_{{{"<pad>", 5}}, {nullptr}};
-const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_{{{" \342\201\207 ", 5}}, {nullptr}};
-TrainerSpec::TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena),
- input_(arena),
- accept_language_(arena),
- control_symbols_(arena),
- user_defined_symbols_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_piece_{{{"<unk>", 5}}, {nullptr}};
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_bos_piece_{{{"<s>", 3}}, {nullptr}};
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_eos_piece_{{{"</s>", 4}}, {nullptr}};
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_pad_piece_{{{"<pad>", 5}}, {nullptr}};
+const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_surface_{{{" \342\201\207 ", 5}}, {nullptr}};
+TrainerSpec::TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.TrainerSpec)
}
TrainerSpec::TrainerSpec(const TrainerSpec& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_),
- input_(from.input_),
- accept_language_(from.accept_language_),
- control_symbols_(from.control_symbols_),
- user_defined_symbols_(from.user_defined_symbols_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ TrainerSpec* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.input_){from._impl_.input_}
+ , decltype(_impl_.accept_language_){from._impl_.accept_language_}
+ , decltype(_impl_.control_symbols_){from._impl_.control_symbols_}
+ , decltype(_impl_.user_defined_symbols_){from._impl_.user_defined_symbols_}
+ , decltype(_impl_.model_prefix_){}
+ , decltype(_impl_.input_format_){}
+ , decltype(_impl_.required_chars_){}
+ , decltype(_impl_.unk_surface_){}
+ , decltype(_impl_.unk_piece_){}
+ , decltype(_impl_.bos_piece_){}
+ , decltype(_impl_.eos_piece_){}
+ , decltype(_impl_.pad_piece_){}
+ , decltype(_impl_.self_test_sample_size_){}
+ , decltype(_impl_.mining_sentence_size_){}
+ , decltype(_impl_.input_sentence_size_){}
+ , decltype(_impl_.training_sentence_size_){}
+ , decltype(_impl_.treat_whitespace_as_suffix_){}
+ , decltype(_impl_.allow_whitespace_only_pieces_){}
+ , decltype(_impl_.split_digits_){}
+ , decltype(_impl_.byte_fallback_){}
+ , decltype(_impl_.unk_id_){}
+ , decltype(_impl_.use_all_vocab_){}
+ , decltype(_impl_.train_extremely_large_corpus_){}
+ , decltype(_impl_.model_type_){}
+ , decltype(_impl_.vocab_size_){}
+ , decltype(_impl_.character_coverage_){}
+ , decltype(_impl_.seed_sentencepiece_size_){}
+ , decltype(_impl_.shrinking_factor_){}
+ , decltype(_impl_.num_threads_){}
+ , decltype(_impl_.num_sub_iterations_){}
+ , decltype(_impl_.max_sentence_length_){}
+ , decltype(_impl_.max_sentencepiece_length_){}
+ , decltype(_impl_.shuffle_input_sentence_){}
+ , decltype(_impl_.split_by_unicode_script_){}
+ , decltype(_impl_.split_by_number_){}
+ , decltype(_impl_.split_by_whitespace_){}
+ , decltype(_impl_.vocabulary_output_piece_score_){}
+ , decltype(_impl_.hard_vocab_limit_){}
+ , decltype(_impl_.bos_id_){}
+ , decltype(_impl_.eos_id_){}
+ , decltype(_impl_.pad_id_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
- model_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _impl_.model_prefix_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.model_prefix_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_model_prefix()) {
- model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_model_prefix(),
- GetArena());
+ _this->_impl_.model_prefix_.Set(from._internal_model_prefix(),
+ _this->GetArenaForAllocation());
}
- input_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.input_format_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.input_format_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_input_format()) {
- input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_input_format(),
- GetArena());
+ _this->_impl_.input_format_.Set(from._internal_input_format(),
+ _this->GetArenaForAllocation());
}
- required_chars_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.required_chars_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.required_chars_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_required_chars()) {
- required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_required_chars(),
- GetArena());
+ _this->_impl_.required_chars_.Set(from._internal_required_chars(),
+ _this->GetArenaForAllocation());
}
- unk_surface_.UnsafeSetDefault(nullptr);
+ _impl_.unk_surface_.InitDefault();
if (from._internal_has_unk_surface()) {
- unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_unk_surface(),
- GetArena());
+ _this->_impl_.unk_surface_.Set(from._internal_unk_surface(),
+ _this->GetArenaForAllocation());
}
- unk_piece_.UnsafeSetDefault(nullptr);
+ _impl_.unk_piece_.InitDefault();
if (from._internal_has_unk_piece()) {
- unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_unk_piece(),
- GetArena());
+ _this->_impl_.unk_piece_.Set(from._internal_unk_piece(),
+ _this->GetArenaForAllocation());
}
- bos_piece_.UnsafeSetDefault(nullptr);
+ _impl_.bos_piece_.InitDefault();
if (from._internal_has_bos_piece()) {
- bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_bos_piece(),
- GetArena());
+ _this->_impl_.bos_piece_.Set(from._internal_bos_piece(),
+ _this->GetArenaForAllocation());
}
- eos_piece_.UnsafeSetDefault(nullptr);
+ _impl_.eos_piece_.InitDefault();
if (from._internal_has_eos_piece()) {
- eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_eos_piece(),
- GetArena());
+ _this->_impl_.eos_piece_.Set(from._internal_eos_piece(),
+ _this->GetArenaForAllocation());
}
- pad_piece_.UnsafeSetDefault(nullptr);
+ _impl_.pad_piece_.InitDefault();
if (from._internal_has_pad_piece()) {
- pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_pad_piece(),
- GetArena());
+ _this->_impl_.pad_piece_.Set(from._internal_pad_piece(),
+ _this->GetArenaForAllocation());
}
- ::memcpy(&self_test_sample_size_, &from.self_test_sample_size_,
- static_cast<size_t>(reinterpret_cast<char*>(&pad_id_) -
- reinterpret_cast<char*>(&self_test_sample_size_)) + sizeof(pad_id_));
+ ::memcpy(&_impl_.self_test_sample_size_, &from._impl_.self_test_sample_size_,
+ static_cast<size_t>(reinterpret_cast<char*>(&_impl_.pad_id_) -
+ reinterpret_cast<char*>(&_impl_.self_test_sample_size_)) + sizeof(_impl_.pad_id_));
// @@protoc_insertion_point(copy_constructor:sentencepiece.TrainerSpec)
}
-void TrainerSpec::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base);
- model_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- input_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- required_chars_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- unk_surface_.UnsafeSetDefault(nullptr);
- unk_piece_.UnsafeSetDefault(nullptr);
- bos_piece_.UnsafeSetDefault(nullptr);
- eos_piece_.UnsafeSetDefault(nullptr);
- pad_piece_.UnsafeSetDefault(nullptr);
- ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
- reinterpret_cast<char*>(&self_test_sample_size_) - reinterpret_cast<char*>(this)),
- 0, static_cast<size_t>(reinterpret_cast<char*>(&train_extremely_large_corpus_) -
- reinterpret_cast<char*>(&self_test_sample_size_)) + sizeof(train_extremely_large_corpus_));
- model_type_ = 1;
- vocab_size_ = 8000;
- character_coverage_ = 0.9995f;
- seed_sentencepiece_size_ = 1000000;
- shrinking_factor_ = 0.75f;
- num_threads_ = 16;
- num_sub_iterations_ = 2;
- max_sentence_length_ = 4192;
- max_sentencepiece_length_ = 16;
- shuffle_input_sentence_ = true;
- split_by_unicode_script_ = true;
- split_by_number_ = true;
- split_by_whitespace_ = true;
- vocabulary_output_piece_score_ = true;
- hard_vocab_limit_ = true;
- bos_id_ = 1;
- eos_id_ = 2;
- pad_id_ = -1;
+inline void TrainerSpec::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.input_){arena}
+ , decltype(_impl_.accept_language_){arena}
+ , decltype(_impl_.control_symbols_){arena}
+ , decltype(_impl_.user_defined_symbols_){arena}
+ , decltype(_impl_.model_prefix_){}
+ , decltype(_impl_.input_format_){}
+ , decltype(_impl_.required_chars_){}
+ , decltype(_impl_.unk_surface_){}
+ , decltype(_impl_.unk_piece_){}
+ , decltype(_impl_.bos_piece_){}
+ , decltype(_impl_.eos_piece_){}
+ , decltype(_impl_.pad_piece_){}
+ , decltype(_impl_.self_test_sample_size_){0}
+ , decltype(_impl_.mining_sentence_size_){0}
+ , decltype(_impl_.input_sentence_size_){uint64_t{0u}}
+ , decltype(_impl_.training_sentence_size_){0}
+ , decltype(_impl_.treat_whitespace_as_suffix_){false}
+ , decltype(_impl_.allow_whitespace_only_pieces_){false}
+ , decltype(_impl_.split_digits_){false}
+ , decltype(_impl_.byte_fallback_){false}
+ , decltype(_impl_.unk_id_){0}
+ , decltype(_impl_.use_all_vocab_){false}
+ , decltype(_impl_.train_extremely_large_corpus_){false}
+ , decltype(_impl_.model_type_){1}
+ , decltype(_impl_.vocab_size_){8000}
+ , decltype(_impl_.character_coverage_){0.9995f}
+ , decltype(_impl_.seed_sentencepiece_size_){1000000}
+ , decltype(_impl_.shrinking_factor_){0.75f}
+ , decltype(_impl_.num_threads_){16}
+ , decltype(_impl_.num_sub_iterations_){2}
+ , decltype(_impl_.max_sentence_length_){4192}
+ , decltype(_impl_.max_sentencepiece_length_){16}
+ , decltype(_impl_.shuffle_input_sentence_){true}
+ , decltype(_impl_.split_by_unicode_script_){true}
+ , decltype(_impl_.split_by_number_){true}
+ , decltype(_impl_.split_by_whitespace_){true}
+ , decltype(_impl_.vocabulary_output_piece_score_){true}
+ , decltype(_impl_.hard_vocab_limit_){true}
+ , decltype(_impl_.bos_id_){1}
+ , decltype(_impl_.eos_id_){2}
+ , decltype(_impl_.pad_id_){-1}
+ };
+ _impl_.model_prefix_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.model_prefix_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.input_format_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.input_format_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.required_chars_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.required_chars_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.unk_surface_.InitDefault();
+ _impl_.unk_piece_.InitDefault();
+ _impl_.bos_piece_.InitDefault();
+ _impl_.eos_piece_.InitDefault();
+ _impl_.pad_piece_.InitDefault();
}
TrainerSpec::~TrainerSpec() {
// @@protoc_insertion_point(destructor:sentencepiece.TrainerSpec)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void TrainerSpec::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- model_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- input_format_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- required_chars_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- unk_surface_.DestroyNoArena(nullptr);
- unk_piece_.DestroyNoArena(nullptr);
- bos_piece_.DestroyNoArena(nullptr);
- eos_piece_.DestroyNoArena(nullptr);
- pad_piece_.DestroyNoArena(nullptr);
+inline void TrainerSpec::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.input_.~RepeatedPtrField();
+ _impl_.accept_language_.~RepeatedPtrField();
+ _impl_.control_symbols_.~RepeatedPtrField();
+ _impl_.user_defined_symbols_.~RepeatedPtrField();
+ _impl_.model_prefix_.Destroy();
+ _impl_.input_format_.Destroy();
+ _impl_.required_chars_.Destroy();
+ _impl_.unk_surface_.Destroy();
+ _impl_.unk_piece_.Destroy();
+ _impl_.bos_piece_.Destroy();
+ _impl_.eos_piece_.Destroy();
+ _impl_.pad_piece_.Destroy();
}
-void TrainerSpec::ArenaDtor(void* object) {
- TrainerSpec* _this = reinterpret_cast< TrainerSpec* >(object);
- (void)_this;
-}
-void TrainerSpec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void TrainerSpec::SetCachedSize(int size) const {
- _cached_size_.Set(size);
-}
-const TrainerSpec& TrainerSpec::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
+ _impl_._cached_size_.Set(size);
}
-
void TrainerSpec::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.TrainerSpec)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- input_.Clear();
- accept_language_.Clear();
- control_symbols_.Clear();
- user_defined_symbols_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ _impl_.input_.Clear();
+ _impl_.accept_language_.Clear();
+ _impl_.control_symbols_.Clear();
+ _impl_.user_defined_symbols_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x000000ffu) {
if (cached_has_bits & 0x00000001u) {
- model_prefix_.ClearNonDefaultToEmpty();
+ _impl_.model_prefix_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
- input_format_.ClearNonDefaultToEmpty();
+ _impl_.input_format_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000004u) {
- required_chars_.ClearNonDefaultToEmpty();
+ _impl_.required_chars_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000008u) {
- unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
+ _impl_.unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
}
if (cached_has_bits & 0x00000010u) {
- unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
+ _impl_.unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
}
if (cached_has_bits & 0x00000020u) {
- bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
+ _impl_.bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
}
if (cached_has_bits & 0x00000040u) {
- eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
+ _impl_.eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
}
if (cached_has_bits & 0x00000080u) {
- pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
+ _impl_.pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
}
}
if (cached_has_bits & 0x0000ff00u) {
- ::memset(&self_test_sample_size_, 0, static_cast<size_t>(
- reinterpret_cast<char*>(&byte_fallback_) -
- reinterpret_cast<char*>(&self_test_sample_size_)) + sizeof(byte_fallback_));
+ ::memset(&_impl_.self_test_sample_size_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&_impl_.byte_fallback_) -
+ reinterpret_cast<char*>(&_impl_.self_test_sample_size_)) + sizeof(_impl_.byte_fallback_));
}
if (cached_has_bits & 0x00ff0000u) {
- ::memset(&unk_id_, 0, static_cast<size_t>(
- reinterpret_cast<char*>(&train_extremely_large_corpus_) -
- reinterpret_cast<char*>(&unk_id_)) + sizeof(train_extremely_large_corpus_));
- model_type_ = 1;
- vocab_size_ = 8000;
- character_coverage_ = 0.9995f;
- seed_sentencepiece_size_ = 1000000;
- shrinking_factor_ = 0.75f;
+ ::memset(&_impl_.unk_id_, 0, static_cast<size_t>(
+ reinterpret_cast<char*>(&_impl_.train_extremely_large_corpus_) -
+ reinterpret_cast<char*>(&_impl_.unk_id_)) + sizeof(_impl_.train_extremely_large_corpus_));
+ _impl_.model_type_ = 1;
+ _impl_.vocab_size_ = 8000;
+ _impl_.character_coverage_ = 0.9995f;
+ _impl_.seed_sentencepiece_size_ = 1000000;
+ _impl_.shrinking_factor_ = 0.75f;
}
if (cached_has_bits & 0xff000000u) {
- num_threads_ = 16;
- num_sub_iterations_ = 2;
- max_sentence_length_ = 4192;
- max_sentencepiece_length_ = 16;
- shuffle_input_sentence_ = true;
- split_by_unicode_script_ = true;
- split_by_number_ = true;
- split_by_whitespace_ = true;
- }
- cached_has_bits = _has_bits_[1];
+ _impl_.num_threads_ = 16;
+ _impl_.num_sub_iterations_ = 2;
+ _impl_.max_sentence_length_ = 4192;
+ _impl_.max_sentencepiece_length_ = 16;
+ _impl_.shuffle_input_sentence_ = true;
+ _impl_.split_by_unicode_script_ = true;
+ _impl_.split_by_number_ = true;
+ _impl_.split_by_whitespace_ = true;
+ }
+ cached_has_bits = _impl_._has_bits_[1];
if (cached_has_bits & 0x0000001fu) {
- vocabulary_output_piece_score_ = true;
- hard_vocab_limit_ = true;
- bos_id_ = 1;
- eos_id_ = 2;
- pad_id_ = -1;
+ _impl_.vocabulary_output_piece_score_ = true;
+ _impl_.hard_vocab_limit_ = true;
+ _impl_.bos_id_ = 1;
+ _impl_.eos_id_ = 2;
+ _impl_.pad_id_ = -1;
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* TrainerSpec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* TrainerSpec::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// repeated string input = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
auto str = _internal_add_input();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string model_prefix = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_model_prefix();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+ uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::sentencepiece::TrainerSpec_ModelType_IsValid(val))) {
_internal_set_model_type(static_cast<::sentencepiece::TrainerSpec_ModelType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
}
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 vocab_size = 4 [default = 8000];
case 4:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
- _Internal::set_has_vocab_size(&_has_bits_);
- vocab_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
+ _Internal::set_has_vocab_size(&_impl_._has_bits_);
+ _impl_.vocab_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// repeated string accept_language = 5;
case 5:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
ptr -= 1;
do {
ptr += 1;
auto str = _internal_add_accept_language();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 self_test_sample_size = 6 [default = 0];
case 6:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
- _Internal::set_has_self_test_sample_size(&_has_bits_);
- self_test_sample_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
+ _Internal::set_has_self_test_sample_size(&_impl_._has_bits_);
+ _impl_.self_test_sample_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string input_format = 7;
case 7:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
auto str = _internal_mutable_input_format();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional float character_coverage = 10 [default = 0.9995];
case 10:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 85)) {
- _Internal::set_has_character_coverage(&_has_bits_);
- character_coverage_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 85)) {
+ _Internal::set_has_character_coverage(&_impl_._has_bits_);
+ _impl_.character_coverage_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional uint64 input_sentence_size = 11 [default = 0];
case 11:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
- _Internal::set_has_input_sentence_size(&_has_bits_);
- input_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+ _Internal::set_has_input_sentence_size(&_impl_._has_bits_);
+ _impl_.input_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 mining_sentence_size = 12 [deprecated = true];
case 12:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
- _Internal::set_has_mining_sentence_size(&_has_bits_);
- mining_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
+ _Internal::set_has_mining_sentence_size(&_impl_._has_bits_);
+ _impl_.mining_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 training_sentence_size = 13 [deprecated = true];
case 13:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) {
- _Internal::set_has_training_sentence_size(&_has_bits_);
- training_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
+ _Internal::set_has_training_sentence_size(&_impl_._has_bits_);
+ _impl_.training_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 seed_sentencepiece_size = 14 [default = 1000000];
case 14:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
- _Internal::set_has_seed_sentencepiece_size(&_has_bits_);
- seed_sentencepiece_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
+ _Internal::set_has_seed_sentencepiece_size(&_impl_._has_bits_);
+ _impl_.seed_sentencepiece_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional float shrinking_factor = 15 [default = 0.75];
case 15:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 125)) {
- _Internal::set_has_shrinking_factor(&_has_bits_);
- shrinking_factor_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 125)) {
+ _Internal::set_has_shrinking_factor(&_impl_._has_bits_);
+ _impl_.shrinking_factor_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 num_threads = 16 [default = 16];
case 16:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) {
- _Internal::set_has_num_threads(&_has_bits_);
- num_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
+ _Internal::set_has_num_threads(&_impl_._has_bits_);
+ _impl_.num_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 num_sub_iterations = 17 [default = 2];
case 17:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
- _Internal::set_has_num_sub_iterations(&_has_bits_);
- num_sub_iterations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+ _Internal::set_has_num_sub_iterations(&_impl_._has_bits_);
+ _impl_.num_sub_iterations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 max_sentence_length = 18 [default = 4192];
case 18:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
- _Internal::set_has_max_sentence_length(&_has_bits_);
- max_sentence_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
+ _Internal::set_has_max_sentence_length(&_impl_._has_bits_);
+ _impl_.max_sentence_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool shuffle_input_sentence = 19 [default = true];
case 19:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
- _Internal::set_has_shuffle_input_sentence(&_has_bits_);
- shuffle_input_sentence_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
+ _Internal::set_has_shuffle_input_sentence(&_impl_._has_bits_);
+ _impl_.shuffle_input_sentence_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 max_sentencepiece_length = 20 [default = 16];
case 20:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
- _Internal::set_has_max_sentencepiece_length(&_has_bits_);
- max_sentencepiece_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
+ _Internal::set_has_max_sentencepiece_length(&_impl_._has_bits_);
+ _impl_.max_sentencepiece_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool split_by_unicode_script = 21 [default = true];
case 21:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 168)) {
- _Internal::set_has_split_by_unicode_script(&_has_bits_);
- split_by_unicode_script_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
+ _Internal::set_has_split_by_unicode_script(&_impl_._has_bits_);
+ _impl_.split_by_unicode_script_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool split_by_whitespace = 22 [default = true];
case 22:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 176)) {
- _Internal::set_has_split_by_whitespace(&_has_bits_);
- split_by_whitespace_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 176)) {
+ _Internal::set_has_split_by_whitespace(&_impl_._has_bits_);
+ _impl_.split_by_whitespace_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool split_by_number = 23 [default = true];
case 23:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 184)) {
- _Internal::set_has_split_by_number(&_has_bits_);
- split_by_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 184)) {
+ _Internal::set_has_split_by_number(&_impl_._has_bits_);
+ _impl_.split_by_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool treat_whitespace_as_suffix = 24 [default = false];
case 24:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 192)) {
- _Internal::set_has_treat_whitespace_as_suffix(&_has_bits_);
- treat_whitespace_as_suffix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 192)) {
+ _Internal::set_has_treat_whitespace_as_suffix(&_impl_._has_bits_);
+ _impl_.treat_whitespace_as_suffix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool split_digits = 25 [default = false];
case 25:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
- _Internal::set_has_split_digits(&_has_bits_);
- split_digits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 200)) {
+ _Internal::set_has_split_digits(&_impl_._has_bits_);
+ _impl_.split_digits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool allow_whitespace_only_pieces = 26 [default = false];
case 26:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
- _Internal::set_has_allow_whitespace_only_pieces(&_has_bits_);
- allow_whitespace_only_pieces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 208)) {
+ _Internal::set_has_allow_whitespace_only_pieces(&_impl_._has_bits_);
+ _impl_.allow_whitespace_only_pieces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// repeated string control_symbols = 30;
case 30:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 242)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
ptr -= 2;
do {
ptr += 2;
auto str = _internal_add_control_symbols();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<242>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// repeated string user_defined_symbols = 31;
case 31:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 250)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 250)) {
ptr -= 2;
do {
ptr += 2;
auto str = _internal_add_user_defined_symbols();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<250>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool vocabulary_output_piece_score = 32 [default = true];
case 32:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 0)) {
- _Internal::set_has_vocabulary_output_piece_score(&_has_bits_);
- vocabulary_output_piece_score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 0)) {
+ _Internal::set_has_vocabulary_output_piece_score(&_impl_._has_bits_);
+ _impl_.vocabulary_output_piece_score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool hard_vocab_limit = 33 [default = true];
case 33:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
- _Internal::set_has_hard_vocab_limit(&_has_bits_);
- hard_vocab_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
+ _Internal::set_has_hard_vocab_limit(&_impl_._has_bits_);
+ _impl_.hard_vocab_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool use_all_vocab = 34 [default = false];
case 34:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
- _Internal::set_has_use_all_vocab(&_has_bits_);
- use_all_vocab_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
+ _Internal::set_has_use_all_vocab(&_impl_._has_bits_);
+ _impl_.use_all_vocab_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool byte_fallback = 35 [default = false];
case 35:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- _Internal::set_has_byte_fallback(&_has_bits_);
- byte_fallback_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+ _Internal::set_has_byte_fallback(&_impl_._has_bits_);
+ _impl_.byte_fallback_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string required_chars = 36;
case 36:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
auto str = _internal_mutable_required_chars();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 unk_id = 40 [default = 0];
case 40:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
- _Internal::set_has_unk_id(&_has_bits_);
- unk_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
+ _Internal::set_has_unk_id(&_impl_._has_bits_);
+ _impl_.unk_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 bos_id = 41 [default = 1];
case 41:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
- _Internal::set_has_bos_id(&_has_bits_);
- bos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
+ _Internal::set_has_bos_id(&_impl_._has_bits_);
+ _impl_.bos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 eos_id = 42 [default = 2];
case 42:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
- _Internal::set_has_eos_id(&_has_bits_);
- eos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
+ _Internal::set_has_eos_id(&_impl_._has_bits_);
+ _impl_.eos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional int32 pad_id = 43 [default = -1];
case 43:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
- _Internal::set_has_pad_id(&_has_bits_);
- pad_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
+ _Internal::set_has_pad_id(&_impl_._has_bits_);
+ _impl_.pad_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string unk_surface = 44 [default = " \342\201\207 "];
case 44:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
auto str = _internal_mutable_unk_surface();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string unk_piece = 45 [default = "<unk>"];
case 45:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
auto str = _internal_mutable_unk_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string bos_piece = 46 [default = "<s>"];
case 46:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
auto str = _internal_mutable_bos_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string eos_piece = 47 [default = "</s>"];
case 47:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
auto str = _internal_mutable_eos_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string pad_piece = 48 [default = "<pad>"];
case 48:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
auto str = _internal_mutable_pad_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool train_extremely_large_corpus = 49 [default = false];
case 49:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
- _Internal::set_has_train_extremely_large_corpus(&_has_bits_);
- train_extremely_large_corpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
+ _Internal::set_has_train_extremely_large_corpus(&_impl_._has_bits_);
+ _impl_.train_extremely_large_corpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
- default: {
- handle_unusual:
- if ((tag & 7) == 4 || tag == 0) {
- ctx->SetLastTag(tag);
- goto success;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
+message_done:
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* TrainerSpec::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* TrainerSpec::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.TrainerSpec)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// repeated string input = 1;
@@ -1003,7 +1155,7 @@ failure:
target = stream->WriteString(1, s, target);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string model_prefix = 2;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -1013,14 +1165,14 @@ failure:
// optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
if (cached_has_bits & 0x00080000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+ target = ::_pbi::WireFormatLite::WriteEnumToArray(
3, this->_internal_model_type(), target);
}
// optional int32 vocab_size = 4 [default = 8000];
if (cached_has_bits & 0x00100000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_vocab_size(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_vocab_size(), target);
}
// repeated string accept_language = 5;
@@ -1032,7 +1184,7 @@ failure:
// optional int32 self_test_sample_size = 6 [default = 0];
if (cached_has_bits & 0x00000100u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_self_test_sample_size(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_self_test_sample_size(), target);
}
// optional string input_format = 7;
@@ -1044,103 +1196,103 @@ failure:
// optional float character_coverage = 10 [default = 0.9995];
if (cached_has_bits & 0x00200000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(10, this->_internal_character_coverage(), target);
+ target = ::_pbi::WireFormatLite::WriteFloatToArray(10, this->_internal_character_coverage(), target);
}
// optional uint64 input_sentence_size = 11 [default = 0];
if (cached_has_bits & 0x00000400u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(11, this->_internal_input_sentence_size(), target);
+ target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_input_sentence_size(), target);
}
// optional int32 mining_sentence_size = 12 [deprecated = true];
if (cached_has_bits & 0x00000200u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(12, this->_internal_mining_sentence_size(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_mining_sentence_size(), target);
}
// optional int32 training_sentence_size = 13 [deprecated = true];
if (cached_has_bits & 0x00000800u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(13, this->_internal_training_sentence_size(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(13, this->_internal_training_sentence_size(), target);
}
// optional int32 seed_sentencepiece_size = 14 [default = 1000000];
if (cached_has_bits & 0x00400000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(14, this->_internal_seed_sentencepiece_size(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(14, this->_internal_seed_sentencepiece_size(), target);
}
// optional float shrinking_factor = 15 [default = 0.75];
if (cached_has_bits & 0x00800000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(15, this->_internal_shrinking_factor(), target);
+ target = ::_pbi::WireFormatLite::WriteFloatToArray(15, this->_internal_shrinking_factor(), target);
}
// optional int32 num_threads = 16 [default = 16];
if (cached_has_bits & 0x01000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(16, this->_internal_num_threads(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(16, this->_internal_num_threads(), target);
}
// optional int32 num_sub_iterations = 17 [default = 2];
if (cached_has_bits & 0x02000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(17, this->_internal_num_sub_iterations(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(17, this->_internal_num_sub_iterations(), target);
}
// optional int32 max_sentence_length = 18 [default = 4192];
if (cached_has_bits & 0x04000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(18, this->_internal_max_sentence_length(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(18, this->_internal_max_sentence_length(), target);
}
// optional bool shuffle_input_sentence = 19 [default = true];
if (cached_has_bits & 0x10000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->_internal_shuffle_input_sentence(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(19, this->_internal_shuffle_input_sentence(), target);
}
// optional int32 max_sentencepiece_length = 20 [default = 16];
if (cached_has_bits & 0x08000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(20, this->_internal_max_sentencepiece_length(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(20, this->_internal_max_sentencepiece_length(), target);
}
// optional bool split_by_unicode_script = 21 [default = true];
if (cached_has_bits & 0x20000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(21, this->_internal_split_by_unicode_script(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(21, this->_internal_split_by_unicode_script(), target);
}
// optional bool split_by_whitespace = 22 [default = true];
if (cached_has_bits & 0x80000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(22, this->_internal_split_by_whitespace(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(22, this->_internal_split_by_whitespace(), target);
}
// optional bool split_by_number = 23 [default = true];
if (cached_has_bits & 0x40000000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(23, this->_internal_split_by_number(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(23, this->_internal_split_by_number(), target);
}
// optional bool treat_whitespace_as_suffix = 24 [default = false];
if (cached_has_bits & 0x00001000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(24, this->_internal_treat_whitespace_as_suffix(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(24, this->_internal_treat_whitespace_as_suffix(), target);
}
// optional bool split_digits = 25 [default = false];
if (cached_has_bits & 0x00004000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(25, this->_internal_split_digits(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(25, this->_internal_split_digits(), target);
}
// optional bool allow_whitespace_only_pieces = 26 [default = false];
if (cached_has_bits & 0x00002000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(26, this->_internal_allow_whitespace_only_pieces(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(26, this->_internal_allow_whitespace_only_pieces(), target);
}
// repeated string control_symbols = 30;
@@ -1155,30 +1307,30 @@ failure:
target = stream->WriteString(31, s, target);
}
- cached_has_bits = _has_bits_[1];
+ cached_has_bits = _impl_._has_bits_[1];
// optional bool vocabulary_output_piece_score = 32 [default = true];
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(32, this->_internal_vocabulary_output_piece_score(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(32, this->_internal_vocabulary_output_piece_score(), target);
}
// optional bool hard_vocab_limit = 33 [default = true];
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(33, this->_internal_hard_vocab_limit(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(33, this->_internal_hard_vocab_limit(), target);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional bool use_all_vocab = 34 [default = false];
if (cached_has_bits & 0x00020000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(34, this->_internal_use_all_vocab(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(34, this->_internal_use_all_vocab(), target);
}
// optional bool byte_fallback = 35 [default = false];
if (cached_has_bits & 0x00008000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(35, this->_internal_byte_fallback(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(35, this->_internal_byte_fallback(), target);
}
// optional string required_chars = 36;
@@ -1190,29 +1342,29 @@ failure:
// optional int32 unk_id = 40 [default = 0];
if (cached_has_bits & 0x00010000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(40, this->_internal_unk_id(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(40, this->_internal_unk_id(), target);
}
- cached_has_bits = _has_bits_[1];
+ cached_has_bits = _impl_._has_bits_[1];
// optional int32 bos_id = 41 [default = 1];
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(41, this->_internal_bos_id(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(41, this->_internal_bos_id(), target);
}
// optional int32 eos_id = 42 [default = 2];
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(42, this->_internal_eos_id(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(42, this->_internal_eos_id(), target);
}
// optional int32 pad_id = 43 [default = -1];
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(43, this->_internal_pad_id(), target);
+ target = ::_pbi::WireFormatLite::WriteInt32ToArray(43, this->_internal_pad_id(), target);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string unk_surface = 44 [default = " \342\201\207 "];
if (cached_has_bits & 0x00000008u) {
target = stream->WriteStringMaybeAliased(
@@ -1246,12 +1398,12 @@ failure:
// optional bool train_extremely_large_corpus = 49 [default = false];
if (cached_has_bits & 0x00040000u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(49, this->_internal_train_extremely_large_corpus(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(49, this->_internal_train_extremely_large_corpus(), target);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -1265,45 +1417,45 @@ size_t TrainerSpec::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.TrainerSpec)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated string input = 1;
total_size += 1 *
- ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(input_.size());
- for (int i = 0, n = input_.size(); i < n; i++) {
+ ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.input_.size());
+ for (int i = 0, n = _impl_.input_.size(); i < n; i++) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
- input_.Get(i));
+ _impl_.input_.Get(i));
}
// repeated string accept_language = 5;
total_size += 1 *
- ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(accept_language_.size());
- for (int i = 0, n = accept_language_.size(); i < n; i++) {
+ ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.accept_language_.size());
+ for (int i = 0, n = _impl_.accept_language_.size(); i < n; i++) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
- accept_language_.Get(i));
+ _impl_.accept_language_.Get(i));
}
// repeated string control_symbols = 30;
total_size += 2 *
- ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(control_symbols_.size());
- for (int i = 0, n = control_symbols_.size(); i < n; i++) {
+ ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.control_symbols_.size());
+ for (int i = 0, n = _impl_.control_symbols_.size(); i < n; i++) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
- control_symbols_.Get(i));
+ _impl_.control_symbols_.Get(i));
}
// repeated string user_defined_symbols = 31;
total_size += 2 *
- ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(user_defined_symbols_.size());
- for (int i = 0, n = user_defined_symbols_.size(); i < n; i++) {
+ ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.user_defined_symbols_.size());
+ for (int i = 0, n = _impl_.user_defined_symbols_.size(); i < n; i++) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
- user_defined_symbols_.Get(i));
+ _impl_.user_defined_symbols_.Get(i));
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x000000ffu) {
// optional string model_prefix = 2;
if (cached_has_bits & 0x00000001u) {
@@ -1365,30 +1517,22 @@ size_t TrainerSpec::ByteSizeLong() const {
if (cached_has_bits & 0x0000ff00u) {
// optional int32 self_test_sample_size = 6 [default = 0];
if (cached_has_bits & 0x00000100u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
- this->_internal_self_test_sample_size());
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_self_test_sample_size());
}
// optional int32 mining_sentence_size = 12 [deprecated = true];
if (cached_has_bits & 0x00000200u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
- this->_internal_mining_sentence_size());
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mining_sentence_size());
}
// optional uint64 input_sentence_size = 11 [default = 0];
if (cached_has_bits & 0x00000400u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
- this->_internal_input_sentence_size());
+ total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_input_sentence_size());
}
// optional int32 training_sentence_size = 13 [deprecated = true];
if (cached_has_bits & 0x00000800u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
- this->_internal_training_sentence_size());
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_training_sentence_size());
}
// optional bool treat_whitespace_as_suffix = 24 [default = false];
@@ -1416,7 +1560,7 @@ size_t TrainerSpec::ByteSizeLong() const {
// optional int32 unk_id = 40 [default = 0];
if (cached_has_bits & 0x00010000u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_unk_id());
}
@@ -1433,14 +1577,12 @@ size_t TrainerSpec::ByteSizeLong() const {
// optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
if (cached_has_bits & 0x00080000u) {
total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_model_type());
+ ::_pbi::WireFormatLite::EnumSize(this->_internal_model_type());
}
// optional int32 vocab_size = 4 [default = 8000];
if (cached_has_bits & 0x00100000u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
- this->_internal_vocab_size());
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vocab_size());
}
// optional float character_coverage = 10 [default = 0.9995];
@@ -1450,9 +1592,7 @@ size_t TrainerSpec::ByteSizeLong() const {
// optional int32 seed_sentencepiece_size = 14 [default = 1000000];
if (cached_has_bits & 0x00400000u) {
- total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
- this->_internal_seed_sentencepiece_size());
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_seed_sentencepiece_size());
}
// optional float shrinking_factor = 15 [default = 0.75];
@@ -1465,28 +1605,28 @@ size_t TrainerSpec::ByteSizeLong() const {
// optional int32 num_threads = 16 [default = 16];
if (cached_has_bits & 0x01000000u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_num_threads());
}
// optional int32 num_sub_iterations = 17 [default = 2];
if (cached_has_bits & 0x02000000u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_num_sub_iterations());
}
// optional int32 max_sentence_length = 18 [default = 4192];
if (cached_has_bits & 0x04000000u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_max_sentence_length());
}
// optional int32 max_sentencepiece_length = 20 [default = 16];
if (cached_has_bits & 0x08000000u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_max_sentencepiece_length());
}
@@ -1511,7 +1651,7 @@ size_t TrainerSpec::ByteSizeLong() const {
}
}
- cached_has_bits = _has_bits_[1];
+ cached_has_bits = _impl_._has_bits_[1];
if (cached_has_bits & 0x0000001fu) {
// optional bool vocabulary_output_piece_score = 32 [default = true];
if (cached_has_bits & 0x00000001u) {
@@ -1526,21 +1666,21 @@ size_t TrainerSpec::ByteSizeLong() const {
// optional int32 bos_id = 41 [default = 1];
if (cached_has_bits & 0x00000004u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_bos_id());
}
// optional int32 eos_id = 42 [default = 2];
if (cached_has_bits & 0x00000008u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_eos_id());
}
// optional int32 pad_id = 43 [default = -1];
if (cached_has_bits & 0x00000010u) {
total_size += 2 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+ ::_pbi::WireFormatLite::Int32Size(
this->_internal_pad_id());
}
@@ -1548,156 +1688,157 @@ size_t TrainerSpec::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void TrainerSpec::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const TrainerSpec*>(
+ MergeFrom(*::_pbi::DownCast<const TrainerSpec*>(
&from));
}
void TrainerSpec::MergeFrom(const TrainerSpec& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.TrainerSpec)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ TrainerSpec* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.TrainerSpec)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- input_.MergeFrom(from.input_);
- accept_language_.MergeFrom(from.accept_language_);
- control_symbols_.MergeFrom(from.control_symbols_);
- user_defined_symbols_.MergeFrom(from.user_defined_symbols_);
- cached_has_bits = from._has_bits_[0];
+ _this->_impl_.input_.MergeFrom(from._impl_.input_);
+ _this->_impl_.accept_language_.MergeFrom(from._impl_.accept_language_);
+ _this->_impl_.control_symbols_.MergeFrom(from._impl_.control_symbols_);
+ _this->_impl_.user_defined_symbols_.MergeFrom(from._impl_.user_defined_symbols_);
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x000000ffu) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_model_prefix(from._internal_model_prefix());
+ _this->_internal_set_model_prefix(from._internal_model_prefix());
}
if (cached_has_bits & 0x00000002u) {
- _internal_set_input_format(from._internal_input_format());
+ _this->_internal_set_input_format(from._internal_input_format());
}
if (cached_has_bits & 0x00000004u) {
- _internal_set_required_chars(from._internal_required_chars());
+ _this->_internal_set_required_chars(from._internal_required_chars());
}
if (cached_has_bits & 0x00000008u) {
- _internal_set_unk_surface(from._internal_unk_surface());
+ _this->_internal_set_unk_surface(from._internal_unk_surface());
}
if (cached_has_bits & 0x00000010u) {
- _internal_set_unk_piece(from._internal_unk_piece());
+ _this->_internal_set_unk_piece(from._internal_unk_piece());
}
if (cached_has_bits & 0x00000020u) {
- _internal_set_bos_piece(from._internal_bos_piece());
+ _this->_internal_set_bos_piece(from._internal_bos_piece());
}
if (cached_has_bits & 0x00000040u) {
- _internal_set_eos_piece(from._internal_eos_piece());
+ _this->_internal_set_eos_piece(from._internal_eos_piece());
}
if (cached_has_bits & 0x00000080u) {
- _internal_set_pad_piece(from._internal_pad_piece());
+ _this->_internal_set_pad_piece(from._internal_pad_piece());
}
}
if (cached_has_bits & 0x0000ff00u) {
if (cached_has_bits & 0x00000100u) {
- self_test_sample_size_ = from.self_test_sample_size_;
+ _this->_impl_.self_test_sample_size_ = from._impl_.self_test_sample_size_;
}
if (cached_has_bits & 0x00000200u) {
- mining_sentence_size_ = from.mining_sentence_size_;
+ _this->_impl_.mining_sentence_size_ = from._impl_.mining_sentence_size_;
}
if (cached_has_bits & 0x00000400u) {
- input_sentence_size_ = from.input_sentence_size_;
+ _this->_impl_.input_sentence_size_ = from._impl_.input_sentence_size_;
}
if (cached_has_bits & 0x00000800u) {
- training_sentence_size_ = from.training_sentence_size_;
+ _this->_impl_.training_sentence_size_ = from._impl_.training_sentence_size_;
}
if (cached_has_bits & 0x00001000u) {
- treat_whitespace_as_suffix_ = from.treat_whitespace_as_suffix_;
+ _this->_impl_.treat_whitespace_as_suffix_ = from._impl_.treat_whitespace_as_suffix_;
}
if (cached_has_bits & 0x00002000u) {
- allow_whitespace_only_pieces_ = from.allow_whitespace_only_pieces_;
+ _this->_impl_.allow_whitespace_only_pieces_ = from._impl_.allow_whitespace_only_pieces_;
}
if (cached_has_bits & 0x00004000u) {
- split_digits_ = from.split_digits_;
+ _this->_impl_.split_digits_ = from._impl_.split_digits_;
}
if (cached_has_bits & 0x00008000u) {
- byte_fallback_ = from.byte_fallback_;
+ _this->_impl_.byte_fallback_ = from._impl_.byte_fallback_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
if (cached_has_bits & 0x00ff0000u) {
if (cached_has_bits & 0x00010000u) {
- unk_id_ = from.unk_id_;
+ _this->_impl_.unk_id_ = from._impl_.unk_id_;
}
if (cached_has_bits & 0x00020000u) {
- use_all_vocab_ = from.use_all_vocab_;
+ _this->_impl_.use_all_vocab_ = from._impl_.use_all_vocab_;
}
if (cached_has_bits & 0x00040000u) {
- train_extremely_large_corpus_ = from.train_extremely_large_corpus_;
+ _this->_impl_.train_extremely_large_corpus_ = from._impl_.train_extremely_large_corpus_;
}
if (cached_has_bits & 0x00080000u) {
- model_type_ = from.model_type_;
+ _this->_impl_.model_type_ = from._impl_.model_type_;
}
if (cached_has_bits & 0x00100000u) {
- vocab_size_ = from.vocab_size_;
+ _this->_impl_.vocab_size_ = from._impl_.vocab_size_;
}
if (cached_has_bits & 0x00200000u) {
- character_coverage_ = from.character_coverage_;
+ _this->_impl_.character_coverage_ = from._impl_.character_coverage_;
}
if (cached_has_bits & 0x00400000u) {
- seed_sentencepiece_size_ = from.seed_sentencepiece_size_;
+ _this->_impl_.seed_sentencepiece_size_ = from._impl_.seed_sentencepiece_size_;
}
if (cached_has_bits & 0x00800000u) {
- shrinking_factor_ = from.shrinking_factor_;
+ _this->_impl_.shrinking_factor_ = from._impl_.shrinking_factor_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
if (cached_has_bits & 0xff000000u) {
if (cached_has_bits & 0x01000000u) {
- num_threads_ = from.num_threads_;
+ _this->_impl_.num_threads_ = from._impl_.num_threads_;
}
if (cached_has_bits & 0x02000000u) {
- num_sub_iterations_ = from.num_sub_iterations_;
+ _this->_impl_.num_sub_iterations_ = from._impl_.num_sub_iterations_;
}
if (cached_has_bits & 0x04000000u) {
- max_sentence_length_ = from.max_sentence_length_;
+ _this->_impl_.max_sentence_length_ = from._impl_.max_sentence_length_;
}
if (cached_has_bits & 0x08000000u) {
- max_sentencepiece_length_ = from.max_sentencepiece_length_;
+ _this->_impl_.max_sentencepiece_length_ = from._impl_.max_sentencepiece_length_;
}
if (cached_has_bits & 0x10000000u) {
- shuffle_input_sentence_ = from.shuffle_input_sentence_;
+ _this->_impl_.shuffle_input_sentence_ = from._impl_.shuffle_input_sentence_;
}
if (cached_has_bits & 0x20000000u) {
- split_by_unicode_script_ = from.split_by_unicode_script_;
+ _this->_impl_.split_by_unicode_script_ = from._impl_.split_by_unicode_script_;
}
if (cached_has_bits & 0x40000000u) {
- split_by_number_ = from.split_by_number_;
+ _this->_impl_.split_by_number_ = from._impl_.split_by_number_;
}
if (cached_has_bits & 0x80000000u) {
- split_by_whitespace_ = from.split_by_whitespace_;
+ _this->_impl_.split_by_whitespace_ = from._impl_.split_by_whitespace_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
- cached_has_bits = from._has_bits_[1];
+ cached_has_bits = from._impl_._has_bits_[1];
if (cached_has_bits & 0x0000001fu) {
if (cached_has_bits & 0x00000001u) {
- vocabulary_output_piece_score_ = from.vocabulary_output_piece_score_;
+ _this->_impl_.vocabulary_output_piece_score_ = from._impl_.vocabulary_output_piece_score_;
}
if (cached_has_bits & 0x00000002u) {
- hard_vocab_limit_ = from.hard_vocab_limit_;
+ _this->_impl_.hard_vocab_limit_ = from._impl_.hard_vocab_limit_;
}
if (cached_has_bits & 0x00000004u) {
- bos_id_ = from.bos_id_;
+ _this->_impl_.bos_id_ = from._impl_.bos_id_;
}
if (cached_has_bits & 0x00000008u) {
- eos_id_ = from.eos_id_;
+ _this->_impl_.eos_id_ = from._impl_.eos_id_;
}
if (cached_has_bits & 0x00000010u) {
- pad_id_ = from.pad_id_;
+ _this->_impl_.pad_id_ = from._impl_.pad_id_;
}
- _has_bits_[1] |= cached_has_bits;
+ _this->_impl_._has_bits_[1] |= cached_has_bits;
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void TrainerSpec::CopyFrom(const TrainerSpec& from) {
@@ -1708,7 +1849,7 @@ void TrainerSpec::CopyFrom(const TrainerSpec& from) {
}
bool TrainerSpec::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
@@ -1717,46 +1858,72 @@ bool TrainerSpec::IsInitialized() const {
void TrainerSpec::InternalSwap(TrainerSpec* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- swap(_has_bits_[1], other->_has_bits_[1]);
- input_.InternalSwap(&other->input_);
- accept_language_.InternalSwap(&other->accept_language_);
- control_symbols_.InternalSwap(&other->control_symbols_);
- user_defined_symbols_.InternalSwap(&other->user_defined_symbols_);
- model_prefix_.Swap(&other->model_prefix_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- input_format_.Swap(&other->input_format_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- required_chars_.Swap(&other->required_chars_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- unk_surface_.Swap(&other->unk_surface_, nullptr, GetArena());
- unk_piece_.Swap(&other->unk_piece_, nullptr, GetArena());
- bos_piece_.Swap(&other->bos_piece_, nullptr, GetArena());
- eos_piece_.Swap(&other->eos_piece_, nullptr, GetArena());
- pad_piece_.Swap(&other->pad_piece_, nullptr, GetArena());
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ swap(_impl_._has_bits_[1], other->_impl_._has_bits_[1]);
+ _impl_.input_.InternalSwap(&other->_impl_.input_);
+ _impl_.accept_language_.InternalSwap(&other->_impl_.accept_language_);
+ _impl_.control_symbols_.InternalSwap(&other->_impl_.control_symbols_);
+ _impl_.user_defined_symbols_.InternalSwap(&other->_impl_.user_defined_symbols_);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.model_prefix_, lhs_arena,
+ &other->_impl_.model_prefix_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.input_format_, lhs_arena,
+ &other->_impl_.input_format_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.required_chars_, lhs_arena,
+ &other->_impl_.required_chars_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.unk_surface_, lhs_arena,
+ &other->_impl_.unk_surface_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.unk_piece_, lhs_arena,
+ &other->_impl_.unk_piece_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.bos_piece_, lhs_arena,
+ &other->_impl_.bos_piece_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.eos_piece_, lhs_arena,
+ &other->_impl_.eos_piece_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.pad_piece_, lhs_arena,
+ &other->_impl_.pad_piece_, rhs_arena
+ );
::PROTOBUF_NAMESPACE_ID::internal::memswap<
- PROTOBUF_FIELD_OFFSET(TrainerSpec, train_extremely_large_corpus_)
- + sizeof(TrainerSpec::train_extremely_large_corpus_)
- - PROTOBUF_FIELD_OFFSET(TrainerSpec, self_test_sample_size_)>(
- reinterpret_cast<char*>(&self_test_sample_size_),
- reinterpret_cast<char*>(&other->self_test_sample_size_));
- swap(model_type_, other->model_type_);
- swap(vocab_size_, other->vocab_size_);
- swap(character_coverage_, other->character_coverage_);
- swap(seed_sentencepiece_size_, other->seed_sentencepiece_size_);
- swap(shrinking_factor_, other->shrinking_factor_);
- swap(num_threads_, other->num_threads_);
- swap(num_sub_iterations_, other->num_sub_iterations_);
- swap(max_sentence_length_, other->max_sentence_length_);
- swap(max_sentencepiece_length_, other->max_sentencepiece_length_);
- swap(shuffle_input_sentence_, other->shuffle_input_sentence_);
- swap(split_by_unicode_script_, other->split_by_unicode_script_);
- swap(split_by_number_, other->split_by_number_);
- swap(split_by_whitespace_, other->split_by_whitespace_);
- swap(vocabulary_output_piece_score_, other->vocabulary_output_piece_score_);
- swap(hard_vocab_limit_, other->hard_vocab_limit_);
- swap(bos_id_, other->bos_id_);
- swap(eos_id_, other->eos_id_);
- swap(pad_id_, other->pad_id_);
+ PROTOBUF_FIELD_OFFSET(TrainerSpec, _impl_.train_extremely_large_corpus_)
+ + sizeof(TrainerSpec::_impl_.train_extremely_large_corpus_)
+ - PROTOBUF_FIELD_OFFSET(TrainerSpec, _impl_.self_test_sample_size_)>(
+ reinterpret_cast<char*>(&_impl_.self_test_sample_size_),
+ reinterpret_cast<char*>(&other->_impl_.self_test_sample_size_));
+ swap(_impl_.model_type_, other->_impl_.model_type_);
+ swap(_impl_.vocab_size_, other->_impl_.vocab_size_);
+ swap(_impl_.character_coverage_, other->_impl_.character_coverage_);
+ swap(_impl_.seed_sentencepiece_size_, other->_impl_.seed_sentencepiece_size_);
+ swap(_impl_.shrinking_factor_, other->_impl_.shrinking_factor_);
+ swap(_impl_.num_threads_, other->_impl_.num_threads_);
+ swap(_impl_.num_sub_iterations_, other->_impl_.num_sub_iterations_);
+ swap(_impl_.max_sentence_length_, other->_impl_.max_sentence_length_);
+ swap(_impl_.max_sentencepiece_length_, other->_impl_.max_sentencepiece_length_);
+ swap(_impl_.shuffle_input_sentence_, other->_impl_.shuffle_input_sentence_);
+ swap(_impl_.split_by_unicode_script_, other->_impl_.split_by_unicode_script_);
+ swap(_impl_.split_by_number_, other->_impl_.split_by_number_);
+ swap(_impl_.split_by_whitespace_, other->_impl_.split_by_whitespace_);
+ swap(_impl_.vocabulary_output_piece_score_, other->_impl_.vocabulary_output_piece_score_);
+ swap(_impl_.hard_vocab_limit_, other->_impl_.hard_vocab_limit_);
+ swap(_impl_.bos_id_, other->_impl_.bos_id_);
+ swap(_impl_.eos_id_, other->_impl_.eos_id_);
+ swap(_impl_.pad_id_, other->_impl_.pad_id_);
}
std::string TrainerSpec::GetTypeName() const {
@@ -1768,7 +1935,7 @@ std::string TrainerSpec::GetTypeName() const {
class NormalizerSpec::_Internal {
public:
- using HasBits = decltype(std::declval<NormalizerSpec>()._has_bits_);
+ using HasBits = decltype(std::declval<NormalizerSpec>()._impl_._has_bits_);
static void set_has_name(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
@@ -1789,195 +1956,231 @@ class NormalizerSpec::_Internal {
}
};
-NormalizerSpec::NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+NormalizerSpec::NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.NormalizerSpec)
}
NormalizerSpec::NormalizerSpec(const NormalizerSpec& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ NormalizerSpec* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.name_){}
+ , decltype(_impl_.precompiled_charsmap_){}
+ , decltype(_impl_.normalization_rule_tsv_){}
+ , decltype(_impl_.add_dummy_prefix_){}
+ , decltype(_impl_.remove_extra_whitespaces_){}
+ , decltype(_impl_.escape_whitespaces_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
- name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _impl_.name_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.name_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_name()) {
- name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(),
- GetArena());
+ _this->_impl_.name_.Set(from._internal_name(),
+ _this->GetArenaForAllocation());
}
- precompiled_charsmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.precompiled_charsmap_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.precompiled_charsmap_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_precompiled_charsmap()) {
- precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_precompiled_charsmap(),
- GetArena());
+ _this->_impl_.precompiled_charsmap_.Set(from._internal_precompiled_charsmap(),
+ _this->GetArenaForAllocation());
}
- normalization_rule_tsv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.normalization_rule_tsv_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.normalization_rule_tsv_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_normalization_rule_tsv()) {
- normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_normalization_rule_tsv(),
- GetArena());
+ _this->_impl_.normalization_rule_tsv_.Set(from._internal_normalization_rule_tsv(),
+ _this->GetArenaForAllocation());
}
- ::memcpy(&add_dummy_prefix_, &from.add_dummy_prefix_,
- static_cast<size_t>(reinterpret_cast<char*>(&escape_whitespaces_) -
- reinterpret_cast<char*>(&add_dummy_prefix_)) + sizeof(escape_whitespaces_));
+ ::memcpy(&_impl_.add_dummy_prefix_, &from._impl_.add_dummy_prefix_,
+ static_cast<size_t>(reinterpret_cast<char*>(&_impl_.escape_whitespaces_) -
+ reinterpret_cast<char*>(&_impl_.add_dummy_prefix_)) + sizeof(_impl_.escape_whitespaces_));
// @@protoc_insertion_point(copy_constructor:sentencepiece.NormalizerSpec)
}
-void NormalizerSpec::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base);
- name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- precompiled_charsmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- normalization_rule_tsv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- add_dummy_prefix_ = true;
- remove_extra_whitespaces_ = true;
- escape_whitespaces_ = true;
+inline void NormalizerSpec::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.name_){}
+ , decltype(_impl_.precompiled_charsmap_){}
+ , decltype(_impl_.normalization_rule_tsv_){}
+ , decltype(_impl_.add_dummy_prefix_){true}
+ , decltype(_impl_.remove_extra_whitespaces_){true}
+ , decltype(_impl_.escape_whitespaces_){true}
+ };
+ _impl_.name_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.name_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.precompiled_charsmap_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.precompiled_charsmap_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.normalization_rule_tsv_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.normalization_rule_tsv_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
NormalizerSpec::~NormalizerSpec() {
// @@protoc_insertion_point(destructor:sentencepiece.NormalizerSpec)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void NormalizerSpec::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- precompiled_charsmap_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- normalization_rule_tsv_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void NormalizerSpec::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.name_.Destroy();
+ _impl_.precompiled_charsmap_.Destroy();
+ _impl_.normalization_rule_tsv_.Destroy();
}
-void NormalizerSpec::ArenaDtor(void* object) {
- NormalizerSpec* _this = reinterpret_cast< NormalizerSpec* >(object);
- (void)_this;
-}
-void NormalizerSpec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void NormalizerSpec::SetCachedSize(int size) const {
- _cached_size_.Set(size);
+ _impl_._cached_size_.Set(size);
}
-const NormalizerSpec& NormalizerSpec::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
-}
-
void NormalizerSpec::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.NormalizerSpec)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000003fu) {
if (cached_has_bits & 0x00000001u) {
- name_.ClearNonDefaultToEmpty();
+ _impl_.name_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
- precompiled_charsmap_.ClearNonDefaultToEmpty();
+ _impl_.precompiled_charsmap_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000004u) {
- normalization_rule_tsv_.ClearNonDefaultToEmpty();
+ _impl_.normalization_rule_tsv_.ClearNonDefaultToEmpty();
}
- add_dummy_prefix_ = true;
- remove_extra_whitespaces_ = true;
- escape_whitespaces_ = true;
+ _impl_.add_dummy_prefix_ = true;
+ _impl_.remove_extra_whitespaces_ = true;
+ _impl_.escape_whitespaces_ = true;
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* NormalizerSpec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* NormalizerSpec::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string name = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_name();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bytes precompiled_charsmap = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_precompiled_charsmap();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool add_dummy_prefix = 3 [default = true];
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
_Internal::set_has_add_dummy_prefix(&has_bits);
- add_dummy_prefix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ _impl_.add_dummy_prefix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool remove_extra_whitespaces = 4 [default = true];
case 4:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
_Internal::set_has_remove_extra_whitespaces(&has_bits);
- remove_extra_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ _impl_.remove_extra_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional bool escape_whitespaces = 5 [default = true];
case 5:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_Internal::set_has_escape_whitespaces(&has_bits);
- escape_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ _impl_.escape_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string normalization_rule_tsv = 6;
case 6:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
auto str = _internal_mutable_normalization_rule_tsv();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::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;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
+ } else
+ goto handle_unusual;
continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* NormalizerSpec::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* NormalizerSpec::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.NormalizerSpec)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string name = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -1993,19 +2196,19 @@ failure:
// optional bool add_dummy_prefix = 3 [default = true];
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_add_dummy_prefix(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_add_dummy_prefix(), target);
}
// optional bool remove_extra_whitespaces = 4 [default = true];
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_remove_extra_whitespaces(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_remove_extra_whitespaces(), target);
}
// optional bool escape_whitespaces = 5 [default = true];
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_escape_whitespaces(), target);
+ target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_escape_whitespaces(), target);
}
// optional string normalization_rule_tsv = 6;
@@ -2015,8 +2218,8 @@ failure:
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -2030,13 +2233,13 @@ size_t NormalizerSpec::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.NormalizerSpec)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000003fu) {
// optional string name = 1;
if (cached_has_bits & 0x00000001u) {
@@ -2078,47 +2281,48 @@ size_t NormalizerSpec::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void NormalizerSpec::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const NormalizerSpec*>(
+ MergeFrom(*::_pbi::DownCast<const NormalizerSpec*>(
&from));
}
void NormalizerSpec::MergeFrom(const NormalizerSpec& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NormalizerSpec)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ NormalizerSpec* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NormalizerSpec)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = from._has_bits_[0];
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x0000003fu) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_name(from._internal_name());
+ _this->_internal_set_name(from._internal_name());
}
if (cached_has_bits & 0x00000002u) {
- _internal_set_precompiled_charsmap(from._internal_precompiled_charsmap());
+ _this->_internal_set_precompiled_charsmap(from._internal_precompiled_charsmap());
}
if (cached_has_bits & 0x00000004u) {
- _internal_set_normalization_rule_tsv(from._internal_normalization_rule_tsv());
+ _this->_internal_set_normalization_rule_tsv(from._internal_normalization_rule_tsv());
}
if (cached_has_bits & 0x00000008u) {
- add_dummy_prefix_ = from.add_dummy_prefix_;
+ _this->_impl_.add_dummy_prefix_ = from._impl_.add_dummy_prefix_;
}
if (cached_has_bits & 0x00000010u) {
- remove_extra_whitespaces_ = from.remove_extra_whitespaces_;
+ _this->_impl_.remove_extra_whitespaces_ = from._impl_.remove_extra_whitespaces_;
}
if (cached_has_bits & 0x00000020u) {
- escape_whitespaces_ = from.escape_whitespaces_;
+ _this->_impl_.escape_whitespaces_ = from._impl_.escape_whitespaces_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void NormalizerSpec::CopyFrom(const NormalizerSpec& from) {
@@ -2129,7 +2333,7 @@ void NormalizerSpec::CopyFrom(const NormalizerSpec& from) {
}
bool NormalizerSpec::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
@@ -2138,15 +2342,26 @@ bool NormalizerSpec::IsInitialized() const {
void NormalizerSpec::InternalSwap(NormalizerSpec* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _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());
- precompiled_charsmap_.Swap(&other->precompiled_charsmap_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- normalization_rule_tsv_.Swap(&other->normalization_rule_tsv_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- swap(add_dummy_prefix_, other->add_dummy_prefix_);
- swap(remove_extra_whitespaces_, other->remove_extra_whitespaces_);
- swap(escape_whitespaces_, other->escape_whitespaces_);
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.name_, lhs_arena,
+ &other->_impl_.name_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.precompiled_charsmap_, lhs_arena,
+ &other->_impl_.precompiled_charsmap_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.normalization_rule_tsv_, lhs_arena,
+ &other->_impl_.normalization_rule_tsv_, rhs_arena
+ );
+ swap(_impl_.add_dummy_prefix_, other->_impl_.add_dummy_prefix_);
+ swap(_impl_.remove_extra_whitespaces_, other->_impl_.remove_extra_whitespaces_);
+ swap(_impl_.escape_whitespaces_, other->_impl_.escape_whitespaces_);
}
std::string NormalizerSpec::GetTypeName() const {
@@ -2158,7 +2373,7 @@ std::string NormalizerSpec::GetTypeName() const {
class SelfTestData_Sample::_Internal {
public:
- using HasBits = decltype(std::declval<SelfTestData_Sample>()._has_bits_);
+ using HasBits = decltype(std::declval<SelfTestData_Sample>()._impl_._has_bits_);
static void set_has_input(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
@@ -2167,135 +2382,155 @@ class SelfTestData_Sample::_Internal {
}
};
-SelfTestData_Sample::SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+SelfTestData_Sample::SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.SelfTestData.Sample)
}
SelfTestData_Sample::SelfTestData_Sample(const SelfTestData_Sample& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ SelfTestData_Sample* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.input_){}
+ , decltype(_impl_.expected_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- input_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.input_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.input_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_input()) {
- input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_input(),
- GetArena());
+ _this->_impl_.input_.Set(from._internal_input(),
+ _this->GetArenaForAllocation());
}
- expected_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_.expected_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.expected_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_expected()) {
- expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_expected(),
- GetArena());
+ _this->_impl_.expected_.Set(from._internal_expected(),
+ _this->GetArenaForAllocation());
}
// @@protoc_insertion_point(copy_constructor:sentencepiece.SelfTestData.Sample)
}
-void SelfTestData_Sample::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base);
- input_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- expected_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SelfTestData_Sample::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.input_){}
+ , decltype(_impl_.expected_){}
+ };
+ _impl_.input_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.input_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.expected_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.expected_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
SelfTestData_Sample::~SelfTestData_Sample() {
// @@protoc_insertion_point(destructor:sentencepiece.SelfTestData.Sample)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void SelfTestData_Sample::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- input_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- expected_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SelfTestData_Sample::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_.input_.Destroy();
+ _impl_.expected_.Destroy();
}
-void SelfTestData_Sample::ArenaDtor(void* object) {
- SelfTestData_Sample* _this = reinterpret_cast< SelfTestData_Sample* >(object);
- (void)_this;
-}
-void SelfTestData_Sample::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void SelfTestData_Sample::SetCachedSize(int size) const {
- _cached_size_.Set(size);
+ _impl_._cached_size_.Set(size);
}
-const SelfTestData_Sample& SelfTestData_Sample::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
-}
-
void SelfTestData_Sample::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.SelfTestData.Sample)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
- input_.ClearNonDefaultToEmpty();
+ _impl_.input_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
- expected_.ClearNonDefaultToEmpty();
+ _impl_.expected_.ClearNonDefaultToEmpty();
}
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* SelfTestData_Sample::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SelfTestData_Sample::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string input = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_input();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional string expected = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_expected();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } 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;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* SelfTestData_Sample::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SelfTestData_Sample::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SelfTestData.Sample)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string input = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -2320,11 +2555,11 @@ size_t SelfTestData_Sample::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.SelfTestData.Sample)
size_t total_size = 0;
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional string input = 1;
if (cached_has_bits & 0x00000001u) {
@@ -2344,33 +2579,34 @@ size_t SelfTestData_Sample::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void SelfTestData_Sample::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SelfTestData_Sample*>(
+ MergeFrom(*::_pbi::DownCast<const SelfTestData_Sample*>(
&from));
}
void SelfTestData_Sample::MergeFrom(const SelfTestData_Sample& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData.Sample)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ SelfTestData_Sample* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData.Sample)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = from._has_bits_[0];
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_input(from._internal_input());
+ _this->_internal_set_input(from._internal_input());
}
if (cached_has_bits & 0x00000002u) {
- _internal_set_expected(from._internal_expected());
+ _this->_internal_set_expected(from._internal_expected());
}
}
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void SelfTestData_Sample::CopyFrom(const SelfTestData_Sample& from) {
@@ -2386,10 +2622,18 @@ bool SelfTestData_Sample::IsInitialized() const {
void SelfTestData_Sample::InternalSwap(SelfTestData_Sample* other) {
using std::swap;
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- input_.Swap(&other->input_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- expected_.Swap(&other->expected_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.input_, lhs_arena,
+ &other->_impl_.input_, rhs_arena
+ );
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.expected_, lhs_arena,
+ &other->_impl_.expected_, rhs_arena
+ );
}
std::string SelfTestData_Sample::GetTypeName() const {
@@ -2403,72 +2647,75 @@ class SelfTestData::_Internal {
public:
};
-SelfTestData::SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena),
- samples_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+SelfTestData::SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.SelfTestData)
}
SelfTestData::SelfTestData(const SelfTestData& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- samples_(from.samples_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ SelfTestData* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_.samples_){from._impl_.samples_}
+ , /*decltype(_impl_._cached_size_)*/{}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
// @@protoc_insertion_point(copy_constructor:sentencepiece.SelfTestData)
}
-void SelfTestData::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base);
+inline void SelfTestData::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_.samples_){arena}
+ , /*decltype(_impl_._cached_size_)*/{}
+ };
}
SelfTestData::~SelfTestData() {
// @@protoc_insertion_point(destructor:sentencepiece.SelfTestData)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void SelfTestData::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
+inline void SelfTestData::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.samples_.~RepeatedPtrField();
}
-void SelfTestData::ArenaDtor(void* object) {
- SelfTestData* _this = reinterpret_cast< SelfTestData* >(object);
- (void)_this;
-}
-void SelfTestData::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void SelfTestData::SetCachedSize(int size) const {
- _cached_size_.Set(size);
-}
-const SelfTestData& SelfTestData::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
+ _impl_._cached_size_.Set(size);
}
-
void SelfTestData::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.SelfTestData)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- samples_.Clear();
+ _impl_._extensions_.Clear();
+ _impl_.samples_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* SelfTestData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SelfTestData::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// repeated .sentencepiece.SelfTestData.Sample samples = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
@@ -2476,53 +2723,54 @@ const char* SelfTestData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
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;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
+ } else
+ goto handle_unusual;
continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
+message_done:
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* SelfTestData::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SelfTestData::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SelfTestData)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// repeated .sentencepiece.SelfTestData.Sample samples = 1;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->_internal_samples_size()); i < n; i++) {
- target = stream->EnsureSpace(target);
+ for (unsigned i = 0,
+ n = static_cast<unsigned>(this->_internal_samples_size()); i < n; i++) {
+ const auto& repfield = this->_internal_samples(i);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(1, this->_internal_samples(i), target, stream);
+ InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -2536,15 +2784,15 @@ size_t SelfTestData::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.SelfTestData)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .sentencepiece.SelfTestData.Sample samples = 1;
total_size += 1UL * this->_internal_samples_size();
- for (const auto& msg : this->samples_) {
+ for (const auto& msg : this->_impl_.samples_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
@@ -2552,26 +2800,27 @@ size_t SelfTestData::ByteSizeLong() const {
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void SelfTestData::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SelfTestData*>(
+ MergeFrom(*::_pbi::DownCast<const SelfTestData*>(
&from));
}
void SelfTestData::MergeFrom(const SelfTestData& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ SelfTestData* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- samples_.MergeFrom(from.samples_);
+ _this->_impl_.samples_.MergeFrom(from._impl_.samples_);
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void SelfTestData::CopyFrom(const SelfTestData& from) {
@@ -2582,7 +2831,7 @@ void SelfTestData::CopyFrom(const SelfTestData& from) {
}
bool SelfTestData::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
@@ -2591,9 +2840,9 @@ bool SelfTestData::IsInitialized() const {
void SelfTestData::InternalSwap(SelfTestData* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- samples_.InternalSwap(&other->samples_);
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ _impl_.samples_.InternalSwap(&other->_impl_.samples_);
}
std::string SelfTestData::GetTypeName() const {
@@ -2605,7 +2854,7 @@ std::string SelfTestData::GetTypeName() const {
class ModelProto_SentencePiece::_Internal {
public:
- using HasBits = decltype(std::declval<ModelProto_SentencePiece>()._has_bits_);
+ using HasBits = decltype(std::declval<ModelProto_SentencePiece>()._impl_._has_bits_);
static void set_has_piece(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
@@ -2617,153 +2866,169 @@ class ModelProto_SentencePiece::_Internal {
}
};
-ModelProto_SentencePiece::ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+ModelProto_SentencePiece::ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.ModelProto.SentencePiece)
}
ModelProto_SentencePiece::ModelProto_SentencePiece(const ModelProto_SentencePiece& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ ModelProto_SentencePiece* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.piece_){}
+ , decltype(_impl_.score_){}
+ , decltype(_impl_.type_){}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
- piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _impl_.piece_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_piece()) {
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_piece(),
- GetArena());
+ _this->_impl_.piece_.Set(from._internal_piece(),
+ _this->GetArenaForAllocation());
}
- ::memcpy(&score_, &from.score_,
- static_cast<size_t>(reinterpret_cast<char*>(&type_) -
- reinterpret_cast<char*>(&score_)) + sizeof(type_));
+ ::memcpy(&_impl_.score_, &from._impl_.score_,
+ static_cast<size_t>(reinterpret_cast<char*>(&_impl_.type_) -
+ reinterpret_cast<char*>(&_impl_.score_)) + sizeof(_impl_.type_));
// @@protoc_insertion_point(copy_constructor:sentencepiece.ModelProto.SentencePiece)
}
-void ModelProto_SentencePiece::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base);
- piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- score_ = 0;
- type_ = 1;
+inline void ModelProto_SentencePiece::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.piece_){}
+ , decltype(_impl_.score_){0}
+ , decltype(_impl_.type_){1}
+ };
+ _impl_.piece_.InitDefault();
+ #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
ModelProto_SentencePiece::~ModelProto_SentencePiece() {
// @@protoc_insertion_point(destructor:sentencepiece.ModelProto.SentencePiece)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void ModelProto_SentencePiece::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- piece_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void ModelProto_SentencePiece::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.piece_.Destroy();
}
-void ModelProto_SentencePiece::ArenaDtor(void* object) {
- ModelProto_SentencePiece* _this = reinterpret_cast< ModelProto_SentencePiece* >(object);
- (void)_this;
-}
-void ModelProto_SentencePiece::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void ModelProto_SentencePiece::SetCachedSize(int size) const {
- _cached_size_.Set(size);
-}
-const ModelProto_SentencePiece& ModelProto_SentencePiece::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
+ _impl_._cached_size_.Set(size);
}
-
void ModelProto_SentencePiece::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.ModelProto.SentencePiece)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
- piece_.ClearNonDefaultToEmpty();
+ _impl_.piece_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000006u) {
- score_ = 0;
- type_ = 1;
+ _impl_.score_ = 0;
+ _impl_.type_ = 1;
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* ModelProto_SentencePiece::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* ModelProto_SentencePiece::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string piece = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_piece();
- ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+ ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional float score = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
_Internal::set_has_score(&has_bits);
- score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+ _impl_.score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
- ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+ uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::sentencepiece::ModelProto_SentencePiece_Type_IsValid(val))) {
_internal_set_type(static_cast<::sentencepiece::ModelProto_SentencePiece_Type>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
}
- } else goto handle_unusual;
- continue;
- default: {
- handle_unusual:
- if ((tag & 7) == 4 || tag == 0) {
- ctx->SetLastTag(tag);
- goto success;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
+ } else
+ goto handle_unusual;
continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* ModelProto_SentencePiece::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* ModelProto_SentencePiece::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.ModelProto.SentencePiece)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional string piece = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
@@ -2773,19 +3038,19 @@ failure:
// optional float score = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_score(), target);
+ target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_score(), target);
}
// optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
- target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+ target = ::_pbi::WireFormatLite::WriteEnumToArray(
3, this->_internal_type(), target);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -2799,13 +3064,13 @@ size_t ModelProto_SentencePiece::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.ModelProto.SentencePiece)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
// optional string piece = 1;
if (cached_has_bits & 0x00000001u) {
@@ -2822,45 +3087,46 @@ size_t ModelProto_SentencePiece::ByteSizeLong() const {
// optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
- ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
+ ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
}
}
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ModelProto_SentencePiece::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ModelProto_SentencePiece*>(
+ MergeFrom(*::_pbi::DownCast<const ModelProto_SentencePiece*>(
&from));
}
void ModelProto_SentencePiece::MergeFrom(const ModelProto_SentencePiece& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto.SentencePiece)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ ModelProto_SentencePiece* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto.SentencePiece)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- cached_has_bits = from._has_bits_[0];
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
if (cached_has_bits & 0x00000001u) {
- _internal_set_piece(from._internal_piece());
+ _this->_internal_set_piece(from._internal_piece());
}
if (cached_has_bits & 0x00000002u) {
- score_ = from.score_;
+ _this->_impl_.score_ = from._impl_.score_;
}
if (cached_has_bits & 0x00000004u) {
- type_ = from.type_;
+ _this->_impl_.type_ = from._impl_.type_;
}
- _has_bits_[0] |= cached_has_bits;
+ _this->_impl_._has_bits_[0] |= cached_has_bits;
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void ModelProto_SentencePiece::CopyFrom(const ModelProto_SentencePiece& from) {
@@ -2871,7 +3137,7 @@ void ModelProto_SentencePiece::CopyFrom(const ModelProto_SentencePiece& from) {
}
bool ModelProto_SentencePiece::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
@@ -2880,12 +3146,17 @@ bool ModelProto_SentencePiece::IsInitialized() const {
void ModelProto_SentencePiece::InternalSwap(ModelProto_SentencePiece* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- piece_.Swap(&other->piece_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- swap(score_, other->score_);
- swap(type_, other->type_);
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ auto* lhs_arena = GetArenaForAllocation();
+ auto* rhs_arena = other->GetArenaForAllocation();
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+ &_impl_.piece_, lhs_arena,
+ &other->_impl_.piece_, rhs_arena
+ );
+ swap(_impl_.score_, other->_impl_.score_);
+ swap(_impl_.type_, other->_impl_.type_);
}
std::string ModelProto_SentencePiece::GetTypeName() const {
@@ -2897,7 +3168,7 @@ std::string ModelProto_SentencePiece::GetTypeName() const {
class ModelProto::_Internal {
public:
- using HasBits = decltype(std::declval<ModelProto>()._has_bits_);
+ using HasBits = decltype(std::declval<ModelProto>()._impl_._has_bits_);
static const ::sentencepiece::TrainerSpec& trainer_spec(const ModelProto* msg);
static void set_has_trainer_spec(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
@@ -2918,136 +3189,136 @@ class ModelProto::_Internal {
const ::sentencepiece::TrainerSpec&
ModelProto::_Internal::trainer_spec(const ModelProto* msg) {
- return *msg->trainer_spec_;
+ return *msg->_impl_.trainer_spec_;
}
const ::sentencepiece::NormalizerSpec&
ModelProto::_Internal::normalizer_spec(const ModelProto* msg) {
- return *msg->normalizer_spec_;
+ return *msg->_impl_.normalizer_spec_;
}
const ::sentencepiece::SelfTestData&
ModelProto::_Internal::self_test_data(const ModelProto* msg) {
- return *msg->self_test_data_;
+ return *msg->_impl_.self_test_data_;
}
const ::sentencepiece::NormalizerSpec&
ModelProto::_Internal::denormalizer_spec(const ModelProto* msg) {
- return *msg->denormalizer_spec_;
-}
-ModelProto::ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
- _extensions_(arena),
- pieces_(arena) {
- SharedCtor();
- RegisterArenaDtor(arena);
+ return *msg->_impl_.denormalizer_spec_;
+}
+ModelProto::ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned)
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
+ SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:sentencepiece.ModelProto)
}
ModelProto::ModelProto(const ModelProto& from)
- : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
- _has_bits_(from._has_bits_),
- pieces_(from.pieces_) {
+ : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
+ ModelProto* const _this = this; (void)_this;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{}
+ , decltype(_impl_._has_bits_){from._impl_._has_bits_}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.pieces_){from._impl_.pieces_}
+ , decltype(_impl_.trainer_spec_){nullptr}
+ , decltype(_impl_.normalizer_spec_){nullptr}
+ , decltype(_impl_.self_test_data_){nullptr}
+ , decltype(_impl_.denormalizer_spec_){nullptr}};
+
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- _extensions_.MergeFrom(from._extensions_);
+ _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
if (from._internal_has_trainer_spec()) {
- trainer_spec_ = new ::sentencepiece::TrainerSpec(*from.trainer_spec_);
- } else {
- trainer_spec_ = nullptr;
+ _this->_impl_.trainer_spec_ = new ::sentencepiece::TrainerSpec(*from._impl_.trainer_spec_);
}
if (from._internal_has_normalizer_spec()) {
- normalizer_spec_ = new ::sentencepiece::NormalizerSpec(*from.normalizer_spec_);
- } else {
- normalizer_spec_ = nullptr;
+ _this->_impl_.normalizer_spec_ = new ::sentencepiece::NormalizerSpec(*from._impl_.normalizer_spec_);
}
if (from._internal_has_self_test_data()) {
- self_test_data_ = new ::sentencepiece::SelfTestData(*from.self_test_data_);
- } else {
- self_test_data_ = nullptr;
+ _this->_impl_.self_test_data_ = new ::sentencepiece::SelfTestData(*from._impl_.self_test_data_);
}
if (from._internal_has_denormalizer_spec()) {
- denormalizer_spec_ = new ::sentencepiece::NormalizerSpec(*from.denormalizer_spec_);
- } else {
- denormalizer_spec_ = nullptr;
+ _this->_impl_.denormalizer_spec_ = new ::sentencepiece::NormalizerSpec(*from._impl_.denormalizer_spec_);
}
// @@protoc_insertion_point(copy_constructor:sentencepiece.ModelProto)
}
-void ModelProto::SharedCtor() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelProto_sentencepiece_5fmodel_2eproto.base);
- ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
- reinterpret_cast<char*>(&trainer_spec_) - reinterpret_cast<char*>(this)),
- 0, static_cast<size_t>(reinterpret_cast<char*>(&denormalizer_spec_) -
- reinterpret_cast<char*>(&trainer_spec_)) + sizeof(denormalizer_spec_));
+inline void ModelProto::SharedCtor(
+ ::_pb::Arena* arena, bool is_message_owned) {
+ (void)arena;
+ (void)is_message_owned;
+ new (&_impl_) Impl_{
+ /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
+ , decltype(_impl_._has_bits_){}
+ , /*decltype(_impl_._cached_size_)*/{}
+ , decltype(_impl_.pieces_){arena}
+ , decltype(_impl_.trainer_spec_){nullptr}
+ , decltype(_impl_.normalizer_spec_){nullptr}
+ , decltype(_impl_.self_test_data_){nullptr}
+ , decltype(_impl_.denormalizer_spec_){nullptr}
+ };
}
ModelProto::~ModelProto() {
// @@protoc_insertion_point(destructor:sentencepiece.ModelProto)
+ if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+ (void)arena;
+ return;
+ }
SharedDtor();
- _internal_metadata_.Delete<std::string>();
}
-void ModelProto::SharedDtor() {
- GOOGLE_DCHECK(GetArena() == nullptr);
- if (this != internal_default_instance()) delete trainer_spec_;
- if (this != internal_default_instance()) delete normalizer_spec_;
- if (this != internal_default_instance()) delete self_test_data_;
- if (this != internal_default_instance()) delete denormalizer_spec_;
+inline void ModelProto::SharedDtor() {
+ GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+ _impl_._extensions_.~ExtensionSet();
+ _impl_.pieces_.~RepeatedPtrField();
+ if (this != internal_default_instance()) delete _impl_.trainer_spec_;
+ if (this != internal_default_instance()) delete _impl_.normalizer_spec_;
+ if (this != internal_default_instance()) delete _impl_.self_test_data_;
+ if (this != internal_default_instance()) delete _impl_.denormalizer_spec_;
}
-void ModelProto::ArenaDtor(void* object) {
- ModelProto* _this = reinterpret_cast< ModelProto* >(object);
- (void)_this;
-}
-void ModelProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
void ModelProto::SetCachedSize(int size) const {
- _cached_size_.Set(size);
+ _impl_._cached_size_.Set(size);
}
-const ModelProto& ModelProto::default_instance() {
- ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelProto_sentencepiece_5fmodel_2eproto.base);
- return *internal_default_instance();
-}
-
void ModelProto::Clear() {
// @@protoc_insertion_point(message_clear_start:sentencepiece.ModelProto)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
- _extensions_.Clear();
- pieces_.Clear();
- cached_has_bits = _has_bits_[0];
+ _impl_._extensions_.Clear();
+ _impl_.pieces_.Clear();
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
- GOOGLE_DCHECK(trainer_spec_ != nullptr);
- trainer_spec_->Clear();
+ GOOGLE_DCHECK(_impl_.trainer_spec_ != nullptr);
+ _impl_.trainer_spec_->Clear();
}
if (cached_has_bits & 0x00000002u) {
- GOOGLE_DCHECK(normalizer_spec_ != nullptr);
- normalizer_spec_->Clear();
+ GOOGLE_DCHECK(_impl_.normalizer_spec_ != nullptr);
+ _impl_.normalizer_spec_->Clear();
}
if (cached_has_bits & 0x00000004u) {
- GOOGLE_DCHECK(self_test_data_ != nullptr);
- self_test_data_->Clear();
+ GOOGLE_DCHECK(_impl_.self_test_data_ != nullptr);
+ _impl_.self_test_data_->Clear();
}
if (cached_has_bits & 0x00000008u) {
- GOOGLE_DCHECK(denormalizer_spec_ != nullptr);
- denormalizer_spec_->Clear();
+ GOOGLE_DCHECK(_impl_.denormalizer_spec_ != nullptr);
+ _impl_.denormalizer_spec_->Clear();
}
}
- _has_bits_.Clear();
+ _impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
-const char* ModelProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* ModelProto::_InternalParse(const char* ptr, ::_pbi::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);
+ uint32_t tag;
+ ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
case 1:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr -= 1;
do {
ptr += 1;
@@ -3055,115 +3326,116 @@ const char* ModelProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.TrainerSpec trainer_spec = 2;
case 2:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_trainer_spec(), ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
case 3:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_normalizer_spec(), ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.SelfTestData self_test_data = 4;
case 4:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
ptr = ctx->ParseMessage(_internal_mutable_self_test_data(), ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
// optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
case 5:
- if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
+ if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
ptr = ctx->ParseMessage(_internal_mutable_denormalizer_spec(), ptr);
CHK_(ptr);
- } else goto handle_unusual;
+ } else
+ goto handle_unusual;
continue;
- default: {
- handle_unusual:
- if ((tag & 7) == 4 || tag == 0) {
- ctx->SetLastTag(tag);
- goto success;
- }
- if ((1600u <= tag)) {
- ptr = _extensions_.ParseField(tag, ptr,
- internal_default_instance(), &_internal_metadata_, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
- ptr = UnknownFieldParse(tag,
- _internal_metadata_.mutable_unknown_fields<std::string>(),
- ptr, ctx);
- CHK_(ptr != nullptr);
- continue;
- }
+ default:
+ goto handle_unusual;
} // switch
+ handle_unusual:
+ if ((tag == 0) || ((tag & 7) == 4)) {
+ CHK_(ptr);
+ ctx->SetLastTag(tag);
+ goto message_done;
+ }
+ if ((1600u <= tag)) {
+ ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+ CHK_(ptr != nullptr);
+ continue;
+ }
+ ptr = UnknownFieldParse(
+ tag,
+ _internal_metadata_.mutable_unknown_fields<std::string>(),
+ ptr, ctx);
+ CHK_(ptr != nullptr);
} // while
-success:
- _has_bits_.Or(has_bits);
+message_done:
+ _impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
- goto success;
+ goto message_done;
#undef CHK_
}
-::PROTOBUF_NAMESPACE_ID::uint8* ModelProto::_InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* ModelProto::_InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:sentencepiece.ModelProto)
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
- for (unsigned int i = 0,
- n = static_cast<unsigned int>(this->_internal_pieces_size()); i < n; i++) {
- target = stream->EnsureSpace(target);
+ for (unsigned i = 0,
+ n = static_cast<unsigned>(this->_internal_pieces_size()); i < n; i++) {
+ const auto& repfield = this->_internal_pieces(i);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(1, this->_internal_pieces(i), target, stream);
+ InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
// optional .sentencepiece.TrainerSpec trainer_spec = 2;
if (cached_has_bits & 0x00000001u) {
- target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(
- 2, _Internal::trainer_spec(this), target, stream);
+ InternalWriteMessage(2, _Internal::trainer_spec(this),
+ _Internal::trainer_spec(this).GetCachedSize(), target, stream);
}
// optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
if (cached_has_bits & 0x00000002u) {
- target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(
- 3, _Internal::normalizer_spec(this), target, stream);
+ InternalWriteMessage(3, _Internal::normalizer_spec(this),
+ _Internal::normalizer_spec(this).GetCachedSize(), target, stream);
}
// optional .sentencepiece.SelfTestData self_test_data = 4;
if (cached_has_bits & 0x00000004u) {
- target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(
- 4, _Internal::self_test_data(this), target, stream);
+ InternalWriteMessage(4, _Internal::self_test_data(this),
+ _Internal::self_test_data(this).GetCachedSize(), target, stream);
}
// optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
if (cached_has_bits & 0x00000008u) {
- target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
- InternalWriteMessage(
- 5, _Internal::denormalizer_spec(this), target, stream);
+ InternalWriteMessage(5, _Internal::denormalizer_spec(this),
+ _Internal::denormalizer_spec(this).GetCachedSize(), target, stream);
}
// Extension range [200, 536870912)
- target = _extensions_._InternalSerialize(
- 200, 536870912, target, stream);
+ target = _impl_._extensions_._InternalSerialize(
+ internal_default_instance(), 200, 536870912, 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(),
@@ -3177,88 +3449,93 @@ size_t ModelProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:sentencepiece.ModelProto)
size_t total_size = 0;
- total_size += _extensions_.ByteSize();
+ total_size += _impl_._extensions_.ByteSize();
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
total_size += 1UL * this->_internal_pieces_size();
- for (const auto& msg : this->pieces_) {
+ for (const auto& msg : this->_impl_.pieces_) {
total_size +=
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
}
- cached_has_bits = _has_bits_[0];
+ cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
// optional .sentencepiece.TrainerSpec trainer_spec = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
- *trainer_spec_);
+ *_impl_.trainer_spec_);
}
// optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
- *normalizer_spec_);
+ *_impl_.normalizer_spec_);
}
// optional .sentencepiece.SelfTestData self_test_data = 4;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
- *self_test_data_);
+ *_impl_.self_test_data_);
}
// optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
- *denormalizer_spec_);
+ *_impl_.denormalizer_spec_);
}
}
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);
+ int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void ModelProto::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
- MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ModelProto*>(
+ MergeFrom(*::_pbi::DownCast<const ModelProto*>(
&from));
}
void ModelProto::MergeFrom(const ModelProto& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto)
- GOOGLE_DCHECK_NE(&from, this);
- _extensions_.MergeFrom(from._extensions_);
- _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
- ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+ ModelProto* const _this = this;
+ // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto)
+ GOOGLE_DCHECK_NE(&from, _this);
+ uint32_t cached_has_bits = 0;
(void) cached_has_bits;
- pieces_.MergeFrom(from.pieces_);
- cached_has_bits = from._has_bits_[0];
+ _this->_impl_.pieces_.MergeFrom(from._impl_.pieces_);
+ cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
- _internal_mutable_trainer_spec()->::sentencepiece::TrainerSpec::MergeFrom(from._internal_trainer_spec());
+ _this->_internal_mutable_trainer_spec()->::sentencepiece::TrainerSpec::MergeFrom(
+ from._internal_trainer_spec());
}
if (cached_has_bits & 0x00000002u) {
- _internal_mutable_normalizer_spec()->::sentencepiece::NormalizerSpec::MergeFrom(from._internal_normalizer_spec());
+ _this->_internal_mutable_normalizer_spec()->::sentencepiece::NormalizerSpec::MergeFrom(
+ from._internal_normalizer_spec());
}
if (cached_has_bits & 0x00000004u) {
- _internal_mutable_self_test_data()->::sentencepiece::SelfTestData::MergeFrom(from._internal_self_test_data());
+ _this->_internal_mutable_self_test_data()->::sentencepiece::SelfTestData::MergeFrom(
+ from._internal_self_test_data());
}
if (cached_has_bits & 0x00000008u) {
- _internal_mutable_denormalizer_spec()->::sentencepiece::NormalizerSpec::MergeFrom(from._internal_denormalizer_spec());
+ _this->_internal_mutable_denormalizer_spec()->::sentencepiece::NormalizerSpec::MergeFrom(
+ from._internal_denormalizer_spec());
}
}
+ _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
+ _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void ModelProto::CopyFrom(const ModelProto& from) {
@@ -3269,38 +3546,39 @@ void ModelProto::CopyFrom(const ModelProto& from) {
}
bool ModelProto::IsInitialized() const {
- if (!_extensions_.IsInitialized()) {
+ if (!_impl_._extensions_.IsInitialized()) {
return false;
}
- if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_)) return false;
+ if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.pieces_))
+ return false;
if (_internal_has_trainer_spec()) {
- if (!trainer_spec_->IsInitialized()) return false;
+ if (!_impl_.trainer_spec_->IsInitialized()) return false;
}
if (_internal_has_normalizer_spec()) {
- if (!normalizer_spec_->IsInitialized()) return false;
+ if (!_impl_.normalizer_spec_->IsInitialized()) return false;
}
if (_internal_has_self_test_data()) {
- if (!self_test_data_->IsInitialized()) return false;
+ if (!_impl_.self_test_data_->IsInitialized()) return false;
}
if (_internal_has_denormalizer_spec()) {
- if (!denormalizer_spec_->IsInitialized()) return false;
+ if (!_impl_.denormalizer_spec_->IsInitialized()) return false;
}
return true;
}
void ModelProto::InternalSwap(ModelProto* other) {
using std::swap;
- _extensions_.Swap(&other->_extensions_);
- _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
- swap(_has_bits_[0], other->_has_bits_[0]);
- pieces_.InternalSwap(&other->pieces_);
+ _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
+ _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+ swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
+ _impl_.pieces_.InternalSwap(&other->_impl_.pieces_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
- PROTOBUF_FIELD_OFFSET(ModelProto, denormalizer_spec_)
- + sizeof(ModelProto::denormalizer_spec_)
- - PROTOBUF_FIELD_OFFSET(ModelProto, trainer_spec_)>(
- reinterpret_cast<char*>(&trainer_spec_),
- reinterpret_cast<char*>(&other->trainer_spec_));
+ PROTOBUF_FIELD_OFFSET(ModelProto, _impl_.denormalizer_spec_)
+ + sizeof(ModelProto::_impl_.denormalizer_spec_)
+ - PROTOBUF_FIELD_OFFSET(ModelProto, _impl_.trainer_spec_)>(
+ reinterpret_cast<char*>(&_impl_.trainer_spec_),
+ reinterpret_cast<char*>(&other->_impl_.trainer_spec_));
}
std::string ModelProto::GetTypeName() const {
@@ -3311,22 +3589,28 @@ std::string ModelProto::GetTypeName() const {
// @@protoc_insertion_point(namespace_scope)
} // namespace sentencepiece
PROTOBUF_NAMESPACE_OPEN
-template<> PROTOBUF_NOINLINE ::sentencepiece::TrainerSpec* Arena::CreateMaybeMessage< ::sentencepiece::TrainerSpec >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::TrainerSpec*
+Arena::CreateMaybeMessage< ::sentencepiece::TrainerSpec >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::TrainerSpec >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::NormalizerSpec* Arena::CreateMaybeMessage< ::sentencepiece::NormalizerSpec >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::NormalizerSpec*
+Arena::CreateMaybeMessage< ::sentencepiece::NormalizerSpec >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::NormalizerSpec >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData_Sample* Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData_Sample >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData_Sample*
+Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData_Sample >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::SelfTestData_Sample >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData* Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData*
+Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::SelfTestData >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto_SentencePiece* Arena::CreateMaybeMessage< ::sentencepiece::ModelProto_SentencePiece >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto_SentencePiece*
+Arena::CreateMaybeMessage< ::sentencepiece::ModelProto_SentencePiece >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::ModelProto_SentencePiece >(arena);
}
-template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto* Arena::CreateMaybeMessage< ::sentencepiece::ModelProto >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto*
+Arena::CreateMaybeMessage< ::sentencepiece::ModelProto >(Arena* arena) {
return Arena::CreateMessageInternal< ::sentencepiece::ModelProto >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
diff --git a/src/builtin_pb/sentencepiece_model.pb.h b/src/builtin_pb/sentencepiece_model.pb.h
index f527aa7..069beb6 100644
--- a/src/builtin_pb/sentencepiece_model.pb.h
+++ b/src/builtin_pb/sentencepiece_model.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3014000
+#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3014000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -23,7 +23,6 @@
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/message_lite.h>
@@ -41,34 +40,26 @@ PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_sentencepiece_5fmodel_2eproto {
- static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[6]
- PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
- static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
- static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+ static const uint32_t offsets[];
};
namespace sentencepiece {
class ModelProto;
-class ModelProtoDefaultTypeInternal;
+struct ModelProtoDefaultTypeInternal;
extern ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
class ModelProto_SentencePiece;
-class ModelProto_SentencePieceDefaultTypeInternal;
+struct ModelProto_SentencePieceDefaultTypeInternal;
extern ModelProto_SentencePieceDefaultTypeInternal _ModelProto_SentencePiece_default_instance_;
class NormalizerSpec;
-class NormalizerSpecDefaultTypeInternal;
+struct NormalizerSpecDefaultTypeInternal;
extern NormalizerSpecDefaultTypeInternal _NormalizerSpec_default_instance_;
class SelfTestData;
-class SelfTestDataDefaultTypeInternal;
+struct SelfTestDataDefaultTypeInternal;
extern SelfTestDataDefaultTypeInternal _SelfTestData_default_instance_;
class SelfTestData_Sample;
-class SelfTestData_SampleDefaultTypeInternal;
+struct SelfTestData_SampleDefaultTypeInternal;
extern SelfTestData_SampleDefaultTypeInternal _SelfTestData_Sample_default_instance_;
class TrainerSpec;
-class TrainerSpecDefaultTypeInternal;
+struct TrainerSpecDefaultTypeInternal;
extern TrainerSpecDefaultTypeInternal _TrainerSpec_default_instance_;
} // namespace sentencepiece
PROTOBUF_NAMESPACE_OPEN
@@ -127,11 +118,12 @@ bool ModelProto_SentencePiece_Type_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ModelProto_SentencePiece_Type* value);
// ===================================================================
-class TrainerSpec PROTOBUF_FINAL :
+class TrainerSpec final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.TrainerSpec) */ {
public:
inline TrainerSpec() : TrainerSpec(nullptr) {}
- virtual ~TrainerSpec();
+ ~TrainerSpec() override;
+ explicit PROTOBUF_CONSTEXPR TrainerSpec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
TrainerSpec(const TrainerSpec& from);
TrainerSpec(TrainerSpec&& from) noexcept
@@ -144,8 +136,13 @@ class TrainerSpec PROTOBUF_FINAL :
return *this;
}
inline TrainerSpec& operator=(TrainerSpec&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -159,8 +156,9 @@ class TrainerSpec PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const TrainerSpec& default_instance();
-
+ static const TrainerSpec& default_instance() {
+ return *internal_default_instance();
+ }
static inline const TrainerSpec* internal_default_instance() {
return reinterpret_cast<const TrainerSpec*>(
&_TrainerSpec_default_instance_);
@@ -173,7 +171,12 @@ class TrainerSpec PROTOBUF_FINAL :
}
inline void Swap(TrainerSpec* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -181,21 +184,16 @@ class TrainerSpec PROTOBUF_FINAL :
}
void UnsafeArenaSwap(TrainerSpec* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline TrainerSpec* New() const final {
- return CreateMaybeMessage<TrainerSpec>(nullptr);
- }
-
- TrainerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ TrainerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<TrainerSpec>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const TrainerSpec& from);
void MergeFrom(const TrainerSpec& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -203,25 +201,24 @@ class TrainerSpec PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(TrainerSpec* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.TrainerSpec";
}
protected:
- explicit TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -406,16 +403,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_model_prefix();
const std::string& model_prefix() const;
- void set_model_prefix(const std::string& value);
- void set_model_prefix(std::string&& value);
- void set_model_prefix(const char* value);
- void set_model_prefix(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_model_prefix(ArgT0&& arg0, ArgT... args);
std::string* mutable_model_prefix();
- std::string* release_model_prefix();
+ PROTOBUF_NODISCARD std::string* release_model_prefix();
void set_allocated_model_prefix(std::string* model_prefix);
private:
const std::string& _internal_model_prefix() const;
- void _internal_set_model_prefix(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_model_prefix(const std::string& value);
std::string* _internal_mutable_model_prefix();
public:
@@ -426,16 +421,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_input_format();
const std::string& input_format() const;
- void set_input_format(const std::string& value);
- void set_input_format(std::string&& value);
- void set_input_format(const char* value);
- void set_input_format(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_input_format(ArgT0&& arg0, ArgT... args);
std::string* mutable_input_format();
- std::string* release_input_format();
+ PROTOBUF_NODISCARD std::string* release_input_format();
void set_allocated_input_format(std::string* input_format);
private:
const std::string& _internal_input_format() const;
- void _internal_set_input_format(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_input_format(const std::string& value);
std::string* _internal_mutable_input_format();
public:
@@ -446,16 +439,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_required_chars();
const std::string& required_chars() const;
- void set_required_chars(const std::string& value);
- void set_required_chars(std::string&& value);
- void set_required_chars(const char* value);
- void set_required_chars(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_required_chars(ArgT0&& arg0, ArgT... args);
std::string* mutable_required_chars();
- std::string* release_required_chars();
+ PROTOBUF_NODISCARD std::string* release_required_chars();
void set_allocated_required_chars(std::string* required_chars);
private:
const std::string& _internal_required_chars() const;
- void _internal_set_required_chars(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_required_chars(const std::string& value);
std::string* _internal_mutable_required_chars();
public:
@@ -466,16 +457,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_unk_surface();
const std::string& unk_surface() const;
- void set_unk_surface(const std::string& value);
- void set_unk_surface(std::string&& value);
- void set_unk_surface(const char* value);
- void set_unk_surface(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_unk_surface(ArgT0&& arg0, ArgT... args);
std::string* mutable_unk_surface();
- std::string* release_unk_surface();
+ PROTOBUF_NODISCARD std::string* release_unk_surface();
void set_allocated_unk_surface(std::string* unk_surface);
private:
const std::string& _internal_unk_surface() const;
- void _internal_set_unk_surface(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_unk_surface(const std::string& value);
std::string* _internal_mutable_unk_surface();
public:
@@ -486,16 +475,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_unk_piece();
const std::string& unk_piece() const;
- void set_unk_piece(const std::string& value);
- void set_unk_piece(std::string&& value);
- void set_unk_piece(const char* value);
- void set_unk_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_unk_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_unk_piece();
- std::string* release_unk_piece();
+ PROTOBUF_NODISCARD std::string* release_unk_piece();
void set_allocated_unk_piece(std::string* unk_piece);
private:
const std::string& _internal_unk_piece() const;
- void _internal_set_unk_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_unk_piece(const std::string& value);
std::string* _internal_mutable_unk_piece();
public:
@@ -506,16 +493,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_bos_piece();
const std::string& bos_piece() const;
- void set_bos_piece(const std::string& value);
- void set_bos_piece(std::string&& value);
- void set_bos_piece(const char* value);
- void set_bos_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_bos_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_bos_piece();
- std::string* release_bos_piece();
+ PROTOBUF_NODISCARD std::string* release_bos_piece();
void set_allocated_bos_piece(std::string* bos_piece);
private:
const std::string& _internal_bos_piece() const;
- void _internal_set_bos_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_bos_piece(const std::string& value);
std::string* _internal_mutable_bos_piece();
public:
@@ -526,16 +511,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_eos_piece();
const std::string& eos_piece() const;
- void set_eos_piece(const std::string& value);
- void set_eos_piece(std::string&& value);
- void set_eos_piece(const char* value);
- void set_eos_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_eos_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_eos_piece();
- std::string* release_eos_piece();
+ PROTOBUF_NODISCARD std::string* release_eos_piece();
void set_allocated_eos_piece(std::string* eos_piece);
private:
const std::string& _internal_eos_piece() const;
- void _internal_set_eos_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_eos_piece(const std::string& value);
std::string* _internal_mutable_eos_piece();
public:
@@ -546,16 +529,14 @@ class TrainerSpec PROTOBUF_FINAL :
public:
void clear_pad_piece();
const std::string& pad_piece() const;
- void set_pad_piece(const std::string& value);
- void set_pad_piece(std::string&& value);
- void set_pad_piece(const char* value);
- void set_pad_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_pad_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_pad_piece();
- std::string* release_pad_piece();
+ PROTOBUF_NODISCARD std::string* release_pad_piece();
void set_allocated_pad_piece(std::string* pad_piece);
private:
const std::string& _internal_pad_piece() const;
- void _internal_set_pad_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_pad_piece(const std::string& value);
std::string* _internal_mutable_pad_piece();
public:
@@ -565,11 +546,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_self_test_sample_size() const;
public:
void clear_self_test_sample_size();
- ::PROTOBUF_NAMESPACE_ID::int32 self_test_sample_size() const;
- void set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t self_test_sample_size() const;
+ void set_self_test_sample_size(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_self_test_sample_size() const;
- void _internal_set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_self_test_sample_size() const;
+ void _internal_set_self_test_sample_size(int32_t value);
public:
// optional int32 mining_sentence_size = 12 [deprecated = true];
@@ -578,11 +559,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_mining_sentence_size() const;
public:
PROTOBUF_DEPRECATED void clear_mining_sentence_size();
- PROTOBUF_DEPRECATED ::PROTOBUF_NAMESPACE_ID::int32 mining_sentence_size() const;
- PROTOBUF_DEPRECATED void set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ PROTOBUF_DEPRECATED int32_t mining_sentence_size() const;
+ PROTOBUF_DEPRECATED void set_mining_sentence_size(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_mining_sentence_size() const;
- void _internal_set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_mining_sentence_size() const;
+ void _internal_set_mining_sentence_size(int32_t value);
public:
// optional uint64 input_sentence_size = 11 [default = 0];
@@ -591,11 +572,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_input_sentence_size() const;
public:
void clear_input_sentence_size();
- ::PROTOBUF_NAMESPACE_ID::uint64 input_sentence_size() const;
- void set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value);
+ uint64_t input_sentence_size() const;
+ void set_input_sentence_size(uint64_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::uint64 _internal_input_sentence_size() const;
- void _internal_set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value);
+ uint64_t _internal_input_sentence_size() const;
+ void _internal_set_input_sentence_size(uint64_t value);
public:
// optional int32 training_sentence_size = 13 [deprecated = true];
@@ -604,11 +585,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_training_sentence_size() const;
public:
PROTOBUF_DEPRECATED void clear_training_sentence_size();
- PROTOBUF_DEPRECATED ::PROTOBUF_NAMESPACE_ID::int32 training_sentence_size() const;
- PROTOBUF_DEPRECATED void set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ PROTOBUF_DEPRECATED int32_t training_sentence_size() const;
+ PROTOBUF_DEPRECATED void set_training_sentence_size(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_training_sentence_size() const;
- void _internal_set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_training_sentence_size() const;
+ void _internal_set_training_sentence_size(int32_t value);
public:
// optional bool treat_whitespace_as_suffix = 24 [default = false];
@@ -669,11 +650,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_unk_id() const;
public:
void clear_unk_id();
- ::PROTOBUF_NAMESPACE_ID::int32 unk_id() const;
- void set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t unk_id() const;
+ void set_unk_id(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_unk_id() const;
- void _internal_set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_unk_id() const;
+ void _internal_set_unk_id(int32_t value);
public:
// optional bool use_all_vocab = 34 [default = false];
@@ -721,11 +702,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_vocab_size() const;
public:
void clear_vocab_size();
- ::PROTOBUF_NAMESPACE_ID::int32 vocab_size() const;
- void set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t vocab_size() const;
+ void set_vocab_size(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_vocab_size() const;
- void _internal_set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_vocab_size() const;
+ void _internal_set_vocab_size(int32_t value);
public:
// optional float character_coverage = 10 [default = 0.9995];
@@ -747,11 +728,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_seed_sentencepiece_size() const;
public:
void clear_seed_sentencepiece_size();
- ::PROTOBUF_NAMESPACE_ID::int32 seed_sentencepiece_size() const;
- void set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t seed_sentencepiece_size() const;
+ void set_seed_sentencepiece_size(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_seed_sentencepiece_size() const;
- void _internal_set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_seed_sentencepiece_size() const;
+ void _internal_set_seed_sentencepiece_size(int32_t value);
public:
// optional float shrinking_factor = 15 [default = 0.75];
@@ -773,11 +754,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_num_threads() const;
public:
void clear_num_threads();
- ::PROTOBUF_NAMESPACE_ID::int32 num_threads() const;
- void set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t num_threads() const;
+ void set_num_threads(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_num_threads() const;
- void _internal_set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_num_threads() const;
+ void _internal_set_num_threads(int32_t value);
public:
// optional int32 num_sub_iterations = 17 [default = 2];
@@ -786,11 +767,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_num_sub_iterations() const;
public:
void clear_num_sub_iterations();
- ::PROTOBUF_NAMESPACE_ID::int32 num_sub_iterations() const;
- void set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t num_sub_iterations() const;
+ void set_num_sub_iterations(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_num_sub_iterations() const;
- void _internal_set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_num_sub_iterations() const;
+ void _internal_set_num_sub_iterations(int32_t value);
public:
// optional int32 max_sentence_length = 18 [default = 4192];
@@ -799,11 +780,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_max_sentence_length() const;
public:
void clear_max_sentence_length();
- ::PROTOBUF_NAMESPACE_ID::int32 max_sentence_length() const;
- void set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t max_sentence_length() const;
+ void set_max_sentence_length(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_max_sentence_length() const;
- void _internal_set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_max_sentence_length() const;
+ void _internal_set_max_sentence_length(int32_t value);
public:
// optional int32 max_sentencepiece_length = 20 [default = 16];
@@ -812,11 +793,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_max_sentencepiece_length() const;
public:
void clear_max_sentencepiece_length();
- ::PROTOBUF_NAMESPACE_ID::int32 max_sentencepiece_length() const;
- void set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t max_sentencepiece_length() const;
+ void set_max_sentencepiece_length(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_max_sentencepiece_length() const;
- void _internal_set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_max_sentencepiece_length() const;
+ void _internal_set_max_sentencepiece_length(int32_t value);
public:
// optional bool shuffle_input_sentence = 19 [default = true];
@@ -903,11 +884,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_bos_id() const;
public:
void clear_bos_id();
- ::PROTOBUF_NAMESPACE_ID::int32 bos_id() const;
- void set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t bos_id() const;
+ void set_bos_id(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_bos_id() const;
- void _internal_set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_bos_id() const;
+ void _internal_set_bos_id(int32_t value);
public:
// optional int32 eos_id = 42 [default = 2];
@@ -916,11 +897,11 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_eos_id() const;
public:
void clear_eos_id();
- ::PROTOBUF_NAMESPACE_ID::int32 eos_id() const;
- void set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t eos_id() const;
+ void set_eos_id(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_eos_id() const;
- void _internal_set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_eos_id() const;
+ void _internal_set_eos_id(int32_t value);
public:
// optional int32 pad_id = 43 [default = -1];
@@ -929,80 +910,273 @@ class TrainerSpec PROTOBUF_FINAL :
bool _internal_has_pad_id() const;
public:
void clear_pad_id();
- ::PROTOBUF_NAMESPACE_ID::int32 pad_id() const;
- void set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t pad_id() const;
+ void set_pad_id(int32_t value);
private:
- ::PROTOBUF_NAMESPACE_ID::int32 _internal_pad_id() const;
- void _internal_set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+ int32_t _internal_pad_id() const;
+ void _internal_set_pad_id(int32_t value);
public:
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TrainerSpec)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.TrainerSpec)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> input_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> accept_language_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> control_symbols_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> user_defined_symbols_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr model_prefix_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_format_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr required_chars_;
- static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_unk_surface_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr unk_surface_;
- static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_unk_piece_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr unk_piece_;
- static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_bos_piece_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr bos_piece_;
- static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_eos_piece_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr eos_piece_;
- static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_pad_piece_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr pad_piece_;
- ::PROTOBUF_NAMESPACE_ID::int32 self_test_sample_size_;
- ::PROTOBUF_NAMESPACE_ID::int32 mining_sentence_size_;
- ::PROTOBUF_NAMESPACE_ID::uint64 input_sentence_size_;
- ::PROTOBUF_NAMESPACE_ID::int32 training_sentence_size_;
- bool treat_whitespace_as_suffix_;
- bool allow_whitespace_only_pieces_;
- bool split_digits_;
- bool byte_fallback_;
- ::PROTOBUF_NAMESPACE_ID::int32 unk_id_;
- bool use_all_vocab_;
- bool train_extremely_large_corpus_;
- int model_type_;
- ::PROTOBUF_NAMESPACE_ID::int32 vocab_size_;
- float character_coverage_;
- ::PROTOBUF_NAMESPACE_ID::int32 seed_sentencepiece_size_;
- float shrinking_factor_;
- ::PROTOBUF_NAMESPACE_ID::int32 num_threads_;
- ::PROTOBUF_NAMESPACE_ID::int32 num_sub_iterations_;
- ::PROTOBUF_NAMESPACE_ID::int32 max_sentence_length_;
- ::PROTOBUF_NAMESPACE_ID::int32 max_sentencepiece_length_;
- bool shuffle_input_sentence_;
- bool split_by_unicode_script_;
- bool split_by_number_;
- bool split_by_whitespace_;
- bool vocabulary_output_piece_score_;
- bool hard_vocab_limit_;
- ::PROTOBUF_NAMESPACE_ID::int32 bos_id_;
- ::PROTOBUF_NAMESPACE_ID::int32 eos_id_;
- ::PROTOBUF_NAMESPACE_ID::int32 pad_id_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<2> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> input_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> accept_language_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> control_symbols_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> user_defined_symbols_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr model_prefix_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_format_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr required_chars_;
+ static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_unk_surface_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr unk_surface_;
+ static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_unk_piece_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr unk_piece_;
+ static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_bos_piece_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr bos_piece_;
+ static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_eos_piece_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr eos_piece_;
+ static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_pad_piece_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr pad_piece_;
+ int32_t self_test_sample_size_;
+ int32_t mining_sentence_size_;
+ uint64_t input_sentence_size_;
+ int32_t training_sentence_size_;
+ bool treat_whitespace_as_suffix_;
+ bool allow_whitespace_only_pieces_;
+ bool split_digits_;
+ bool byte_fallback_;
+ int32_t unk_id_;
+ bool use_all_vocab_;
+ bool train_extremely_large_corpus_;
+ int model_type_;
+ int32_t vocab_size_;
+ float character_coverage_;
+ int32_t seed_sentencepiece_size_;
+ float shrinking_factor_;
+ int32_t num_threads_;
+ int32_t num_sub_iterations_;
+ int32_t max_sentence_length_;
+ int32_t max_sentencepiece_length_;
+ bool shuffle_input_sentence_;
+ bool split_by_unicode_script_;
+ bool split_by_number_;
+ bool split_by_whitespace_;
+ bool vocabulary_output_piece_score_;
+ bool hard_vocab_limit_;
+ int32_t bos_id_;
+ int32_t eos_id_;
+ int32_t pad_id_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// -------------------------------------------------------------------
-class NormalizerSpec PROTOBUF_FINAL :
+class NormalizerSpec final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.NormalizerSpec) */ {
public:
inline NormalizerSpec() : NormalizerSpec(nullptr) {}
- virtual ~NormalizerSpec();
+ ~NormalizerSpec() override;
+ explicit PROTOBUF_CONSTEXPR NormalizerSpec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
NormalizerSpec(const NormalizerSpec& from);
NormalizerSpec(NormalizerSpec&& from) noexcept
@@ -1015,8 +1189,13 @@ class NormalizerSpec PROTOBUF_FINAL :
return *this;
}
inline NormalizerSpec& operator=(NormalizerSpec&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -1030,8 +1209,9 @@ class NormalizerSpec PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const NormalizerSpec& default_instance();
-
+ static const NormalizerSpec& default_instance() {
+ return *internal_default_instance();
+ }
static inline const NormalizerSpec* internal_default_instance() {
return reinterpret_cast<const NormalizerSpec*>(
&_NormalizerSpec_default_instance_);
@@ -1044,7 +1224,12 @@ class NormalizerSpec PROTOBUF_FINAL :
}
inline void Swap(NormalizerSpec* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1052,21 +1237,16 @@ class NormalizerSpec PROTOBUF_FINAL :
}
void UnsafeArenaSwap(NormalizerSpec* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline NormalizerSpec* New() const final {
- return CreateMaybeMessage<NormalizerSpec>(nullptr);
- }
-
- NormalizerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ NormalizerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<NormalizerSpec>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const NormalizerSpec& from);
void MergeFrom(const NormalizerSpec& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1074,25 +1254,24 @@ class NormalizerSpec PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(NormalizerSpec* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.NormalizerSpec";
}
protected:
- explicit NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -1116,16 +1295,14 @@ class NormalizerSpec PROTOBUF_FINAL :
public:
void clear_name();
const std::string& name() const;
- void set_name(const std::string& value);
- void set_name(std::string&& value);
- void set_name(const char* value);
- void set_name(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_name(ArgT0&& arg0, ArgT... args);
std::string* mutable_name();
- std::string* release_name();
+ PROTOBUF_NODISCARD std::string* release_name();
void set_allocated_name(std::string* name);
private:
const std::string& _internal_name() const;
- void _internal_set_name(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
std::string* _internal_mutable_name();
public:
@@ -1136,16 +1313,14 @@ class NormalizerSpec PROTOBUF_FINAL :
public:
void clear_precompiled_charsmap();
const std::string& precompiled_charsmap() const;
- void set_precompiled_charsmap(const std::string& value);
- void set_precompiled_charsmap(std::string&& value);
- void set_precompiled_charsmap(const char* value);
- void set_precompiled_charsmap(const void* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_precompiled_charsmap(ArgT0&& arg0, ArgT... args);
std::string* mutable_precompiled_charsmap();
- std::string* release_precompiled_charsmap();
+ PROTOBUF_NODISCARD std::string* release_precompiled_charsmap();
void set_allocated_precompiled_charsmap(std::string* precompiled_charsmap);
private:
const std::string& _internal_precompiled_charsmap() const;
- void _internal_set_precompiled_charsmap(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_precompiled_charsmap(const std::string& value);
std::string* _internal_mutable_precompiled_charsmap();
public:
@@ -1156,16 +1331,14 @@ class NormalizerSpec PROTOBUF_FINAL :
public:
void clear_normalization_rule_tsv();
const std::string& normalization_rule_tsv() const;
- void set_normalization_rule_tsv(const std::string& value);
- void set_normalization_rule_tsv(std::string&& value);
- void set_normalization_rule_tsv(const char* value);
- void set_normalization_rule_tsv(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_normalization_rule_tsv(ArgT0&& arg0, ArgT... args);
std::string* mutable_normalization_rule_tsv();
- std::string* release_normalization_rule_tsv();
+ PROTOBUF_NODISCARD std::string* release_normalization_rule_tsv();
void set_allocated_normalization_rule_tsv(std::string* normalization_rule_tsv);
private:
const std::string& _internal_normalization_rule_tsv() const;
- void _internal_set_normalization_rule_tsv(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_normalization_rule_tsv(const std::string& value);
std::string* _internal_mutable_normalization_rule_tsv();
public:
@@ -1208,33 +1381,226 @@ class NormalizerSpec PROTOBUF_FINAL :
void _internal_set_escape_whitespaces(bool value);
public:
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(NormalizerSpec)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.NormalizerSpec)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr precompiled_charsmap_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr normalization_rule_tsv_;
- bool add_dummy_prefix_;
- bool remove_extra_whitespaces_;
- bool escape_whitespaces_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr precompiled_charsmap_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr normalization_rule_tsv_;
+ bool add_dummy_prefix_;
+ bool remove_extra_whitespaces_;
+ bool escape_whitespaces_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// -------------------------------------------------------------------
-class SelfTestData_Sample PROTOBUF_FINAL :
+class SelfTestData_Sample final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SelfTestData.Sample) */ {
public:
inline SelfTestData_Sample() : SelfTestData_Sample(nullptr) {}
- virtual ~SelfTestData_Sample();
+ ~SelfTestData_Sample() override;
+ explicit PROTOBUF_CONSTEXPR SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
SelfTestData_Sample(const SelfTestData_Sample& from);
SelfTestData_Sample(SelfTestData_Sample&& from) noexcept
@@ -1247,8 +1613,13 @@ class SelfTestData_Sample PROTOBUF_FINAL :
return *this;
}
inline SelfTestData_Sample& operator=(SelfTestData_Sample&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -1262,8 +1633,9 @@ class SelfTestData_Sample PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const SelfTestData_Sample& default_instance();
-
+ static const SelfTestData_Sample& default_instance() {
+ return *internal_default_instance();
+ }
static inline const SelfTestData_Sample* internal_default_instance() {
return reinterpret_cast<const SelfTestData_Sample*>(
&_SelfTestData_Sample_default_instance_);
@@ -1276,7 +1648,12 @@ class SelfTestData_Sample PROTOBUF_FINAL :
}
inline void Swap(SelfTestData_Sample* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1284,21 +1661,16 @@ class SelfTestData_Sample PROTOBUF_FINAL :
}
void UnsafeArenaSwap(SelfTestData_Sample* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline SelfTestData_Sample* New() const final {
- return CreateMaybeMessage<SelfTestData_Sample>(nullptr);
- }
-
- SelfTestData_Sample* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ SelfTestData_Sample* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<SelfTestData_Sample>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const SelfTestData_Sample& from);
void MergeFrom(const SelfTestData_Sample& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1306,25 +1678,24 @@ class SelfTestData_Sample PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(SelfTestData_Sample* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.SelfTestData.Sample";
}
protected:
- explicit SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -1344,16 +1715,14 @@ class SelfTestData_Sample PROTOBUF_FINAL :
public:
void clear_input();
const std::string& input() const;
- void set_input(const std::string& value);
- void set_input(std::string&& value);
- void set_input(const char* value);
- void set_input(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_input(ArgT0&& arg0, ArgT... args);
std::string* mutable_input();
- std::string* release_input();
+ PROTOBUF_NODISCARD std::string* release_input();
void set_allocated_input(std::string* input);
private:
const std::string& _internal_input() const;
- void _internal_set_input(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_input(const std::string& value);
std::string* _internal_mutable_input();
public:
@@ -1364,16 +1733,14 @@ class SelfTestData_Sample PROTOBUF_FINAL :
public:
void clear_expected();
const std::string& expected() const;
- void set_expected(const std::string& value);
- void set_expected(std::string&& value);
- void set_expected(const char* value);
- void set_expected(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_expected(ArgT0&& arg0, ArgT... args);
std::string* mutable_expected();
- std::string* release_expected();
+ PROTOBUF_NODISCARD std::string* release_expected();
void set_allocated_expected(std::string* expected);
private:
const std::string& _internal_expected() const;
- void _internal_set_expected(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_expected(const std::string& value);
std::string* _internal_mutable_expected();
public:
@@ -1384,19 +1751,23 @@ class SelfTestData_Sample PROTOBUF_FINAL :
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr expected_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr input_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr expected_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// -------------------------------------------------------------------
-class SelfTestData PROTOBUF_FINAL :
+class SelfTestData final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SelfTestData) */ {
public:
inline SelfTestData() : SelfTestData(nullptr) {}
- virtual ~SelfTestData();
+ ~SelfTestData() override;
+ explicit PROTOBUF_CONSTEXPR SelfTestData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
SelfTestData(const SelfTestData& from);
SelfTestData(SelfTestData&& from) noexcept
@@ -1409,8 +1780,13 @@ class SelfTestData PROTOBUF_FINAL :
return *this;
}
inline SelfTestData& operator=(SelfTestData&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -1424,8 +1800,9 @@ class SelfTestData PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const SelfTestData& default_instance();
-
+ static const SelfTestData& default_instance() {
+ return *internal_default_instance();
+ }
static inline const SelfTestData* internal_default_instance() {
return reinterpret_cast<const SelfTestData*>(
&_SelfTestData_default_instance_);
@@ -1438,7 +1815,12 @@ class SelfTestData PROTOBUF_FINAL :
}
inline void Swap(SelfTestData* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1446,21 +1828,16 @@ class SelfTestData PROTOBUF_FINAL :
}
void UnsafeArenaSwap(SelfTestData* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline SelfTestData* New() const final {
- return CreateMaybeMessage<SelfTestData>(nullptr);
- }
-
- SelfTestData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ SelfTestData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<SelfTestData>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const SelfTestData& from);
void MergeFrom(const SelfTestData& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1468,25 +1845,24 @@ class SelfTestData PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(SelfTestData* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.SelfTestData";
}
protected:
- explicit SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -1518,27 +1894,220 @@ class SelfTestData PROTOBUF_FINAL :
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample >&
samples() const;
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SelfTestData)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.SelfTestData)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample > samples_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample > samples_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// -------------------------------------------------------------------
-class ModelProto_SentencePiece PROTOBUF_FINAL :
+class ModelProto_SentencePiece final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.ModelProto.SentencePiece) */ {
public:
inline ModelProto_SentencePiece() : ModelProto_SentencePiece(nullptr) {}
- virtual ~ModelProto_SentencePiece();
+ ~ModelProto_SentencePiece() override;
+ explicit PROTOBUF_CONSTEXPR ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
ModelProto_SentencePiece(const ModelProto_SentencePiece& from);
ModelProto_SentencePiece(ModelProto_SentencePiece&& from) noexcept
@@ -1551,8 +2120,13 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
return *this;
}
inline ModelProto_SentencePiece& operator=(ModelProto_SentencePiece&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -1566,8 +2140,9 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const ModelProto_SentencePiece& default_instance();
-
+ static const ModelProto_SentencePiece& default_instance() {
+ return *internal_default_instance();
+ }
static inline const ModelProto_SentencePiece* internal_default_instance() {
return reinterpret_cast<const ModelProto_SentencePiece*>(
&_ModelProto_SentencePiece_default_instance_);
@@ -1580,7 +2155,12 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
}
inline void Swap(ModelProto_SentencePiece* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1588,21 +2168,16 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
}
void UnsafeArenaSwap(ModelProto_SentencePiece* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline ModelProto_SentencePiece* New() const final {
- return CreateMaybeMessage<ModelProto_SentencePiece>(nullptr);
- }
-
- ModelProto_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ ModelProto_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<ModelProto_SentencePiece>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const ModelProto_SentencePiece& from);
void MergeFrom(const ModelProto_SentencePiece& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1610,25 +2185,24 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(ModelProto_SentencePiece* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.ModelProto.SentencePiece";
}
protected:
- explicit ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -1683,16 +2257,14 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
public:
void clear_piece();
const std::string& piece() const;
- void set_piece(const std::string& value);
- void set_piece(std::string&& value);
- void set_piece(const char* value);
- void set_piece(const char* value, size_t size);
+ template <typename ArgT0 = const std::string&, typename... ArgT>
+ void set_piece(ArgT0&& arg0, ArgT... args);
std::string* mutable_piece();
- std::string* release_piece();
+ PROTOBUF_NODISCARD std::string* release_piece();
void set_allocated_piece(std::string* piece);
private:
const std::string& _internal_piece() const;
- void _internal_set_piece(const std::string& value);
+ inline PROTOBUF_ALWAYS_INLINE void _internal_set_piece(const std::string& value);
std::string* _internal_mutable_piece();
public:
@@ -1722,30 +2294,223 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
void _internal_set_type(::sentencepiece::ModelProto_SentencePiece_Type value);
public:
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ModelProto_SentencePiece)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.ModelProto.SentencePiece)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr piece_;
- float score_;
- int type_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr piece_;
+ float score_;
+ int type_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// -------------------------------------------------------------------
-class ModelProto PROTOBUF_FINAL :
+class ModelProto final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.ModelProto) */ {
public:
inline ModelProto() : ModelProto(nullptr) {}
- virtual ~ModelProto();
+ ~ModelProto() override;
+ explicit PROTOBUF_CONSTEXPR ModelProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
ModelProto(const ModelProto& from);
ModelProto(ModelProto&& from) noexcept
@@ -1758,8 +2523,13 @@ class ModelProto PROTOBUF_FINAL :
return *this;
}
inline ModelProto& operator=(ModelProto&& from) noexcept {
- if (GetArena() == from.GetArena()) {
- if (this != &from) InternalSwap(&from);
+ if (this == &from) return *this;
+ if (GetOwningArena() == from.GetOwningArena()
+ #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+ && GetOwningArena() != nullptr
+ #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
+ ) {
+ InternalSwap(&from);
} else {
CopyFrom(from);
}
@@ -1773,8 +2543,9 @@ class ModelProto PROTOBUF_FINAL :
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
- static const ModelProto& default_instance();
-
+ static const ModelProto& default_instance() {
+ return *internal_default_instance();
+ }
static inline const ModelProto* internal_default_instance() {
return reinterpret_cast<const ModelProto*>(
&_ModelProto_default_instance_);
@@ -1787,7 +2558,12 @@ class ModelProto PROTOBUF_FINAL :
}
inline void Swap(ModelProto* other) {
if (other == this) return;
- if (GetArena() == other->GetArena()) {
+ #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() != nullptr &&
+ GetOwningArena() == other->GetOwningArena()) {
+ #else // PROTOBUF_FORCE_COPY_IN_SWAP
+ if (GetOwningArena() == other->GetOwningArena()) {
+ #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1795,21 +2571,16 @@ class ModelProto PROTOBUF_FINAL :
}
void UnsafeArenaSwap(ModelProto* other) {
if (other == this) return;
- GOOGLE_DCHECK(GetArena() == other->GetArena());
+ GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
- inline ModelProto* New() const final {
- return CreateMaybeMessage<ModelProto>(nullptr);
- }
-
- ModelProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+ ModelProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<ModelProto>(arena);
}
- void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
- final;
+ void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const ModelProto& from);
void MergeFrom(const ModelProto& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1817,25 +2588,24 @@ class ModelProto PROTOBUF_FINAL :
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
- ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
- ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
- void DiscardUnknownFields();
- int GetCachedSize() const final { return _cached_size_.Get(); }
+ uint8_t* _InternalSerialize(
+ uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+ int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
- inline void SharedCtor();
- inline void SharedDtor();
+ void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
+ void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(ModelProto* other);
+
+ private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "sentencepiece.ModelProto";
}
protected:
- explicit ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena);
- private:
- static void ArenaDtor(void* object);
- inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+ explicit ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+ bool is_message_owned = false);
public:
std::string GetTypeName() const final;
@@ -1878,7 +2648,7 @@ class ModelProto PROTOBUF_FINAL :
public:
void clear_trainer_spec();
const ::sentencepiece::TrainerSpec& trainer_spec() const;
- ::sentencepiece::TrainerSpec* release_trainer_spec();
+ PROTOBUF_NODISCARD ::sentencepiece::TrainerSpec* release_trainer_spec();
::sentencepiece::TrainerSpec* mutable_trainer_spec();
void set_allocated_trainer_spec(::sentencepiece::TrainerSpec* trainer_spec);
private:
@@ -1896,7 +2666,7 @@ class ModelProto PROTOBUF_FINAL :
public:
void clear_normalizer_spec();
const ::sentencepiece::NormalizerSpec& normalizer_spec() const;
- ::sentencepiece::NormalizerSpec* release_normalizer_spec();
+ PROTOBUF_NODISCARD ::sentencepiece::NormalizerSpec* release_normalizer_spec();
::sentencepiece::NormalizerSpec* mutable_normalizer_spec();
void set_allocated_normalizer_spec(::sentencepiece::NormalizerSpec* normalizer_spec);
private:
@@ -1914,7 +2684,7 @@ class ModelProto PROTOBUF_FINAL :
public:
void clear_self_test_data();
const ::sentencepiece::SelfTestData& self_test_data() const;
- ::sentencepiece::SelfTestData* release_self_test_data();
+ PROTOBUF_NODISCARD ::sentencepiece::SelfTestData* release_self_test_data();
::sentencepiece::SelfTestData* mutable_self_test_data();
void set_allocated_self_test_data(::sentencepiece::SelfTestData* self_test_data);
private:
@@ -1932,7 +2702,7 @@ class ModelProto PROTOBUF_FINAL :
public:
void clear_denormalizer_spec();
const ::sentencepiece::NormalizerSpec& denormalizer_spec() const;
- ::sentencepiece::NormalizerSpec* release_denormalizer_spec();
+ PROTOBUF_NODISCARD ::sentencepiece::NormalizerSpec* release_denormalizer_spec();
::sentencepiece::NormalizerSpec* mutable_denormalizer_spec();
void set_allocated_denormalizer_spec(::sentencepiece::NormalizerSpec* denormalizer_spec);
private:
@@ -1943,23 +2713,215 @@ class ModelProto PROTOBUF_FINAL :
::sentencepiece::NormalizerSpec* denormalizer_spec);
::sentencepiece::NormalizerSpec* unsafe_arena_release_denormalizer_spec();
- GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ModelProto)
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline bool HasExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.Has(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void ClearExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ _impl_._extensions_.ClearExtension(id.number());
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline int ExtensionSize(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _impl_._extensions_.ExtensionSize(id.number());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_,
+ id.default_value());
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Mutable(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+ &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void UnsafeArenaSetAllocatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Singular::MutableType value) {
+ _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+ value, &_impl_._extensions_);
+
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ PROTOBUF_NODISCARD inline
+ typename _proto_TypeTraits::Singular::MutableType
+ ReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::Release(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Singular::MutableType
+ UnsafeArenaReleaseExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+ &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) const {
+
+ return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index) {
+
+ return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void SetExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+ typename _proto_TypeTraits::Repeated::MutableType to_add =
+ _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_);
+
+ return to_add;
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline void AddExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+ typename _proto_TypeTraits::Repeated::ConstType value) {
+ _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+ &_impl_._extensions_);
+
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+ GetRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+ return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_);
+ }
+
+ template <typename _proto_TypeTraits,
+ ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+ bool _is_packed>
+ inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+ MutableRepeatedExtension(
+ const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+ ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+ return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+ _is_packed, &_impl_._extensions_);
+ }
+
// @@protoc_insertion_point(class_scope:sentencepiece.ModelProto)
private:
class _Internal;
- ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
-
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
- ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
- mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
- ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::ModelProto_SentencePiece > pieces_;
- ::sentencepiece::TrainerSpec* trainer_spec_;
- ::sentencepiece::NormalizerSpec* normalizer_spec_;
- ::sentencepiece::SelfTestData* self_test_data_;
- ::sentencepiece::NormalizerSpec* denormalizer_spec_;
+ struct Impl_ {
+ ::PROTOBUF_NAMESPACE_ID::internal::ExtensionSet _extensions_;
+
+ ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+ ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::ModelProto_SentencePiece > pieces_;
+ ::sentencepiece::TrainerSpec* trainer_spec_;
+ ::sentencepiece::NormalizerSpec* normalizer_spec_;
+ ::sentencepiece::SelfTestData* self_test_data_;
+ ::sentencepiece::NormalizerSpec* denormalizer_spec_;
+ };
+ union { Impl_ _impl_; };
friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
};
// ===================================================================
@@ -1975,20 +2937,21 @@ class ModelProto PROTOBUF_FINAL :
// repeated string input = 1;
inline int TrainerSpec::_internal_input_size() const {
- return input_.size();
+ return _impl_.input_.size();
}
inline int TrainerSpec::input_size() const {
return _internal_input_size();
}
inline void TrainerSpec::clear_input() {
- input_.Clear();
+ _impl_.input_.Clear();
}
inline std::string* TrainerSpec::add_input() {
+ std::string* _s = _internal_add_input();
// @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.input)
- return _internal_add_input();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_input(int index) const {
- return input_.Get(index);
+ return _impl_.input_.Get(index);
}
inline const std::string& TrainerSpec::input(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.input)
@@ -1996,217 +2959,207 @@ inline const std::string& TrainerSpec::input(int index) const {
}
inline std::string* TrainerSpec::mutable_input(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.input)
- return input_.Mutable(index);
+ return _impl_.input_.Mutable(index);
}
inline void TrainerSpec::set_input(int index, const std::string& value) {
+ _impl_.input_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
- input_.Mutable(index)->assign(value);
}
inline void TrainerSpec::set_input(int index, std::string&& value) {
+ _impl_.input_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
- input_.Mutable(index)->assign(std::move(value));
}
inline void TrainerSpec::set_input(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
- input_.Mutable(index)->assign(value);
+ _impl_.input_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.input)
}
inline void TrainerSpec::set_input(int index, const char* value, size_t size) {
- input_.Mutable(index)->assign(
+ _impl_.input_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.input)
}
inline std::string* TrainerSpec::_internal_add_input() {
- return input_.Add();
+ return _impl_.input_.Add();
}
inline void TrainerSpec::add_input(const std::string& value) {
- input_.Add()->assign(value);
+ _impl_.input_.Add()->assign(value);
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.input)
}
inline void TrainerSpec::add_input(std::string&& value) {
- input_.Add(std::move(value));
+ _impl_.input_.Add(std::move(value));
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.input)
}
inline void TrainerSpec::add_input(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- input_.Add()->assign(value);
+ _impl_.input_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:sentencepiece.TrainerSpec.input)
}
inline void TrainerSpec::add_input(const char* value, size_t size) {
- input_.Add()->assign(reinterpret_cast<const char*>(value), size);
+ _impl_.input_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:sentencepiece.TrainerSpec.input)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
TrainerSpec::input() const {
// @@protoc_insertion_point(field_list:sentencepiece.TrainerSpec.input)
- return input_;
+ return _impl_.input_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
TrainerSpec::mutable_input() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.TrainerSpec.input)
- return &input_;
+ return &_impl_.input_;
}
// optional string input_format = 7;
inline bool TrainerSpec::_internal_has_input_format() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool TrainerSpec::has_input_format() const {
return _internal_has_input_format();
}
inline void TrainerSpec::clear_input_format() {
- input_format_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.input_format_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& TrainerSpec::input_format() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.input_format)
return _internal_input_format();
}
-inline void TrainerSpec::set_input_format(const std::string& value) {
- _internal_set_input_format(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_input_format(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.input_format_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input_format)
}
inline std::string* TrainerSpec::mutable_input_format() {
+ std::string* _s = _internal_mutable_input_format();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.input_format)
- return _internal_mutable_input_format();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_input_format() const {
- return input_format_.Get();
+ return _impl_.input_format_.Get();
}
inline void TrainerSpec::_internal_set_input_format(const std::string& value) {
- _has_bits_[0] |= 0x00000002u;
- input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_input_format(std::string&& value) {
- _has_bits_[0] |= 0x00000002u;
- input_format_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.input_format)
-}
-inline void TrainerSpec::set_input_format(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000002u;
- input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.input_format)
-}
-inline void TrainerSpec::set_input_format(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000002u;
- input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.input_format)
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.input_format_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_input_format() {
- _has_bits_[0] |= 0x00000002u;
- return input_format_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000002u;
+ return _impl_.input_format_.Mutable(GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_input_format() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.input_format)
if (!_internal_has_input_format()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000002u;
- return input_format_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ auto* p = _impl_.input_format_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.input_format_.IsDefault()) {
+ _impl_.input_format_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void TrainerSpec::set_allocated_input_format(std::string* input_format) {
if (input_format != nullptr) {
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ }
+ _impl_.input_format_.SetAllocated(input_format, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.input_format_.IsDefault()) {
+ _impl_.input_format_.Set("", GetArenaForAllocation());
}
- input_format_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input_format,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.input_format)
}
// optional string model_prefix = 2;
inline bool TrainerSpec::_internal_has_model_prefix() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool TrainerSpec::has_model_prefix() const {
return _internal_has_model_prefix();
}
inline void TrainerSpec::clear_model_prefix() {
- model_prefix_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.model_prefix_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& TrainerSpec::model_prefix() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.model_prefix)
return _internal_model_prefix();
}
-inline void TrainerSpec::set_model_prefix(const std::string& value) {
- _internal_set_model_prefix(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_model_prefix(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.model_prefix_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.model_prefix)
}
inline std::string* TrainerSpec::mutable_model_prefix() {
+ std::string* _s = _internal_mutable_model_prefix();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.model_prefix)
- return _internal_mutable_model_prefix();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_model_prefix() const {
- return model_prefix_.Get();
+ return _impl_.model_prefix_.Get();
}
inline void TrainerSpec::_internal_set_model_prefix(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_model_prefix(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- model_prefix_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.model_prefix)
-}
-inline void TrainerSpec::set_model_prefix(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.model_prefix)
-}
-inline void TrainerSpec::set_model_prefix(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.model_prefix)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.model_prefix_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_model_prefix() {
- _has_bits_[0] |= 0x00000001u;
- return model_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.model_prefix_.Mutable(GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_model_prefix() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.model_prefix)
if (!_internal_has_model_prefix()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return model_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.model_prefix_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.model_prefix_.IsDefault()) {
+ _impl_.model_prefix_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void TrainerSpec::set_allocated_model_prefix(std::string* model_prefix) {
if (model_prefix != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
- model_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), model_prefix,
- GetArena());
+ _impl_.model_prefix_.SetAllocated(model_prefix, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.model_prefix_.IsDefault()) {
+ _impl_.model_prefix_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.model_prefix)
}
// optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
inline bool TrainerSpec::_internal_has_model_type() const {
- bool value = (_has_bits_[0] & 0x00080000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00080000u) != 0;
return value;
}
inline bool TrainerSpec::has_model_type() const {
return _internal_has_model_type();
}
inline void TrainerSpec::clear_model_type() {
- model_type_ = 1;
- _has_bits_[0] &= ~0x00080000u;
+ _impl_.model_type_ = 1;
+ _impl_._has_bits_[0] &= ~0x00080000u;
}
inline ::sentencepiece::TrainerSpec_ModelType TrainerSpec::_internal_model_type() const {
- return static_cast< ::sentencepiece::TrainerSpec_ModelType >(model_type_);
+ return static_cast< ::sentencepiece::TrainerSpec_ModelType >(_impl_.model_type_);
}
inline ::sentencepiece::TrainerSpec_ModelType TrainerSpec::model_type() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.model_type)
@@ -2214,8 +3167,8 @@ inline ::sentencepiece::TrainerSpec_ModelType TrainerSpec::model_type() const {
}
inline void TrainerSpec::_internal_set_model_type(::sentencepiece::TrainerSpec_ModelType value) {
assert(::sentencepiece::TrainerSpec_ModelType_IsValid(value));
- _has_bits_[0] |= 0x00080000u;
- model_type_ = value;
+ _impl_._has_bits_[0] |= 0x00080000u;
+ _impl_.model_type_ = value;
}
inline void TrainerSpec::set_model_type(::sentencepiece::TrainerSpec_ModelType value) {
_internal_set_model_type(value);
@@ -2224,48 +3177,49 @@ inline void TrainerSpec::set_model_type(::sentencepiece::TrainerSpec_ModelType v
// optional int32 vocab_size = 4 [default = 8000];
inline bool TrainerSpec::_internal_has_vocab_size() const {
- bool value = (_has_bits_[0] & 0x00100000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00100000u) != 0;
return value;
}
inline bool TrainerSpec::has_vocab_size() const {
return _internal_has_vocab_size();
}
inline void TrainerSpec::clear_vocab_size() {
- vocab_size_ = 8000;
- _has_bits_[0] &= ~0x00100000u;
+ _impl_.vocab_size_ = 8000;
+ _impl_._has_bits_[0] &= ~0x00100000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_vocab_size() const {
- return vocab_size_;
+inline int32_t TrainerSpec::_internal_vocab_size() const {
+ return _impl_.vocab_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::vocab_size() const {
+inline int32_t TrainerSpec::vocab_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.vocab_size)
return _internal_vocab_size();
}
-inline void TrainerSpec::_internal_set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00100000u;
- vocab_size_ = value;
+inline void TrainerSpec::_internal_set_vocab_size(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00100000u;
+ _impl_.vocab_size_ = value;
}
-inline void TrainerSpec::set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_vocab_size(int32_t value) {
_internal_set_vocab_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.vocab_size)
}
// repeated string accept_language = 5;
inline int TrainerSpec::_internal_accept_language_size() const {
- return accept_language_.size();
+ return _impl_.accept_language_.size();
}
inline int TrainerSpec::accept_language_size() const {
return _internal_accept_language_size();
}
inline void TrainerSpec::clear_accept_language() {
- accept_language_.Clear();
+ _impl_.accept_language_.Clear();
}
inline std::string* TrainerSpec::add_accept_language() {
+ std::string* _s = _internal_add_accept_language();
// @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.accept_language)
- return _internal_add_accept_language();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_accept_language(int index) const {
- return accept_language_.Get(index);
+ return _impl_.accept_language_.Get(index);
}
inline const std::string& TrainerSpec::accept_language(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.accept_language)
@@ -2273,107 +3227,107 @@ inline const std::string& TrainerSpec::accept_language(int index) const {
}
inline std::string* TrainerSpec::mutable_accept_language(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.accept_language)
- return accept_language_.Mutable(index);
+ return _impl_.accept_language_.Mutable(index);
}
inline void TrainerSpec::set_accept_language(int index, const std::string& value) {
+ _impl_.accept_language_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
- accept_language_.Mutable(index)->assign(value);
}
inline void TrainerSpec::set_accept_language(int index, std::string&& value) {
+ _impl_.accept_language_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
- accept_language_.Mutable(index)->assign(std::move(value));
}
inline void TrainerSpec::set_accept_language(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
- accept_language_.Mutable(index)->assign(value);
+ _impl_.accept_language_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.accept_language)
}
inline void TrainerSpec::set_accept_language(int index, const char* value, size_t size) {
- accept_language_.Mutable(index)->assign(
+ _impl_.accept_language_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.accept_language)
}
inline std::string* TrainerSpec::_internal_add_accept_language() {
- return accept_language_.Add();
+ return _impl_.accept_language_.Add();
}
inline void TrainerSpec::add_accept_language(const std::string& value) {
- accept_language_.Add()->assign(value);
+ _impl_.accept_language_.Add()->assign(value);
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.accept_language)
}
inline void TrainerSpec::add_accept_language(std::string&& value) {
- accept_language_.Add(std::move(value));
+ _impl_.accept_language_.Add(std::move(value));
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.accept_language)
}
inline void TrainerSpec::add_accept_language(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- accept_language_.Add()->assign(value);
+ _impl_.accept_language_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:sentencepiece.TrainerSpec.accept_language)
}
inline void TrainerSpec::add_accept_language(const char* value, size_t size) {
- accept_language_.Add()->assign(reinterpret_cast<const char*>(value), size);
+ _impl_.accept_language_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:sentencepiece.TrainerSpec.accept_language)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
TrainerSpec::accept_language() const {
// @@protoc_insertion_point(field_list:sentencepiece.TrainerSpec.accept_language)
- return accept_language_;
+ return _impl_.accept_language_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
TrainerSpec::mutable_accept_language() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.TrainerSpec.accept_language)
- return &accept_language_;
+ return &_impl_.accept_language_;
}
// optional int32 self_test_sample_size = 6 [default = 0];
inline bool TrainerSpec::_internal_has_self_test_sample_size() const {
- bool value = (_has_bits_[0] & 0x00000100u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0;
return value;
}
inline bool TrainerSpec::has_self_test_sample_size() const {
return _internal_has_self_test_sample_size();
}
inline void TrainerSpec::clear_self_test_sample_size() {
- self_test_sample_size_ = 0;
- _has_bits_[0] &= ~0x00000100u;
+ _impl_.self_test_sample_size_ = 0;
+ _impl_._has_bits_[0] &= ~0x00000100u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_self_test_sample_size() const {
- return self_test_sample_size_;
+inline int32_t TrainerSpec::_internal_self_test_sample_size() const {
+ return _impl_.self_test_sample_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::self_test_sample_size() const {
+inline int32_t TrainerSpec::self_test_sample_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.self_test_sample_size)
return _internal_self_test_sample_size();
}
-inline void TrainerSpec::_internal_set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00000100u;
- self_test_sample_size_ = value;
+inline void TrainerSpec::_internal_set_self_test_sample_size(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00000100u;
+ _impl_.self_test_sample_size_ = value;
}
-inline void TrainerSpec::set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_self_test_sample_size(int32_t value) {
_internal_set_self_test_sample_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.self_test_sample_size)
}
// optional float character_coverage = 10 [default = 0.9995];
inline bool TrainerSpec::_internal_has_character_coverage() const {
- bool value = (_has_bits_[0] & 0x00200000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00200000u) != 0;
return value;
}
inline bool TrainerSpec::has_character_coverage() const {
return _internal_has_character_coverage();
}
inline void TrainerSpec::clear_character_coverage() {
- character_coverage_ = 0.9995f;
- _has_bits_[0] &= ~0x00200000u;
+ _impl_.character_coverage_ = 0.9995f;
+ _impl_._has_bits_[0] &= ~0x00200000u;
}
inline float TrainerSpec::_internal_character_coverage() const {
- return character_coverage_;
+ return _impl_.character_coverage_;
}
inline float TrainerSpec::character_coverage() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.character_coverage)
return _internal_character_coverage();
}
inline void TrainerSpec::_internal_set_character_coverage(float value) {
- _has_bits_[0] |= 0x00200000u;
- character_coverage_ = value;
+ _impl_._has_bits_[0] |= 0x00200000u;
+ _impl_.character_coverage_ = value;
}
inline void TrainerSpec::set_character_coverage(float value) {
_internal_set_character_coverage(value);
@@ -2382,54 +3336,54 @@ inline void TrainerSpec::set_character_coverage(float value) {
// optional uint64 input_sentence_size = 11 [default = 0];
inline bool TrainerSpec::_internal_has_input_sentence_size() const {
- bool value = (_has_bits_[0] & 0x00000400u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0;
return value;
}
inline bool TrainerSpec::has_input_sentence_size() const {
return _internal_has_input_sentence_size();
}
inline void TrainerSpec::clear_input_sentence_size() {
- input_sentence_size_ = PROTOBUF_ULONGLONG(0);
- _has_bits_[0] &= ~0x00000400u;
+ _impl_.input_sentence_size_ = uint64_t{0u};
+ _impl_._has_bits_[0] &= ~0x00000400u;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint64 TrainerSpec::_internal_input_sentence_size() const {
- return input_sentence_size_;
+inline uint64_t TrainerSpec::_internal_input_sentence_size() const {
+ return _impl_.input_sentence_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::uint64 TrainerSpec::input_sentence_size() const {
+inline uint64_t TrainerSpec::input_sentence_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.input_sentence_size)
return _internal_input_sentence_size();
}
-inline void TrainerSpec::_internal_set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value) {
- _has_bits_[0] |= 0x00000400u;
- input_sentence_size_ = value;
+inline void TrainerSpec::_internal_set_input_sentence_size(uint64_t value) {
+ _impl_._has_bits_[0] |= 0x00000400u;
+ _impl_.input_sentence_size_ = value;
}
-inline void TrainerSpec::set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value) {
+inline void TrainerSpec::set_input_sentence_size(uint64_t value) {
_internal_set_input_sentence_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input_sentence_size)
}
// optional bool shuffle_input_sentence = 19 [default = true];
inline bool TrainerSpec::_internal_has_shuffle_input_sentence() const {
- bool value = (_has_bits_[0] & 0x10000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x10000000u) != 0;
return value;
}
inline bool TrainerSpec::has_shuffle_input_sentence() const {
return _internal_has_shuffle_input_sentence();
}
inline void TrainerSpec::clear_shuffle_input_sentence() {
- shuffle_input_sentence_ = true;
- _has_bits_[0] &= ~0x10000000u;
+ _impl_.shuffle_input_sentence_ = true;
+ _impl_._has_bits_[0] &= ~0x10000000u;
}
inline bool TrainerSpec::_internal_shuffle_input_sentence() const {
- return shuffle_input_sentence_;
+ return _impl_.shuffle_input_sentence_;
}
inline bool TrainerSpec::shuffle_input_sentence() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.shuffle_input_sentence)
return _internal_shuffle_input_sentence();
}
inline void TrainerSpec::_internal_set_shuffle_input_sentence(bool value) {
- _has_bits_[0] |= 0x10000000u;
- shuffle_input_sentence_ = value;
+ _impl_._has_bits_[0] |= 0x10000000u;
+ _impl_.shuffle_input_sentence_ = value;
}
inline void TrainerSpec::set_shuffle_input_sentence(bool value) {
_internal_set_shuffle_input_sentence(value);
@@ -2438,110 +3392,110 @@ inline void TrainerSpec::set_shuffle_input_sentence(bool value) {
// optional int32 mining_sentence_size = 12 [deprecated = true];
inline bool TrainerSpec::_internal_has_mining_sentence_size() const {
- bool value = (_has_bits_[0] & 0x00000200u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0;
return value;
}
inline bool TrainerSpec::has_mining_sentence_size() const {
return _internal_has_mining_sentence_size();
}
inline void TrainerSpec::clear_mining_sentence_size() {
- mining_sentence_size_ = 0;
- _has_bits_[0] &= ~0x00000200u;
+ _impl_.mining_sentence_size_ = 0;
+ _impl_._has_bits_[0] &= ~0x00000200u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_mining_sentence_size() const {
- return mining_sentence_size_;
+inline int32_t TrainerSpec::_internal_mining_sentence_size() const {
+ return _impl_.mining_sentence_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::mining_sentence_size() const {
+inline int32_t TrainerSpec::mining_sentence_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.mining_sentence_size)
return _internal_mining_sentence_size();
}
-inline void TrainerSpec::_internal_set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00000200u;
- mining_sentence_size_ = value;
+inline void TrainerSpec::_internal_set_mining_sentence_size(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00000200u;
+ _impl_.mining_sentence_size_ = value;
}
-inline void TrainerSpec::set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_mining_sentence_size(int32_t value) {
_internal_set_mining_sentence_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.mining_sentence_size)
}
// optional int32 training_sentence_size = 13 [deprecated = true];
inline bool TrainerSpec::_internal_has_training_sentence_size() const {
- bool value = (_has_bits_[0] & 0x00000800u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0;
return value;
}
inline bool TrainerSpec::has_training_sentence_size() const {
return _internal_has_training_sentence_size();
}
inline void TrainerSpec::clear_training_sentence_size() {
- training_sentence_size_ = 0;
- _has_bits_[0] &= ~0x00000800u;
+ _impl_.training_sentence_size_ = 0;
+ _impl_._has_bits_[0] &= ~0x00000800u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_training_sentence_size() const {
- return training_sentence_size_;
+inline int32_t TrainerSpec::_internal_training_sentence_size() const {
+ return _impl_.training_sentence_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::training_sentence_size() const {
+inline int32_t TrainerSpec::training_sentence_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.training_sentence_size)
return _internal_training_sentence_size();
}
-inline void TrainerSpec::_internal_set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00000800u;
- training_sentence_size_ = value;
+inline void TrainerSpec::_internal_set_training_sentence_size(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00000800u;
+ _impl_.training_sentence_size_ = value;
}
-inline void TrainerSpec::set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_training_sentence_size(int32_t value) {
_internal_set_training_sentence_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.training_sentence_size)
}
// optional int32 seed_sentencepiece_size = 14 [default = 1000000];
inline bool TrainerSpec::_internal_has_seed_sentencepiece_size() const {
- bool value = (_has_bits_[0] & 0x00400000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00400000u) != 0;
return value;
}
inline bool TrainerSpec::has_seed_sentencepiece_size() const {
return _internal_has_seed_sentencepiece_size();
}
inline void TrainerSpec::clear_seed_sentencepiece_size() {
- seed_sentencepiece_size_ = 1000000;
- _has_bits_[0] &= ~0x00400000u;
+ _impl_.seed_sentencepiece_size_ = 1000000;
+ _impl_._has_bits_[0] &= ~0x00400000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_seed_sentencepiece_size() const {
- return seed_sentencepiece_size_;
+inline int32_t TrainerSpec::_internal_seed_sentencepiece_size() const {
+ return _impl_.seed_sentencepiece_size_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::seed_sentencepiece_size() const {
+inline int32_t TrainerSpec::seed_sentencepiece_size() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.seed_sentencepiece_size)
return _internal_seed_sentencepiece_size();
}
-inline void TrainerSpec::_internal_set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00400000u;
- seed_sentencepiece_size_ = value;
+inline void TrainerSpec::_internal_set_seed_sentencepiece_size(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00400000u;
+ _impl_.seed_sentencepiece_size_ = value;
}
-inline void TrainerSpec::set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_seed_sentencepiece_size(int32_t value) {
_internal_set_seed_sentencepiece_size(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.seed_sentencepiece_size)
}
// optional float shrinking_factor = 15 [default = 0.75];
inline bool TrainerSpec::_internal_has_shrinking_factor() const {
- bool value = (_has_bits_[0] & 0x00800000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00800000u) != 0;
return value;
}
inline bool TrainerSpec::has_shrinking_factor() const {
return _internal_has_shrinking_factor();
}
inline void TrainerSpec::clear_shrinking_factor() {
- shrinking_factor_ = 0.75f;
- _has_bits_[0] &= ~0x00800000u;
+ _impl_.shrinking_factor_ = 0.75f;
+ _impl_._has_bits_[0] &= ~0x00800000u;
}
inline float TrainerSpec::_internal_shrinking_factor() const {
- return shrinking_factor_;
+ return _impl_.shrinking_factor_;
}
inline float TrainerSpec::shrinking_factor() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.shrinking_factor)
return _internal_shrinking_factor();
}
inline void TrainerSpec::_internal_set_shrinking_factor(float value) {
- _has_bits_[0] |= 0x00800000u;
- shrinking_factor_ = value;
+ _impl_._has_bits_[0] |= 0x00800000u;
+ _impl_.shrinking_factor_ = value;
}
inline void TrainerSpec::set_shrinking_factor(float value) {
_internal_set_shrinking_factor(value);
@@ -2550,138 +3504,138 @@ inline void TrainerSpec::set_shrinking_factor(float value) {
// optional int32 max_sentence_length = 18 [default = 4192];
inline bool TrainerSpec::_internal_has_max_sentence_length() const {
- bool value = (_has_bits_[0] & 0x04000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x04000000u) != 0;
return value;
}
inline bool TrainerSpec::has_max_sentence_length() const {
return _internal_has_max_sentence_length();
}
inline void TrainerSpec::clear_max_sentence_length() {
- max_sentence_length_ = 4192;
- _has_bits_[0] &= ~0x04000000u;
+ _impl_.max_sentence_length_ = 4192;
+ _impl_._has_bits_[0] &= ~0x04000000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_max_sentence_length() const {
- return max_sentence_length_;
+inline int32_t TrainerSpec::_internal_max_sentence_length() const {
+ return _impl_.max_sentence_length_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::max_sentence_length() const {
+inline int32_t TrainerSpec::max_sentence_length() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.max_sentence_length)
return _internal_max_sentence_length();
}
-inline void TrainerSpec::_internal_set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x04000000u;
- max_sentence_length_ = value;
+inline void TrainerSpec::_internal_set_max_sentence_length(int32_t value) {
+ _impl_._has_bits_[0] |= 0x04000000u;
+ _impl_.max_sentence_length_ = value;
}
-inline void TrainerSpec::set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_max_sentence_length(int32_t value) {
_internal_set_max_sentence_length(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.max_sentence_length)
}
// optional int32 num_threads = 16 [default = 16];
inline bool TrainerSpec::_internal_has_num_threads() const {
- bool value = (_has_bits_[0] & 0x01000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x01000000u) != 0;
return value;
}
inline bool TrainerSpec::has_num_threads() const {
return _internal_has_num_threads();
}
inline void TrainerSpec::clear_num_threads() {
- num_threads_ = 16;
- _has_bits_[0] &= ~0x01000000u;
+ _impl_.num_threads_ = 16;
+ _impl_._has_bits_[0] &= ~0x01000000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_num_threads() const {
- return num_threads_;
+inline int32_t TrainerSpec::_internal_num_threads() const {
+ return _impl_.num_threads_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::num_threads() const {
+inline int32_t TrainerSpec::num_threads() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.num_threads)
return _internal_num_threads();
}
-inline void TrainerSpec::_internal_set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x01000000u;
- num_threads_ = value;
+inline void TrainerSpec::_internal_set_num_threads(int32_t value) {
+ _impl_._has_bits_[0] |= 0x01000000u;
+ _impl_.num_threads_ = value;
}
-inline void TrainerSpec::set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_num_threads(int32_t value) {
_internal_set_num_threads(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.num_threads)
}
// optional int32 num_sub_iterations = 17 [default = 2];
inline bool TrainerSpec::_internal_has_num_sub_iterations() const {
- bool value = (_has_bits_[0] & 0x02000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x02000000u) != 0;
return value;
}
inline bool TrainerSpec::has_num_sub_iterations() const {
return _internal_has_num_sub_iterations();
}
inline void TrainerSpec::clear_num_sub_iterations() {
- num_sub_iterations_ = 2;
- _has_bits_[0] &= ~0x02000000u;
+ _impl_.num_sub_iterations_ = 2;
+ _impl_._has_bits_[0] &= ~0x02000000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_num_sub_iterations() const {
- return num_sub_iterations_;
+inline int32_t TrainerSpec::_internal_num_sub_iterations() const {
+ return _impl_.num_sub_iterations_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::num_sub_iterations() const {
+inline int32_t TrainerSpec::num_sub_iterations() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.num_sub_iterations)
return _internal_num_sub_iterations();
}
-inline void TrainerSpec::_internal_set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x02000000u;
- num_sub_iterations_ = value;
+inline void TrainerSpec::_internal_set_num_sub_iterations(int32_t value) {
+ _impl_._has_bits_[0] |= 0x02000000u;
+ _impl_.num_sub_iterations_ = value;
}
-inline void TrainerSpec::set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_num_sub_iterations(int32_t value) {
_internal_set_num_sub_iterations(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.num_sub_iterations)
}
// optional int32 max_sentencepiece_length = 20 [default = 16];
inline bool TrainerSpec::_internal_has_max_sentencepiece_length() const {
- bool value = (_has_bits_[0] & 0x08000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x08000000u) != 0;
return value;
}
inline bool TrainerSpec::has_max_sentencepiece_length() const {
return _internal_has_max_sentencepiece_length();
}
inline void TrainerSpec::clear_max_sentencepiece_length() {
- max_sentencepiece_length_ = 16;
- _has_bits_[0] &= ~0x08000000u;
+ _impl_.max_sentencepiece_length_ = 16;
+ _impl_._has_bits_[0] &= ~0x08000000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_max_sentencepiece_length() const {
- return max_sentencepiece_length_;
+inline int32_t TrainerSpec::_internal_max_sentencepiece_length() const {
+ return _impl_.max_sentencepiece_length_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::max_sentencepiece_length() const {
+inline int32_t TrainerSpec::max_sentencepiece_length() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.max_sentencepiece_length)
return _internal_max_sentencepiece_length();
}
-inline void TrainerSpec::_internal_set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x08000000u;
- max_sentencepiece_length_ = value;
+inline void TrainerSpec::_internal_set_max_sentencepiece_length(int32_t value) {
+ _impl_._has_bits_[0] |= 0x08000000u;
+ _impl_.max_sentencepiece_length_ = value;
}
-inline void TrainerSpec::set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_max_sentencepiece_length(int32_t value) {
_internal_set_max_sentencepiece_length(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.max_sentencepiece_length)
}
// optional bool split_by_unicode_script = 21 [default = true];
inline bool TrainerSpec::_internal_has_split_by_unicode_script() const {
- bool value = (_has_bits_[0] & 0x20000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x20000000u) != 0;
return value;
}
inline bool TrainerSpec::has_split_by_unicode_script() const {
return _internal_has_split_by_unicode_script();
}
inline void TrainerSpec::clear_split_by_unicode_script() {
- split_by_unicode_script_ = true;
- _has_bits_[0] &= ~0x20000000u;
+ _impl_.split_by_unicode_script_ = true;
+ _impl_._has_bits_[0] &= ~0x20000000u;
}
inline bool TrainerSpec::_internal_split_by_unicode_script() const {
- return split_by_unicode_script_;
+ return _impl_.split_by_unicode_script_;
}
inline bool TrainerSpec::split_by_unicode_script() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.split_by_unicode_script)
return _internal_split_by_unicode_script();
}
inline void TrainerSpec::_internal_set_split_by_unicode_script(bool value) {
- _has_bits_[0] |= 0x20000000u;
- split_by_unicode_script_ = value;
+ _impl_._has_bits_[0] |= 0x20000000u;
+ _impl_.split_by_unicode_script_ = value;
}
inline void TrainerSpec::set_split_by_unicode_script(bool value) {
_internal_set_split_by_unicode_script(value);
@@ -2690,26 +3644,26 @@ inline void TrainerSpec::set_split_by_unicode_script(bool value) {
// optional bool split_by_number = 23 [default = true];
inline bool TrainerSpec::_internal_has_split_by_number() const {
- bool value = (_has_bits_[0] & 0x40000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x40000000u) != 0;
return value;
}
inline bool TrainerSpec::has_split_by_number() const {
return _internal_has_split_by_number();
}
inline void TrainerSpec::clear_split_by_number() {
- split_by_number_ = true;
- _has_bits_[0] &= ~0x40000000u;
+ _impl_.split_by_number_ = true;
+ _impl_._has_bits_[0] &= ~0x40000000u;
}
inline bool TrainerSpec::_internal_split_by_number() const {
- return split_by_number_;
+ return _impl_.split_by_number_;
}
inline bool TrainerSpec::split_by_number() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.split_by_number)
return _internal_split_by_number();
}
inline void TrainerSpec::_internal_set_split_by_number(bool value) {
- _has_bits_[0] |= 0x40000000u;
- split_by_number_ = value;
+ _impl_._has_bits_[0] |= 0x40000000u;
+ _impl_.split_by_number_ = value;
}
inline void TrainerSpec::set_split_by_number(bool value) {
_internal_set_split_by_number(value);
@@ -2718,26 +3672,26 @@ inline void TrainerSpec::set_split_by_number(bool value) {
// optional bool split_by_whitespace = 22 [default = true];
inline bool TrainerSpec::_internal_has_split_by_whitespace() const {
- bool value = (_has_bits_[0] & 0x80000000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x80000000u) != 0;
return value;
}
inline bool TrainerSpec::has_split_by_whitespace() const {
return _internal_has_split_by_whitespace();
}
inline void TrainerSpec::clear_split_by_whitespace() {
- split_by_whitespace_ = true;
- _has_bits_[0] &= ~0x80000000u;
+ _impl_.split_by_whitespace_ = true;
+ _impl_._has_bits_[0] &= ~0x80000000u;
}
inline bool TrainerSpec::_internal_split_by_whitespace() const {
- return split_by_whitespace_;
+ return _impl_.split_by_whitespace_;
}
inline bool TrainerSpec::split_by_whitespace() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.split_by_whitespace)
return _internal_split_by_whitespace();
}
inline void TrainerSpec::_internal_set_split_by_whitespace(bool value) {
- _has_bits_[0] |= 0x80000000u;
- split_by_whitespace_ = value;
+ _impl_._has_bits_[0] |= 0x80000000u;
+ _impl_.split_by_whitespace_ = value;
}
inline void TrainerSpec::set_split_by_whitespace(bool value) {
_internal_set_split_by_whitespace(value);
@@ -2746,26 +3700,26 @@ inline void TrainerSpec::set_split_by_whitespace(bool value) {
// optional bool treat_whitespace_as_suffix = 24 [default = false];
inline bool TrainerSpec::_internal_has_treat_whitespace_as_suffix() const {
- bool value = (_has_bits_[0] & 0x00001000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00001000u) != 0;
return value;
}
inline bool TrainerSpec::has_treat_whitespace_as_suffix() const {
return _internal_has_treat_whitespace_as_suffix();
}
inline void TrainerSpec::clear_treat_whitespace_as_suffix() {
- treat_whitespace_as_suffix_ = false;
- _has_bits_[0] &= ~0x00001000u;
+ _impl_.treat_whitespace_as_suffix_ = false;
+ _impl_._has_bits_[0] &= ~0x00001000u;
}
inline bool TrainerSpec::_internal_treat_whitespace_as_suffix() const {
- return treat_whitespace_as_suffix_;
+ return _impl_.treat_whitespace_as_suffix_;
}
inline bool TrainerSpec::treat_whitespace_as_suffix() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.treat_whitespace_as_suffix)
return _internal_treat_whitespace_as_suffix();
}
inline void TrainerSpec::_internal_set_treat_whitespace_as_suffix(bool value) {
- _has_bits_[0] |= 0x00001000u;
- treat_whitespace_as_suffix_ = value;
+ _impl_._has_bits_[0] |= 0x00001000u;
+ _impl_.treat_whitespace_as_suffix_ = value;
}
inline void TrainerSpec::set_treat_whitespace_as_suffix(bool value) {
_internal_set_treat_whitespace_as_suffix(value);
@@ -2774,26 +3728,26 @@ inline void TrainerSpec::set_treat_whitespace_as_suffix(bool value) {
// optional bool allow_whitespace_only_pieces = 26 [default = false];
inline bool TrainerSpec::_internal_has_allow_whitespace_only_pieces() const {
- bool value = (_has_bits_[0] & 0x00002000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00002000u) != 0;
return value;
}
inline bool TrainerSpec::has_allow_whitespace_only_pieces() const {
return _internal_has_allow_whitespace_only_pieces();
}
inline void TrainerSpec::clear_allow_whitespace_only_pieces() {
- allow_whitespace_only_pieces_ = false;
- _has_bits_[0] &= ~0x00002000u;
+ _impl_.allow_whitespace_only_pieces_ = false;
+ _impl_._has_bits_[0] &= ~0x00002000u;
}
inline bool TrainerSpec::_internal_allow_whitespace_only_pieces() const {
- return allow_whitespace_only_pieces_;
+ return _impl_.allow_whitespace_only_pieces_;
}
inline bool TrainerSpec::allow_whitespace_only_pieces() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.allow_whitespace_only_pieces)
return _internal_allow_whitespace_only_pieces();
}
inline void TrainerSpec::_internal_set_allow_whitespace_only_pieces(bool value) {
- _has_bits_[0] |= 0x00002000u;
- allow_whitespace_only_pieces_ = value;
+ _impl_._has_bits_[0] |= 0x00002000u;
+ _impl_.allow_whitespace_only_pieces_ = value;
}
inline void TrainerSpec::set_allow_whitespace_only_pieces(bool value) {
_internal_set_allow_whitespace_only_pieces(value);
@@ -2802,26 +3756,26 @@ inline void TrainerSpec::set_allow_whitespace_only_pieces(bool value) {
// optional bool split_digits = 25 [default = false];
inline bool TrainerSpec::_internal_has_split_digits() const {
- bool value = (_has_bits_[0] & 0x00004000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00004000u) != 0;
return value;
}
inline bool TrainerSpec::has_split_digits() const {
return _internal_has_split_digits();
}
inline void TrainerSpec::clear_split_digits() {
- split_digits_ = false;
- _has_bits_[0] &= ~0x00004000u;
+ _impl_.split_digits_ = false;
+ _impl_._has_bits_[0] &= ~0x00004000u;
}
inline bool TrainerSpec::_internal_split_digits() const {
- return split_digits_;
+ return _impl_.split_digits_;
}
inline bool TrainerSpec::split_digits() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.split_digits)
return _internal_split_digits();
}
inline void TrainerSpec::_internal_set_split_digits(bool value) {
- _has_bits_[0] |= 0x00004000u;
- split_digits_ = value;
+ _impl_._has_bits_[0] |= 0x00004000u;
+ _impl_.split_digits_ = value;
}
inline void TrainerSpec::set_split_digits(bool value) {
_internal_set_split_digits(value);
@@ -2830,20 +3784,21 @@ inline void TrainerSpec::set_split_digits(bool value) {
// repeated string control_symbols = 30;
inline int TrainerSpec::_internal_control_symbols_size() const {
- return control_symbols_.size();
+ return _impl_.control_symbols_.size();
}
inline int TrainerSpec::control_symbols_size() const {
return _internal_control_symbols_size();
}
inline void TrainerSpec::clear_control_symbols() {
- control_symbols_.Clear();
+ _impl_.control_symbols_.Clear();
}
inline std::string* TrainerSpec::add_control_symbols() {
+ std::string* _s = _internal_add_control_symbols();
// @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.control_symbols)
- return _internal_add_control_symbols();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_control_symbols(int index) const {
- return control_symbols_.Get(index);
+ return _impl_.control_symbols_.Get(index);
}
inline const std::string& TrainerSpec::control_symbols(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.control_symbols)
@@ -2851,73 +3806,74 @@ inline const std::string& TrainerSpec::control_symbols(int index) const {
}
inline std::string* TrainerSpec::mutable_control_symbols(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.control_symbols)
- return control_symbols_.Mutable(index);
+ return _impl_.control_symbols_.Mutable(index);
}
inline void TrainerSpec::set_control_symbols(int index, const std::string& value) {
+ _impl_.control_symbols_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
- control_symbols_.Mutable(index)->assign(value);
}
inline void TrainerSpec::set_control_symbols(int index, std::string&& value) {
+ _impl_.control_symbols_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
- control_symbols_.Mutable(index)->assign(std::move(value));
}
inline void TrainerSpec::set_control_symbols(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
- control_symbols_.Mutable(index)->assign(value);
+ _impl_.control_symbols_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.control_symbols)
}
inline void TrainerSpec::set_control_symbols(int index, const char* value, size_t size) {
- control_symbols_.Mutable(index)->assign(
+ _impl_.control_symbols_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.control_symbols)
}
inline std::string* TrainerSpec::_internal_add_control_symbols() {
- return control_symbols_.Add();
+ return _impl_.control_symbols_.Add();
}
inline void TrainerSpec::add_control_symbols(const std::string& value) {
- control_symbols_.Add()->assign(value);
+ _impl_.control_symbols_.Add()->assign(value);
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.control_symbols)
}
inline void TrainerSpec::add_control_symbols(std::string&& value) {
- control_symbols_.Add(std::move(value));
+ _impl_.control_symbols_.Add(std::move(value));
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.control_symbols)
}
inline void TrainerSpec::add_control_symbols(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- control_symbols_.Add()->assign(value);
+ _impl_.control_symbols_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:sentencepiece.TrainerSpec.control_symbols)
}
inline void TrainerSpec::add_control_symbols(const char* value, size_t size) {
- control_symbols_.Add()->assign(reinterpret_cast<const char*>(value), size);
+ _impl_.control_symbols_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:sentencepiece.TrainerSpec.control_symbols)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
TrainerSpec::control_symbols() const {
// @@protoc_insertion_point(field_list:sentencepiece.TrainerSpec.control_symbols)
- return control_symbols_;
+ return _impl_.control_symbols_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
TrainerSpec::mutable_control_symbols() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.TrainerSpec.control_symbols)
- return &control_symbols_;
+ return &_impl_.control_symbols_;
}
// repeated string user_defined_symbols = 31;
inline int TrainerSpec::_internal_user_defined_symbols_size() const {
- return user_defined_symbols_.size();
+ return _impl_.user_defined_symbols_.size();
}
inline int TrainerSpec::user_defined_symbols_size() const {
return _internal_user_defined_symbols_size();
}
inline void TrainerSpec::clear_user_defined_symbols() {
- user_defined_symbols_.Clear();
+ _impl_.user_defined_symbols_.Clear();
}
inline std::string* TrainerSpec::add_user_defined_symbols() {
+ std::string* _s = _internal_add_user_defined_symbols();
// @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.user_defined_symbols)
- return _internal_add_user_defined_symbols();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_user_defined_symbols(int index) const {
- return user_defined_symbols_.Get(index);
+ return _impl_.user_defined_symbols_.Get(index);
}
inline const std::string& TrainerSpec::user_defined_symbols(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.user_defined_symbols)
@@ -2925,152 +3881,147 @@ inline const std::string& TrainerSpec::user_defined_symbols(int index) const {
}
inline std::string* TrainerSpec::mutable_user_defined_symbols(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.user_defined_symbols)
- return user_defined_symbols_.Mutable(index);
+ return _impl_.user_defined_symbols_.Mutable(index);
}
inline void TrainerSpec::set_user_defined_symbols(int index, const std::string& value) {
+ _impl_.user_defined_symbols_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
- user_defined_symbols_.Mutable(index)->assign(value);
}
inline void TrainerSpec::set_user_defined_symbols(int index, std::string&& value) {
+ _impl_.user_defined_symbols_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
- user_defined_symbols_.Mutable(index)->assign(std::move(value));
}
inline void TrainerSpec::set_user_defined_symbols(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
- user_defined_symbols_.Mutable(index)->assign(value);
+ _impl_.user_defined_symbols_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline void TrainerSpec::set_user_defined_symbols(int index, const char* value, size_t size) {
- user_defined_symbols_.Mutable(index)->assign(
+ _impl_.user_defined_symbols_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline std::string* TrainerSpec::_internal_add_user_defined_symbols() {
- return user_defined_symbols_.Add();
+ return _impl_.user_defined_symbols_.Add();
}
inline void TrainerSpec::add_user_defined_symbols(const std::string& value) {
- user_defined_symbols_.Add()->assign(value);
+ _impl_.user_defined_symbols_.Add()->assign(value);
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline void TrainerSpec::add_user_defined_symbols(std::string&& value) {
- user_defined_symbols_.Add(std::move(value));
+ _impl_.user_defined_symbols_.Add(std::move(value));
// @@protoc_insertion_point(field_add:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline void TrainerSpec::add_user_defined_symbols(const char* value) {
GOOGLE_DCHECK(value != nullptr);
- user_defined_symbols_.Add()->assign(value);
+ _impl_.user_defined_symbols_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline void TrainerSpec::add_user_defined_symbols(const char* value, size_t size) {
- user_defined_symbols_.Add()->assign(reinterpret_cast<const char*>(value), size);
+ _impl_.user_defined_symbols_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:sentencepiece.TrainerSpec.user_defined_symbols)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
TrainerSpec::user_defined_symbols() const {
// @@protoc_insertion_point(field_list:sentencepiece.TrainerSpec.user_defined_symbols)
- return user_defined_symbols_;
+ return _impl_.user_defined_symbols_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
TrainerSpec::mutable_user_defined_symbols() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.TrainerSpec.user_defined_symbols)
- return &user_defined_symbols_;
+ return &_impl_.user_defined_symbols_;
}
// optional string required_chars = 36;
inline bool TrainerSpec::_internal_has_required_chars() const {
- bool value = (_has_bits_[0] & 0x00000004u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool TrainerSpec::has_required_chars() const {
return _internal_has_required_chars();
}
inline void TrainerSpec::clear_required_chars() {
- required_chars_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000004u;
+ _impl_.required_chars_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
inline const std::string& TrainerSpec::required_chars() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.required_chars)
return _internal_required_chars();
}
-inline void TrainerSpec::set_required_chars(const std::string& value) {
- _internal_set_required_chars(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_required_chars(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.required_chars_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.required_chars)
}
inline std::string* TrainerSpec::mutable_required_chars() {
+ std::string* _s = _internal_mutable_required_chars();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.required_chars)
- return _internal_mutable_required_chars();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_required_chars() const {
- return required_chars_.Get();
+ return _impl_.required_chars_.Get();
}
inline void TrainerSpec::_internal_set_required_chars(const std::string& value) {
- _has_bits_[0] |= 0x00000004u;
- required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_required_chars(std::string&& value) {
- _has_bits_[0] |= 0x00000004u;
- required_chars_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.required_chars)
-}
-inline void TrainerSpec::set_required_chars(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000004u;
- required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.required_chars)
-}
-inline void TrainerSpec::set_required_chars(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000004u;
- required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.required_chars)
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.required_chars_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_required_chars() {
- _has_bits_[0] |= 0x00000004u;
- return required_chars_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000004u;
+ return _impl_.required_chars_.Mutable(GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_required_chars() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.required_chars)
if (!_internal_has_required_chars()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000004u;
- return required_chars_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000004u;
+ auto* p = _impl_.required_chars_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.required_chars_.IsDefault()) {
+ _impl_.required_chars_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void TrainerSpec::set_allocated_required_chars(std::string* required_chars) {
if (required_chars != nullptr) {
- _has_bits_[0] |= 0x00000004u;
+ _impl_._has_bits_[0] |= 0x00000004u;
} else {
- _has_bits_[0] &= ~0x00000004u;
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
- required_chars_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), required_chars,
- GetArena());
+ _impl_.required_chars_.SetAllocated(required_chars, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.required_chars_.IsDefault()) {
+ _impl_.required_chars_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.required_chars)
}
// optional bool byte_fallback = 35 [default = false];
inline bool TrainerSpec::_internal_has_byte_fallback() const {
- bool value = (_has_bits_[0] & 0x00008000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00008000u) != 0;
return value;
}
inline bool TrainerSpec::has_byte_fallback() const {
return _internal_has_byte_fallback();
}
inline void TrainerSpec::clear_byte_fallback() {
- byte_fallback_ = false;
- _has_bits_[0] &= ~0x00008000u;
+ _impl_.byte_fallback_ = false;
+ _impl_._has_bits_[0] &= ~0x00008000u;
}
inline bool TrainerSpec::_internal_byte_fallback() const {
- return byte_fallback_;
+ return _impl_.byte_fallback_;
}
inline bool TrainerSpec::byte_fallback() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.byte_fallback)
return _internal_byte_fallback();
}
inline void TrainerSpec::_internal_set_byte_fallback(bool value) {
- _has_bits_[0] |= 0x00008000u;
- byte_fallback_ = value;
+ _impl_._has_bits_[0] |= 0x00008000u;
+ _impl_.byte_fallback_ = value;
}
inline void TrainerSpec::set_byte_fallback(bool value) {
_internal_set_byte_fallback(value);
@@ -3079,26 +4030,26 @@ inline void TrainerSpec::set_byte_fallback(bool value) {
// optional bool vocabulary_output_piece_score = 32 [default = true];
inline bool TrainerSpec::_internal_has_vocabulary_output_piece_score() const {
- bool value = (_has_bits_[1] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[1] & 0x00000001u) != 0;
return value;
}
inline bool TrainerSpec::has_vocabulary_output_piece_score() const {
return _internal_has_vocabulary_output_piece_score();
}
inline void TrainerSpec::clear_vocabulary_output_piece_score() {
- vocabulary_output_piece_score_ = true;
- _has_bits_[1] &= ~0x00000001u;
+ _impl_.vocabulary_output_piece_score_ = true;
+ _impl_._has_bits_[1] &= ~0x00000001u;
}
inline bool TrainerSpec::_internal_vocabulary_output_piece_score() const {
- return vocabulary_output_piece_score_;
+ return _impl_.vocabulary_output_piece_score_;
}
inline bool TrainerSpec::vocabulary_output_piece_score() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.vocabulary_output_piece_score)
return _internal_vocabulary_output_piece_score();
}
inline void TrainerSpec::_internal_set_vocabulary_output_piece_score(bool value) {
- _has_bits_[1] |= 0x00000001u;
- vocabulary_output_piece_score_ = value;
+ _impl_._has_bits_[1] |= 0x00000001u;
+ _impl_.vocabulary_output_piece_score_ = value;
}
inline void TrainerSpec::set_vocabulary_output_piece_score(bool value) {
_internal_set_vocabulary_output_piece_score(value);
@@ -3107,26 +4058,26 @@ inline void TrainerSpec::set_vocabulary_output_piece_score(bool value) {
// optional bool hard_vocab_limit = 33 [default = true];
inline bool TrainerSpec::_internal_has_hard_vocab_limit() const {
- bool value = (_has_bits_[1] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[1] & 0x00000002u) != 0;
return value;
}
inline bool TrainerSpec::has_hard_vocab_limit() const {
return _internal_has_hard_vocab_limit();
}
inline void TrainerSpec::clear_hard_vocab_limit() {
- hard_vocab_limit_ = true;
- _has_bits_[1] &= ~0x00000002u;
+ _impl_.hard_vocab_limit_ = true;
+ _impl_._has_bits_[1] &= ~0x00000002u;
}
inline bool TrainerSpec::_internal_hard_vocab_limit() const {
- return hard_vocab_limit_;
+ return _impl_.hard_vocab_limit_;
}
inline bool TrainerSpec::hard_vocab_limit() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.hard_vocab_limit)
return _internal_hard_vocab_limit();
}
inline void TrainerSpec::_internal_set_hard_vocab_limit(bool value) {
- _has_bits_[1] |= 0x00000002u;
- hard_vocab_limit_ = value;
+ _impl_._has_bits_[1] |= 0x00000002u;
+ _impl_.hard_vocab_limit_ = value;
}
inline void TrainerSpec::set_hard_vocab_limit(bool value) {
_internal_set_hard_vocab_limit(value);
@@ -3135,26 +4086,26 @@ inline void TrainerSpec::set_hard_vocab_limit(bool value) {
// optional bool use_all_vocab = 34 [default = false];
inline bool TrainerSpec::_internal_has_use_all_vocab() const {
- bool value = (_has_bits_[0] & 0x00020000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00020000u) != 0;
return value;
}
inline bool TrainerSpec::has_use_all_vocab() const {
return _internal_has_use_all_vocab();
}
inline void TrainerSpec::clear_use_all_vocab() {
- use_all_vocab_ = false;
- _has_bits_[0] &= ~0x00020000u;
+ _impl_.use_all_vocab_ = false;
+ _impl_._has_bits_[0] &= ~0x00020000u;
}
inline bool TrainerSpec::_internal_use_all_vocab() const {
- return use_all_vocab_;
+ return _impl_.use_all_vocab_;
}
inline bool TrainerSpec::use_all_vocab() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.use_all_vocab)
return _internal_use_all_vocab();
}
inline void TrainerSpec::_internal_set_use_all_vocab(bool value) {
- _has_bits_[0] |= 0x00020000u;
- use_all_vocab_ = value;
+ _impl_._has_bits_[0] |= 0x00020000u;
+ _impl_.use_all_vocab_ = value;
}
inline void TrainerSpec::set_use_all_vocab(bool value) {
_internal_set_use_all_vocab(value);
@@ -3163,508 +4114,433 @@ inline void TrainerSpec::set_use_all_vocab(bool value) {
// optional int32 unk_id = 40 [default = 0];
inline bool TrainerSpec::_internal_has_unk_id() const {
- bool value = (_has_bits_[0] & 0x00010000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00010000u) != 0;
return value;
}
inline bool TrainerSpec::has_unk_id() const {
return _internal_has_unk_id();
}
inline void TrainerSpec::clear_unk_id() {
- unk_id_ = 0;
- _has_bits_[0] &= ~0x00010000u;
+ _impl_.unk_id_ = 0;
+ _impl_._has_bits_[0] &= ~0x00010000u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_unk_id() const {
- return unk_id_;
+inline int32_t TrainerSpec::_internal_unk_id() const {
+ return _impl_.unk_id_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::unk_id() const {
+inline int32_t TrainerSpec::unk_id() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_id)
return _internal_unk_id();
}
-inline void TrainerSpec::_internal_set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[0] |= 0x00010000u;
- unk_id_ = value;
+inline void TrainerSpec::_internal_set_unk_id(int32_t value) {
+ _impl_._has_bits_[0] |= 0x00010000u;
+ _impl_.unk_id_ = value;
}
-inline void TrainerSpec::set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_unk_id(int32_t value) {
_internal_set_unk_id(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_id)
}
// optional int32 bos_id = 41 [default = 1];
inline bool TrainerSpec::_internal_has_bos_id() const {
- bool value = (_has_bits_[1] & 0x00000004u) != 0;
+ bool value = (_impl_._has_bits_[1] & 0x00000004u) != 0;
return value;
}
inline bool TrainerSpec::has_bos_id() const {
return _internal_has_bos_id();
}
inline void TrainerSpec::clear_bos_id() {
- bos_id_ = 1;
- _has_bits_[1] &= ~0x00000004u;
+ _impl_.bos_id_ = 1;
+ _impl_._has_bits_[1] &= ~0x00000004u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_bos_id() const {
- return bos_id_;
+inline int32_t TrainerSpec::_internal_bos_id() const {
+ return _impl_.bos_id_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::bos_id() const {
+inline int32_t TrainerSpec::bos_id() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.bos_id)
return _internal_bos_id();
}
-inline void TrainerSpec::_internal_set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[1] |= 0x00000004u;
- bos_id_ = value;
+inline void TrainerSpec::_internal_set_bos_id(int32_t value) {
+ _impl_._has_bits_[1] |= 0x00000004u;
+ _impl_.bos_id_ = value;
}
-inline void TrainerSpec::set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_bos_id(int32_t value) {
_internal_set_bos_id(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.bos_id)
}
// optional int32 eos_id = 42 [default = 2];
inline bool TrainerSpec::_internal_has_eos_id() const {
- bool value = (_has_bits_[1] & 0x00000008u) != 0;
+ bool value = (_impl_._has_bits_[1] & 0x00000008u) != 0;
return value;
}
inline bool TrainerSpec::has_eos_id() const {
return _internal_has_eos_id();
}
inline void TrainerSpec::clear_eos_id() {
- eos_id_ = 2;
- _has_bits_[1] &= ~0x00000008u;
+ _impl_.eos_id_ = 2;
+ _impl_._has_bits_[1] &= ~0x00000008u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_eos_id() const {
- return eos_id_;
+inline int32_t TrainerSpec::_internal_eos_id() const {
+ return _impl_.eos_id_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::eos_id() const {
+inline int32_t TrainerSpec::eos_id() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.eos_id)
return _internal_eos_id();
}
-inline void TrainerSpec::_internal_set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[1] |= 0x00000008u;
- eos_id_ = value;
+inline void TrainerSpec::_internal_set_eos_id(int32_t value) {
+ _impl_._has_bits_[1] |= 0x00000008u;
+ _impl_.eos_id_ = value;
}
-inline void TrainerSpec::set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_eos_id(int32_t value) {
_internal_set_eos_id(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.eos_id)
}
// optional int32 pad_id = 43 [default = -1];
inline bool TrainerSpec::_internal_has_pad_id() const {
- bool value = (_has_bits_[1] & 0x00000010u) != 0;
+ bool value = (_impl_._has_bits_[1] & 0x00000010u) != 0;
return value;
}
inline bool TrainerSpec::has_pad_id() const {
return _internal_has_pad_id();
}
inline void TrainerSpec::clear_pad_id() {
- pad_id_ = -1;
- _has_bits_[1] &= ~0x00000010u;
+ _impl_.pad_id_ = -1;
+ _impl_._has_bits_[1] &= ~0x00000010u;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_pad_id() const {
- return pad_id_;
+inline int32_t TrainerSpec::_internal_pad_id() const {
+ return _impl_.pad_id_;
}
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::pad_id() const {
+inline int32_t TrainerSpec::pad_id() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.pad_id)
return _internal_pad_id();
}
-inline void TrainerSpec::_internal_set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
- _has_bits_[1] |= 0x00000010u;
- pad_id_ = value;
+inline void TrainerSpec::_internal_set_pad_id(int32_t value) {
+ _impl_._has_bits_[1] |= 0x00000010u;
+ _impl_.pad_id_ = value;
}
-inline void TrainerSpec::set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_pad_id(int32_t value) {
_internal_set_pad_id(value);
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.pad_id)
}
// optional string unk_piece = 45 [default = "<unk>"];
inline bool TrainerSpec::_internal_has_unk_piece() const {
- bool value = (_has_bits_[0] & 0x00000010u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0;
return value;
}
inline bool TrainerSpec::has_unk_piece() const {
return _internal_has_unk_piece();
}
inline void TrainerSpec::clear_unk_piece() {
- unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
- _has_bits_[0] &= ~0x00000010u;
+ _impl_.unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
+ _impl_._has_bits_[0] &= ~0x00000010u;
}
inline const std::string& TrainerSpec::unk_piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_piece)
- if (unk_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_unk_piece_.get();
+ if (_impl_.unk_piece_.IsDefault()) return Impl_::_i_give_permission_to_break_this_code_default_unk_piece_.get();
return _internal_unk_piece();
}
-inline void TrainerSpec::set_unk_piece(const std::string& value) {
- _internal_set_unk_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_unk_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000010u;
+ _impl_.unk_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_piece)
}
inline std::string* TrainerSpec::mutable_unk_piece() {
+ std::string* _s = _internal_mutable_unk_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.unk_piece)
- return _internal_mutable_unk_piece();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_unk_piece() const {
- return unk_piece_.Get();
+ return _impl_.unk_piece_.Get();
}
inline void TrainerSpec::_internal_set_unk_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000010u;
- unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_unk_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000010u;
- unk_piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.unk_piece)
-}
-inline void TrainerSpec::set_unk_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000010u;
- unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.unk_piece)
-}
-inline void TrainerSpec::set_unk_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000010u;
- unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.unk_piece)
+ _impl_._has_bits_[0] |= 0x00000010u;
+ _impl_.unk_piece_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_unk_piece() {
- _has_bits_[0] |= 0x00000010u;
- return unk_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
+ _impl_._has_bits_[0] |= 0x00000010u;
+ return _impl_.unk_piece_.Mutable(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_unk_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.unk_piece)
if (!_internal_has_unk_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000010u;
- return unk_piece_.ReleaseNonDefault(nullptr, GetArena());
+ _impl_._has_bits_[0] &= ~0x00000010u;
+ auto* p = _impl_.unk_piece_.Release();
+ return p;
}
inline void TrainerSpec::set_allocated_unk_piece(std::string* unk_piece) {
if (unk_piece != nullptr) {
- _has_bits_[0] |= 0x00000010u;
+ _impl_._has_bits_[0] |= 0x00000010u;
} else {
- _has_bits_[0] &= ~0x00000010u;
+ _impl_._has_bits_[0] &= ~0x00000010u;
}
- unk_piece_.SetAllocated(nullptr, unk_piece,
- GetArena());
+ _impl_.unk_piece_.SetAllocated(unk_piece, GetArenaForAllocation());
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.unk_piece)
}
// optional string bos_piece = 46 [default = "<s>"];
inline bool TrainerSpec::_internal_has_bos_piece() const {
- bool value = (_has_bits_[0] & 0x00000020u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0;
return value;
}
inline bool TrainerSpec::has_bos_piece() const {
return _internal_has_bos_piece();
}
inline void TrainerSpec::clear_bos_piece() {
- bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
- _has_bits_[0] &= ~0x00000020u;
+ _impl_.bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
+ _impl_._has_bits_[0] &= ~0x00000020u;
}
inline const std::string& TrainerSpec::bos_piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.bos_piece)
- if (bos_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_bos_piece_.get();
+ if (_impl_.bos_piece_.IsDefault()) return Impl_::_i_give_permission_to_break_this_code_default_bos_piece_.get();
return _internal_bos_piece();
}
-inline void TrainerSpec::set_bos_piece(const std::string& value) {
- _internal_set_bos_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_bos_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000020u;
+ _impl_.bos_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.bos_piece)
}
inline std::string* TrainerSpec::mutable_bos_piece() {
+ std::string* _s = _internal_mutable_bos_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.bos_piece)
- return _internal_mutable_bos_piece();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_bos_piece() const {
- return bos_piece_.Get();
+ return _impl_.bos_piece_.Get();
}
inline void TrainerSpec::_internal_set_bos_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000020u;
- bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_bos_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000020u;
- bos_piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.bos_piece)
-}
-inline void TrainerSpec::set_bos_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000020u;
- bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.bos_piece)
-}
-inline void TrainerSpec::set_bos_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000020u;
- bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.bos_piece)
+ _impl_._has_bits_[0] |= 0x00000020u;
+ _impl_.bos_piece_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_bos_piece() {
- _has_bits_[0] |= 0x00000020u;
- return bos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
+ _impl_._has_bits_[0] |= 0x00000020u;
+ return _impl_.bos_piece_.Mutable(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_bos_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.bos_piece)
if (!_internal_has_bos_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000020u;
- return bos_piece_.ReleaseNonDefault(nullptr, GetArena());
+ _impl_._has_bits_[0] &= ~0x00000020u;
+ auto* p = _impl_.bos_piece_.Release();
+ return p;
}
inline void TrainerSpec::set_allocated_bos_piece(std::string* bos_piece) {
if (bos_piece != nullptr) {
- _has_bits_[0] |= 0x00000020u;
+ _impl_._has_bits_[0] |= 0x00000020u;
} else {
- _has_bits_[0] &= ~0x00000020u;
+ _impl_._has_bits_[0] &= ~0x00000020u;
}
- bos_piece_.SetAllocated(nullptr, bos_piece,
- GetArena());
+ _impl_.bos_piece_.SetAllocated(bos_piece, GetArenaForAllocation());
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.bos_piece)
}
// optional string eos_piece = 47 [default = "</s>"];
inline bool TrainerSpec::_internal_has_eos_piece() const {
- bool value = (_has_bits_[0] & 0x00000040u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0;
return value;
}
inline bool TrainerSpec::has_eos_piece() const {
return _internal_has_eos_piece();
}
inline void TrainerSpec::clear_eos_piece() {
- eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
- _has_bits_[0] &= ~0x00000040u;
+ _impl_.eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
+ _impl_._has_bits_[0] &= ~0x00000040u;
}
inline const std::string& TrainerSpec::eos_piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.eos_piece)
- if (eos_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_eos_piece_.get();
+ if (_impl_.eos_piece_.IsDefault()) return Impl_::_i_give_permission_to_break_this_code_default_eos_piece_.get();
return _internal_eos_piece();
}
-inline void TrainerSpec::set_eos_piece(const std::string& value) {
- _internal_set_eos_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_eos_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000040u;
+ _impl_.eos_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.eos_piece)
}
inline std::string* TrainerSpec::mutable_eos_piece() {
+ std::string* _s = _internal_mutable_eos_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.eos_piece)
- return _internal_mutable_eos_piece();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_eos_piece() const {
- return eos_piece_.Get();
+ return _impl_.eos_piece_.Get();
}
inline void TrainerSpec::_internal_set_eos_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000040u;
- eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_eos_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000040u;
- eos_piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.eos_piece)
-}
-inline void TrainerSpec::set_eos_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000040u;
- eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.eos_piece)
-}
-inline void TrainerSpec::set_eos_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000040u;
- eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.eos_piece)
+ _impl_._has_bits_[0] |= 0x00000040u;
+ _impl_.eos_piece_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_eos_piece() {
- _has_bits_[0] |= 0x00000040u;
- return eos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
+ _impl_._has_bits_[0] |= 0x00000040u;
+ return _impl_.eos_piece_.Mutable(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_eos_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.eos_piece)
if (!_internal_has_eos_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000040u;
- return eos_piece_.ReleaseNonDefault(nullptr, GetArena());
+ _impl_._has_bits_[0] &= ~0x00000040u;
+ auto* p = _impl_.eos_piece_.Release();
+ return p;
}
inline void TrainerSpec::set_allocated_eos_piece(std::string* eos_piece) {
if (eos_piece != nullptr) {
- _has_bits_[0] |= 0x00000040u;
+ _impl_._has_bits_[0] |= 0x00000040u;
} else {
- _has_bits_[0] &= ~0x00000040u;
+ _impl_._has_bits_[0] &= ~0x00000040u;
}
- eos_piece_.SetAllocated(nullptr, eos_piece,
- GetArena());
+ _impl_.eos_piece_.SetAllocated(eos_piece, GetArenaForAllocation());
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.eos_piece)
}
// optional string pad_piece = 48 [default = "<pad>"];
inline bool TrainerSpec::_internal_has_pad_piece() const {
- bool value = (_has_bits_[0] & 0x00000080u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0;
return value;
}
inline bool TrainerSpec::has_pad_piece() const {
return _internal_has_pad_piece();
}
inline void TrainerSpec::clear_pad_piece() {
- pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
- _has_bits_[0] &= ~0x00000080u;
+ _impl_.pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
+ _impl_._has_bits_[0] &= ~0x00000080u;
}
inline const std::string& TrainerSpec::pad_piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.pad_piece)
- if (pad_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_pad_piece_.get();
+ if (_impl_.pad_piece_.IsDefault()) return Impl_::_i_give_permission_to_break_this_code_default_pad_piece_.get();
return _internal_pad_piece();
}
-inline void TrainerSpec::set_pad_piece(const std::string& value) {
- _internal_set_pad_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_pad_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000080u;
+ _impl_.pad_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.pad_piece)
}
inline std::string* TrainerSpec::mutable_pad_piece() {
+ std::string* _s = _internal_mutable_pad_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.pad_piece)
- return _internal_mutable_pad_piece();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_pad_piece() const {
- return pad_piece_.Get();
+ return _impl_.pad_piece_.Get();
}
inline void TrainerSpec::_internal_set_pad_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000080u;
- pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_pad_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000080u;
- pad_piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.pad_piece)
-}
-inline void TrainerSpec::set_pad_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000080u;
- pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.pad_piece)
-}
-inline void TrainerSpec::set_pad_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000080u;
- pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.pad_piece)
+ _impl_._has_bits_[0] |= 0x00000080u;
+ _impl_.pad_piece_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_pad_piece() {
- _has_bits_[0] |= 0x00000080u;
- return pad_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
+ _impl_._has_bits_[0] |= 0x00000080u;
+ return _impl_.pad_piece_.Mutable(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_pad_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.pad_piece)
if (!_internal_has_pad_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000080u;
- return pad_piece_.ReleaseNonDefault(nullptr, GetArena());
+ _impl_._has_bits_[0] &= ~0x00000080u;
+ auto* p = _impl_.pad_piece_.Release();
+ return p;
}
inline void TrainerSpec::set_allocated_pad_piece(std::string* pad_piece) {
if (pad_piece != nullptr) {
- _has_bits_[0] |= 0x00000080u;
+ _impl_._has_bits_[0] |= 0x00000080u;
} else {
- _has_bits_[0] &= ~0x00000080u;
+ _impl_._has_bits_[0] &= ~0x00000080u;
}
- pad_piece_.SetAllocated(nullptr, pad_piece,
- GetArena());
+ _impl_.pad_piece_.SetAllocated(pad_piece, GetArenaForAllocation());
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.pad_piece)
}
// optional string unk_surface = 44 [default = " \342\201\207 "];
inline bool TrainerSpec::_internal_has_unk_surface() const {
- bool value = (_has_bits_[0] & 0x00000008u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value;
}
inline bool TrainerSpec::has_unk_surface() const {
return _internal_has_unk_surface();
}
inline void TrainerSpec::clear_unk_surface() {
- unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
- _has_bits_[0] &= ~0x00000008u;
+ _impl_.unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
inline const std::string& TrainerSpec::unk_surface() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_surface)
- if (unk_surface_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_unk_surface_.get();
+ if (_impl_.unk_surface_.IsDefault()) return Impl_::_i_give_permission_to_break_this_code_default_unk_surface_.get();
return _internal_unk_surface();
}
-inline void TrainerSpec::set_unk_surface(const std::string& value) {
- _internal_set_unk_surface(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_unk_surface(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000008u;
+ _impl_.unk_surface_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_surface)
}
inline std::string* TrainerSpec::mutable_unk_surface() {
+ std::string* _s = _internal_mutable_unk_surface();
// @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.unk_surface)
- return _internal_mutable_unk_surface();
+ return _s;
}
inline const std::string& TrainerSpec::_internal_unk_surface() const {
- return unk_surface_.Get();
+ return _impl_.unk_surface_.Get();
}
inline void TrainerSpec::_internal_set_unk_surface(const std::string& value) {
- _has_bits_[0] |= 0x00000008u;
- unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_unk_surface(std::string&& value) {
- _has_bits_[0] |= 0x00000008u;
- unk_surface_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.unk_surface)
-}
-inline void TrainerSpec::set_unk_surface(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000008u;
- unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.unk_surface)
-}
-inline void TrainerSpec::set_unk_surface(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000008u;
- unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.unk_surface)
+ _impl_._has_bits_[0] |= 0x00000008u;
+ _impl_.unk_surface_.Set(value, GetArenaForAllocation());
}
inline std::string* TrainerSpec::_internal_mutable_unk_surface() {
- _has_bits_[0] |= 0x00000008u;
- return unk_surface_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
+ _impl_._has_bits_[0] |= 0x00000008u;
+ return _impl_.unk_surface_.Mutable(::sentencepiece::TrainerSpec::Impl_::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
}
inline std::string* TrainerSpec::release_unk_surface() {
// @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.unk_surface)
if (!_internal_has_unk_surface()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000008u;
- return unk_surface_.ReleaseNonDefault(nullptr, GetArena());
+ _impl_._has_bits_[0] &= ~0x00000008u;
+ auto* p = _impl_.unk_surface_.Release();
+ return p;
}
inline void TrainerSpec::set_allocated_unk_surface(std::string* unk_surface) {
if (unk_surface != nullptr) {
- _has_bits_[0] |= 0x00000008u;
+ _impl_._has_bits_[0] |= 0x00000008u;
} else {
- _has_bits_[0] &= ~0x00000008u;
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
- unk_surface_.SetAllocated(nullptr, unk_surface,
- GetArena());
+ _impl_.unk_surface_.SetAllocated(unk_surface, GetArenaForAllocation());
// @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.unk_surface)
}
// optional bool train_extremely_large_corpus = 49 [default = false];
inline bool TrainerSpec::_internal_has_train_extremely_large_corpus() const {
- bool value = (_has_bits_[0] & 0x00040000u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00040000u) != 0;
return value;
}
inline bool TrainerSpec::has_train_extremely_large_corpus() const {
return _internal_has_train_extremely_large_corpus();
}
inline void TrainerSpec::clear_train_extremely_large_corpus() {
- train_extremely_large_corpus_ = false;
- _has_bits_[0] &= ~0x00040000u;
+ _impl_.train_extremely_large_corpus_ = false;
+ _impl_._has_bits_[0] &= ~0x00040000u;
}
inline bool TrainerSpec::_internal_train_extremely_large_corpus() const {
- return train_extremely_large_corpus_;
+ return _impl_.train_extremely_large_corpus_;
}
inline bool TrainerSpec::train_extremely_large_corpus() const {
// @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.train_extremely_large_corpus)
return _internal_train_extremely_large_corpus();
}
inline void TrainerSpec::_internal_set_train_extremely_large_corpus(bool value) {
- _has_bits_[0] |= 0x00040000u;
- train_extremely_large_corpus_ = value;
+ _impl_._has_bits_[0] |= 0x00040000u;
+ _impl_.train_extremely_large_corpus_ = value;
}
inline void TrainerSpec::set_train_extremely_large_corpus(bool value) {
_internal_set_train_extremely_large_corpus(value);
@@ -3677,172 +4553,162 @@ inline void TrainerSpec::set_train_extremely_large_corpus(bool value) {
// optional string name = 1;
inline bool NormalizerSpec::_internal_has_name() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool NormalizerSpec::has_name() const {
return _internal_has_name();
}
inline void NormalizerSpec::clear_name() {
- name_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.name_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& NormalizerSpec::name() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.name)
return _internal_name();
}
-inline void NormalizerSpec::set_name(const std::string& value) {
- _internal_set_name(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_name(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.name_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.name)
}
inline std::string* NormalizerSpec::mutable_name() {
+ std::string* _s = _internal_mutable_name();
// @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.name)
- return _internal_mutable_name();
+ return _s;
}
inline const std::string& NormalizerSpec::_internal_name() const {
- return name_.Get();
+ return _impl_.name_.Get();
}
inline void NormalizerSpec::_internal_set_name(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_name(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- name_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.name)
-}
-inline void NormalizerSpec::set_name(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.name)
-}
-inline void NormalizerSpec::set_name(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.name)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.name_.Set(value, GetArenaForAllocation());
}
inline std::string* NormalizerSpec::_internal_mutable_name() {
- _has_bits_[0] |= 0x00000001u;
- return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.name_.Mutable(GetArenaForAllocation());
}
inline std::string* NormalizerSpec::release_name() {
// @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.name)
if (!_internal_has_name()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.name_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.name_.IsDefault()) {
+ _impl_.name_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void NormalizerSpec::set_allocated_name(std::string* name) {
if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
- name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
- GetArena());
+ _impl_.name_.SetAllocated(name, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.name_.IsDefault()) {
+ _impl_.name_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.name)
}
// optional bytes precompiled_charsmap = 2;
inline bool NormalizerSpec::_internal_has_precompiled_charsmap() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool NormalizerSpec::has_precompiled_charsmap() const {
return _internal_has_precompiled_charsmap();
}
inline void NormalizerSpec::clear_precompiled_charsmap() {
- precompiled_charsmap_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.precompiled_charsmap_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& NormalizerSpec::precompiled_charsmap() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.precompiled_charsmap)
return _internal_precompiled_charsmap();
}
-inline void NormalizerSpec::set_precompiled_charsmap(const std::string& value) {
- _internal_set_precompiled_charsmap(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_precompiled_charsmap(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.precompiled_charsmap_.SetBytes(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.precompiled_charsmap)
}
inline std::string* NormalizerSpec::mutable_precompiled_charsmap() {
+ std::string* _s = _internal_mutable_precompiled_charsmap();
// @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.precompiled_charsmap)
- return _internal_mutable_precompiled_charsmap();
+ return _s;
}
inline const std::string& NormalizerSpec::_internal_precompiled_charsmap() const {
- return precompiled_charsmap_.Get();
+ return _impl_.precompiled_charsmap_.Get();
}
inline void NormalizerSpec::_internal_set_precompiled_charsmap(const std::string& value) {
- _has_bits_[0] |= 0x00000002u;
- precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_precompiled_charsmap(std::string&& value) {
- _has_bits_[0] |= 0x00000002u;
- precompiled_charsmap_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.precompiled_charsmap)
-}
-inline void NormalizerSpec::set_precompiled_charsmap(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000002u;
- precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.precompiled_charsmap)
-}
-inline void NormalizerSpec::set_precompiled_charsmap(const void* value,
- size_t size) {
- _has_bits_[0] |= 0x00000002u;
- precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.precompiled_charsmap)
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.precompiled_charsmap_.Set(value, GetArenaForAllocation());
}
inline std::string* NormalizerSpec::_internal_mutable_precompiled_charsmap() {
- _has_bits_[0] |= 0x00000002u;
- return precompiled_charsmap_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000002u;
+ return _impl_.precompiled_charsmap_.Mutable(GetArenaForAllocation());
}
inline std::string* NormalizerSpec::release_precompiled_charsmap() {
// @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.precompiled_charsmap)
if (!_internal_has_precompiled_charsmap()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000002u;
- return precompiled_charsmap_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ auto* p = _impl_.precompiled_charsmap_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.precompiled_charsmap_.IsDefault()) {
+ _impl_.precompiled_charsmap_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void NormalizerSpec::set_allocated_precompiled_charsmap(std::string* precompiled_charsmap) {
if (precompiled_charsmap != nullptr) {
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ }
+ _impl_.precompiled_charsmap_.SetAllocated(precompiled_charsmap, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.precompiled_charsmap_.IsDefault()) {
+ _impl_.precompiled_charsmap_.Set("", GetArenaForAllocation());
}
- precompiled_charsmap_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), precompiled_charsmap,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.precompiled_charsmap)
}
// optional bool add_dummy_prefix = 3 [default = true];
inline bool NormalizerSpec::_internal_has_add_dummy_prefix() const {
- bool value = (_has_bits_[0] & 0x00000008u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value;
}
inline bool NormalizerSpec::has_add_dummy_prefix() const {
return _internal_has_add_dummy_prefix();
}
inline void NormalizerSpec::clear_add_dummy_prefix() {
- add_dummy_prefix_ = true;
- _has_bits_[0] &= ~0x00000008u;
+ _impl_.add_dummy_prefix_ = true;
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
inline bool NormalizerSpec::_internal_add_dummy_prefix() const {
- return add_dummy_prefix_;
+ return _impl_.add_dummy_prefix_;
}
inline bool NormalizerSpec::add_dummy_prefix() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.add_dummy_prefix)
return _internal_add_dummy_prefix();
}
inline void NormalizerSpec::_internal_set_add_dummy_prefix(bool value) {
- _has_bits_[0] |= 0x00000008u;
- add_dummy_prefix_ = value;
+ _impl_._has_bits_[0] |= 0x00000008u;
+ _impl_.add_dummy_prefix_ = value;
}
inline void NormalizerSpec::set_add_dummy_prefix(bool value) {
_internal_set_add_dummy_prefix(value);
@@ -3851,26 +4717,26 @@ inline void NormalizerSpec::set_add_dummy_prefix(bool value) {
// optional bool remove_extra_whitespaces = 4 [default = true];
inline bool NormalizerSpec::_internal_has_remove_extra_whitespaces() const {
- bool value = (_has_bits_[0] & 0x00000010u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0;
return value;
}
inline bool NormalizerSpec::has_remove_extra_whitespaces() const {
return _internal_has_remove_extra_whitespaces();
}
inline void NormalizerSpec::clear_remove_extra_whitespaces() {
- remove_extra_whitespaces_ = true;
- _has_bits_[0] &= ~0x00000010u;
+ _impl_.remove_extra_whitespaces_ = true;
+ _impl_._has_bits_[0] &= ~0x00000010u;
}
inline bool NormalizerSpec::_internal_remove_extra_whitespaces() const {
- return remove_extra_whitespaces_;
+ return _impl_.remove_extra_whitespaces_;
}
inline bool NormalizerSpec::remove_extra_whitespaces() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.remove_extra_whitespaces)
return _internal_remove_extra_whitespaces();
}
inline void NormalizerSpec::_internal_set_remove_extra_whitespaces(bool value) {
- _has_bits_[0] |= 0x00000010u;
- remove_extra_whitespaces_ = value;
+ _impl_._has_bits_[0] |= 0x00000010u;
+ _impl_.remove_extra_whitespaces_ = value;
}
inline void NormalizerSpec::set_remove_extra_whitespaces(bool value) {
_internal_set_remove_extra_whitespaces(value);
@@ -3879,26 +4745,26 @@ inline void NormalizerSpec::set_remove_extra_whitespaces(bool value) {
// optional bool escape_whitespaces = 5 [default = true];
inline bool NormalizerSpec::_internal_has_escape_whitespaces() const {
- bool value = (_has_bits_[0] & 0x00000020u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0;
return value;
}
inline bool NormalizerSpec::has_escape_whitespaces() const {
return _internal_has_escape_whitespaces();
}
inline void NormalizerSpec::clear_escape_whitespaces() {
- escape_whitespaces_ = true;
- _has_bits_[0] &= ~0x00000020u;
+ _impl_.escape_whitespaces_ = true;
+ _impl_._has_bits_[0] &= ~0x00000020u;
}
inline bool NormalizerSpec::_internal_escape_whitespaces() const {
- return escape_whitespaces_;
+ return _impl_.escape_whitespaces_;
}
inline bool NormalizerSpec::escape_whitespaces() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.escape_whitespaces)
return _internal_escape_whitespaces();
}
inline void NormalizerSpec::_internal_set_escape_whitespaces(bool value) {
- _has_bits_[0] |= 0x00000020u;
- escape_whitespaces_ = value;
+ _impl_._has_bits_[0] |= 0x00000020u;
+ _impl_.escape_whitespaces_ = value;
}
inline void NormalizerSpec::set_escape_whitespaces(bool value) {
_internal_set_escape_whitespaces(value);
@@ -3907,74 +4773,69 @@ inline void NormalizerSpec::set_escape_whitespaces(bool value) {
// optional string normalization_rule_tsv = 6;
inline bool NormalizerSpec::_internal_has_normalization_rule_tsv() const {
- bool value = (_has_bits_[0] & 0x00000004u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool NormalizerSpec::has_normalization_rule_tsv() const {
return _internal_has_normalization_rule_tsv();
}
inline void NormalizerSpec::clear_normalization_rule_tsv() {
- normalization_rule_tsv_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000004u;
+ _impl_.normalization_rule_tsv_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
inline const std::string& NormalizerSpec::normalization_rule_tsv() const {
// @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.normalization_rule_tsv)
return _internal_normalization_rule_tsv();
}
-inline void NormalizerSpec::set_normalization_rule_tsv(const std::string& value) {
- _internal_set_normalization_rule_tsv(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_normalization_rule_tsv(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.normalization_rule_tsv_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.normalization_rule_tsv)
}
inline std::string* NormalizerSpec::mutable_normalization_rule_tsv() {
+ std::string* _s = _internal_mutable_normalization_rule_tsv();
// @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.normalization_rule_tsv)
- return _internal_mutable_normalization_rule_tsv();
+ return _s;
}
inline const std::string& NormalizerSpec::_internal_normalization_rule_tsv() const {
- return normalization_rule_tsv_.Get();
+ return _impl_.normalization_rule_tsv_.Get();
}
inline void NormalizerSpec::_internal_set_normalization_rule_tsv(const std::string& value) {
- _has_bits_[0] |= 0x00000004u;
- normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(std::string&& value) {
- _has_bits_[0] |= 0x00000004u;
- normalization_rule_tsv_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.normalization_rule_tsv)
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000004u;
- normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.normalization_rule_tsv)
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000004u;
- normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.normalization_rule_tsv)
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.normalization_rule_tsv_.Set(value, GetArenaForAllocation());
}
inline std::string* NormalizerSpec::_internal_mutable_normalization_rule_tsv() {
- _has_bits_[0] |= 0x00000004u;
- return normalization_rule_tsv_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000004u;
+ return _impl_.normalization_rule_tsv_.Mutable(GetArenaForAllocation());
}
inline std::string* NormalizerSpec::release_normalization_rule_tsv() {
// @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.normalization_rule_tsv)
if (!_internal_has_normalization_rule_tsv()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000004u;
- return normalization_rule_tsv_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000004u;
+ auto* p = _impl_.normalization_rule_tsv_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.normalization_rule_tsv_.IsDefault()) {
+ _impl_.normalization_rule_tsv_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void NormalizerSpec::set_allocated_normalization_rule_tsv(std::string* normalization_rule_tsv) {
if (normalization_rule_tsv != nullptr) {
- _has_bits_[0] |= 0x00000004u;
+ _impl_._has_bits_[0] |= 0x00000004u;
} else {
- _has_bits_[0] &= ~0x00000004u;
+ _impl_._has_bits_[0] &= ~0x00000004u;
+ }
+ _impl_.normalization_rule_tsv_.SetAllocated(normalization_rule_tsv, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.normalization_rule_tsv_.IsDefault()) {
+ _impl_.normalization_rule_tsv_.Set("", GetArenaForAllocation());
}
- normalization_rule_tsv_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), normalization_rule_tsv,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.normalization_rule_tsv)
}
@@ -3984,147 +4845,137 @@ inline void NormalizerSpec::set_allocated_normalization_rule_tsv(std::string* no
// optional string input = 1;
inline bool SelfTestData_Sample::_internal_has_input() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool SelfTestData_Sample::has_input() const {
return _internal_has_input();
}
inline void SelfTestData_Sample::clear_input() {
- input_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.input_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& SelfTestData_Sample::input() const {
// @@protoc_insertion_point(field_get:sentencepiece.SelfTestData.Sample.input)
return _internal_input();
}
-inline void SelfTestData_Sample::set_input(const std::string& value) {
- _internal_set_input(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SelfTestData_Sample::set_input(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.input_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.SelfTestData.Sample.input)
}
inline std::string* SelfTestData_Sample::mutable_input() {
+ std::string* _s = _internal_mutable_input();
// @@protoc_insertion_point(field_mutable:sentencepiece.SelfTestData.Sample.input)
- return _internal_mutable_input();
+ return _s;
}
inline const std::string& SelfTestData_Sample::_internal_input() const {
- return input_.Get();
+ return _impl_.input_.Get();
}
inline void SelfTestData_Sample::_internal_set_input(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SelfTestData_Sample::set_input(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- input_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SelfTestData.Sample.input)
-}
-inline void SelfTestData_Sample::set_input(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.SelfTestData.Sample.input)
-}
-inline void SelfTestData_Sample::set_input(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.SelfTestData.Sample.input)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.input_.Set(value, GetArenaForAllocation());
}
inline std::string* SelfTestData_Sample::_internal_mutable_input() {
- _has_bits_[0] |= 0x00000001u;
- return input_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.input_.Mutable(GetArenaForAllocation());
}
inline std::string* SelfTestData_Sample::release_input() {
// @@protoc_insertion_point(field_release:sentencepiece.SelfTestData.Sample.input)
if (!_internal_has_input()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return input_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.input_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.input_.IsDefault()) {
+ _impl_.input_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void SelfTestData_Sample::set_allocated_input(std::string* input) {
if (input != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ }
+ _impl_.input_.SetAllocated(input, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.input_.IsDefault()) {
+ _impl_.input_.Set("", GetArenaForAllocation());
}
- input_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.SelfTestData.Sample.input)
}
// optional string expected = 2;
inline bool SelfTestData_Sample::_internal_has_expected() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool SelfTestData_Sample::has_expected() const {
return _internal_has_expected();
}
inline void SelfTestData_Sample::clear_expected() {
- expected_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.expected_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& SelfTestData_Sample::expected() const {
// @@protoc_insertion_point(field_get:sentencepiece.SelfTestData.Sample.expected)
return _internal_expected();
}
-inline void SelfTestData_Sample::set_expected(const std::string& value) {
- _internal_set_expected(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SelfTestData_Sample::set_expected(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.expected_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.SelfTestData.Sample.expected)
}
inline std::string* SelfTestData_Sample::mutable_expected() {
+ std::string* _s = _internal_mutable_expected();
// @@protoc_insertion_point(field_mutable:sentencepiece.SelfTestData.Sample.expected)
- return _internal_mutable_expected();
+ return _s;
}
inline const std::string& SelfTestData_Sample::_internal_expected() const {
- return expected_.Get();
+ return _impl_.expected_.Get();
}
inline void SelfTestData_Sample::_internal_set_expected(const std::string& value) {
- _has_bits_[0] |= 0x00000002u;
- expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SelfTestData_Sample::set_expected(std::string&& value) {
- _has_bits_[0] |= 0x00000002u;
- expected_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SelfTestData.Sample.expected)
-}
-inline void SelfTestData_Sample::set_expected(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000002u;
- expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.SelfTestData.Sample.expected)
-}
-inline void SelfTestData_Sample::set_expected(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000002u;
- expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.SelfTestData.Sample.expected)
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.expected_.Set(value, GetArenaForAllocation());
}
inline std::string* SelfTestData_Sample::_internal_mutable_expected() {
- _has_bits_[0] |= 0x00000002u;
- return expected_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000002u;
+ return _impl_.expected_.Mutable(GetArenaForAllocation());
}
inline std::string* SelfTestData_Sample::release_expected() {
// @@protoc_insertion_point(field_release:sentencepiece.SelfTestData.Sample.expected)
if (!_internal_has_expected()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000002u;
- return expected_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ auto* p = _impl_.expected_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.expected_.IsDefault()) {
+ _impl_.expected_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void SelfTestData_Sample::set_allocated_expected(std::string* expected) {
if (expected != nullptr) {
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
- expected_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), expected,
- GetArena());
+ _impl_.expected_.SetAllocated(expected, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.expected_.IsDefault()) {
+ _impl_.expected_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.SelfTestData.Sample.expected)
}
@@ -4134,41 +4985,42 @@ inline void SelfTestData_Sample::set_allocated_expected(std::string* expected) {
// repeated .sentencepiece.SelfTestData.Sample samples = 1;
inline int SelfTestData::_internal_samples_size() const {
- return samples_.size();
+ return _impl_.samples_.size();
}
inline int SelfTestData::samples_size() const {
return _internal_samples_size();
}
inline void SelfTestData::clear_samples() {
- samples_.Clear();
+ _impl_.samples_.Clear();
}
inline ::sentencepiece::SelfTestData_Sample* SelfTestData::mutable_samples(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.SelfTestData.samples)
- return samples_.Mutable(index);
+ return _impl_.samples_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample >*
SelfTestData::mutable_samples() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.SelfTestData.samples)
- return &samples_;
+ return &_impl_.samples_;
}
inline const ::sentencepiece::SelfTestData_Sample& SelfTestData::_internal_samples(int index) const {
- return samples_.Get(index);
+ return _impl_.samples_.Get(index);
}
inline const ::sentencepiece::SelfTestData_Sample& SelfTestData::samples(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.SelfTestData.samples)
return _internal_samples(index);
}
inline ::sentencepiece::SelfTestData_Sample* SelfTestData::_internal_add_samples() {
- return samples_.Add();
+ return _impl_.samples_.Add();
}
inline ::sentencepiece::SelfTestData_Sample* SelfTestData::add_samples() {
+ ::sentencepiece::SelfTestData_Sample* _add = _internal_add_samples();
// @@protoc_insertion_point(field_add:sentencepiece.SelfTestData.samples)
- return _internal_add_samples();
+ return _add;
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample >&
SelfTestData::samples() const {
// @@protoc_insertion_point(field_list:sentencepiece.SelfTestData.samples)
- return samples_;
+ return _impl_.samples_;
}
// -------------------------------------------------------------------
@@ -4177,99 +5029,94 @@ SelfTestData::samples() const {
// optional string piece = 1;
inline bool ModelProto_SentencePiece::_internal_has_piece() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool ModelProto_SentencePiece::has_piece() const {
return _internal_has_piece();
}
inline void ModelProto_SentencePiece::clear_piece() {
- piece_.ClearToEmpty();
- _has_bits_[0] &= ~0x00000001u;
+ _impl_.piece_.ClearToEmpty();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& ModelProto_SentencePiece::piece() const {
// @@protoc_insertion_point(field_get:sentencepiece.ModelProto.SentencePiece.piece)
return _internal_piece();
}
-inline void ModelProto_SentencePiece::set_piece(const std::string& value) {
- _internal_set_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto_SentencePiece::set_piece(ArgT0&& arg0, ArgT... args) {
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:sentencepiece.ModelProto.SentencePiece.piece)
}
inline std::string* ModelProto_SentencePiece::mutable_piece() {
+ std::string* _s = _internal_mutable_piece();
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.SentencePiece.piece)
- return _internal_mutable_piece();
+ return _s;
}
inline const std::string& ModelProto_SentencePiece::_internal_piece() const {
- return piece_.Get();
+ return _impl_.piece_.Get();
}
inline void ModelProto_SentencePiece::_internal_set_piece(const std::string& value) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void ModelProto_SentencePiece::set_piece(std::string&& value) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(
- ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
- // @@protoc_insertion_point(field_set_rvalue:sentencepiece.ModelProto.SentencePiece.piece)
-}
-inline void ModelProto_SentencePiece::set_piece(const char* value) {
- GOOGLE_DCHECK(value != nullptr);
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
- // @@protoc_insertion_point(field_set_char:sentencepiece.ModelProto.SentencePiece.piece)
-}
-inline void ModelProto_SentencePiece::set_piece(const char* value,
- size_t size) {
- _has_bits_[0] |= 0x00000001u;
- piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
- reinterpret_cast<const char*>(value), size), GetArena());
- // @@protoc_insertion_point(field_set_pointer:sentencepiece.ModelProto.SentencePiece.piece)
+ _impl_._has_bits_[0] |= 0x00000001u;
+ _impl_.piece_.Set(value, GetArenaForAllocation());
}
inline std::string* ModelProto_SentencePiece::_internal_mutable_piece() {
- _has_bits_[0] |= 0x00000001u;
- return piece_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+ _impl_._has_bits_[0] |= 0x00000001u;
+ return _impl_.piece_.Mutable(GetArenaForAllocation());
}
inline std::string* ModelProto_SentencePiece::release_piece() {
// @@protoc_insertion_point(field_release:sentencepiece.ModelProto.SentencePiece.piece)
if (!_internal_has_piece()) {
return nullptr;
}
- _has_bits_[0] &= ~0x00000001u;
- return piece_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ auto* p = _impl_.piece_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.piece_.IsDefault()) {
+ _impl_.piece_.Set("", GetArenaForAllocation());
+ }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ return p;
}
inline void ModelProto_SentencePiece::set_allocated_piece(std::string* piece) {
if (piece != nullptr) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ }
+ _impl_.piece_.SetAllocated(piece, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+ if (_impl_.piece_.IsDefault()) {
+ _impl_.piece_.Set("", GetArenaForAllocation());
}
- piece_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), piece,
- GetArena());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.SentencePiece.piece)
}
// optional float score = 2;
inline bool ModelProto_SentencePiece::_internal_has_score() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool ModelProto_SentencePiece::has_score() const {
return _internal_has_score();
}
inline void ModelProto_SentencePiece::clear_score() {
- score_ = 0;
- _has_bits_[0] &= ~0x00000002u;
+ _impl_.score_ = 0;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline float ModelProto_SentencePiece::_internal_score() const {
- return score_;
+ return _impl_.score_;
}
inline float ModelProto_SentencePiece::score() const {
// @@protoc_insertion_point(field_get:sentencepiece.ModelProto.SentencePiece.score)
return _internal_score();
}
inline void ModelProto_SentencePiece::_internal_set_score(float value) {
- _has_bits_[0] |= 0x00000002u;
- score_ = value;
+ _impl_._has_bits_[0] |= 0x00000002u;
+ _impl_.score_ = value;
}
inline void ModelProto_SentencePiece::set_score(float value) {
_internal_set_score(value);
@@ -4278,18 +5125,18 @@ inline void ModelProto_SentencePiece::set_score(float value) {
// optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
inline bool ModelProto_SentencePiece::_internal_has_type() const {
- bool value = (_has_bits_[0] & 0x00000004u) != 0;
+ bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool ModelProto_SentencePiece::has_type() const {
return _internal_has_type();
}
inline void ModelProto_SentencePiece::clear_type() {
- type_ = 1;
- _has_bits_[0] &= ~0x00000004u;
+ _impl_.type_ = 1;
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
inline ::sentencepiece::ModelProto_SentencePiece_Type ModelProto_SentencePiece::_internal_type() const {
- return static_cast< ::sentencepiece::ModelProto_SentencePiece_Type >(type_);
+ return static_cast< ::sentencepiece::ModelProto_SentencePiece_Type >(_impl_.type_);
}
inline ::sentencepiece::ModelProto_SentencePiece_Type ModelProto_SentencePiece::type() const {
// @@protoc_insertion_point(field_get:sentencepiece.ModelProto.SentencePiece.type)
@@ -4297,8 +5144,8 @@ inline ::sentencepiece::ModelProto_SentencePiece_Type ModelProto_SentencePiece::
}
inline void ModelProto_SentencePiece::_internal_set_type(::sentencepiece::ModelProto_SentencePiece_Type value) {
assert(::sentencepiece::ModelProto_SentencePiece_Type_IsValid(value));
- _has_bits_[0] |= 0x00000004u;
- type_ = value;
+ _impl_._has_bits_[0] |= 0x00000004u;
+ _impl_.type_ = value;
}
inline void ModelProto_SentencePiece::set_type(::sentencepiece::ModelProto_SentencePiece_Type value) {
_internal_set_type(value);
@@ -4311,58 +5158,59 @@ inline void ModelProto_SentencePiece::set_type(::sentencepiece::ModelProto_Sente
// repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
inline int ModelProto::_internal_pieces_size() const {
- return pieces_.size();
+ return _impl_.pieces_.size();
}
inline int ModelProto::pieces_size() const {
return _internal_pieces_size();
}
inline void ModelProto::clear_pieces() {
- pieces_.Clear();
+ _impl_.pieces_.Clear();
}
inline ::sentencepiece::ModelProto_SentencePiece* ModelProto::mutable_pieces(int index) {
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.pieces)
- return pieces_.Mutable(index);
+ return _impl_.pieces_.Mutable(index);
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::ModelProto_SentencePiece >*
ModelProto::mutable_pieces() {
// @@protoc_insertion_point(field_mutable_list:sentencepiece.ModelProto.pieces)
- return &pieces_;
+ return &_impl_.pieces_;
}
inline const ::sentencepiece::ModelProto_SentencePiece& ModelProto::_internal_pieces(int index) const {
- return pieces_.Get(index);
+ return _impl_.pieces_.Get(index);
}
inline const ::sentencepiece::ModelProto_SentencePiece& ModelProto::pieces(int index) const {
// @@protoc_insertion_point(field_get:sentencepiece.ModelProto.pieces)
return _internal_pieces(index);
}
inline ::sentencepiece::ModelProto_SentencePiece* ModelProto::_internal_add_pieces() {
- return pieces_.Add();
+ return _impl_.pieces_.Add();
}
inline ::sentencepiece::ModelProto_SentencePiece* ModelProto::add_pieces() {
+ ::sentencepiece::ModelProto_SentencePiece* _add = _internal_add_pieces();
// @@protoc_insertion_point(field_add:sentencepiece.ModelProto.pieces)
- return _internal_add_pieces();
+ return _add;
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::ModelProto_SentencePiece >&
ModelProto::pieces() const {
// @@protoc_insertion_point(field_list:sentencepiece.ModelProto.pieces)
- return pieces_;
+ return _impl_.pieces_;
}
// optional .sentencepiece.TrainerSpec trainer_spec = 2;
inline bool ModelProto::_internal_has_trainer_spec() const {
- bool value = (_has_bits_[0] & 0x00000001u) != 0;
- PROTOBUF_ASSUME(!value || trainer_spec_ != nullptr);
+ bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
+ PROTOBUF_ASSUME(!value || _impl_.trainer_spec_ != nullptr);
return value;
}
inline bool ModelProto::has_trainer_spec() const {
return _internal_has_trainer_spec();
}
inline void ModelProto::clear_trainer_spec() {
- if (trainer_spec_ != nullptr) trainer_spec_->Clear();
- _has_bits_[0] &= ~0x00000001u;
+ if (_impl_.trainer_spec_ != nullptr) _impl_.trainer_spec_->Clear();
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
inline const ::sentencepiece::TrainerSpec& ModelProto::_internal_trainer_spec() const {
- const ::sentencepiece::TrainerSpec* p = trainer_spec_;
+ const ::sentencepiece::TrainerSpec* p = _impl_.trainer_spec_;
return p != nullptr ? *p : reinterpret_cast<const ::sentencepiece::TrainerSpec&>(
::sentencepiece::_TrainerSpec_default_instance_);
}
@@ -4372,80 +5220,87 @@ inline const ::sentencepiece::TrainerSpec& ModelProto::trainer_spec() const {
}
inline void ModelProto::unsafe_arena_set_allocated_trainer_spec(
::sentencepiece::TrainerSpec* trainer_spec) {
- if (GetArena() == nullptr) {
- delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(trainer_spec_);
+ if (GetArenaForAllocation() == nullptr) {
+ delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.trainer_spec_);
}
- trainer_spec_ = trainer_spec;
+ _impl_.trainer_spec_ = trainer_spec;
if (trainer_spec) {
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:sentencepiece.ModelProto.trainer_spec)
}
inline ::sentencepiece::TrainerSpec* ModelProto::release_trainer_spec() {
- _has_bits_[0] &= ~0x00000001u;
- ::sentencepiece::TrainerSpec* temp = trainer_spec_;
- trainer_spec_ = nullptr;
- if (GetArena() != nullptr) {
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ ::sentencepiece::TrainerSpec* temp = _impl_.trainer_spec_;
+ _impl_.trainer_spec_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+ auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+ temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+ if (GetArenaForAllocation() == nullptr) { delete old; }
+#else // PROTOBUF_FORCE_COPY_IN_RELEASE
+ if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
+#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::sentencepiece::TrainerSpec* ModelProto::unsafe_arena_release_trainer_spec() {
// @@protoc_insertion_point(field_release:sentencepiece.ModelProto.trainer_spec)
- _has_bits_[0] &= ~0x00000001u;
- ::sentencepiece::TrainerSpec* temp = trainer_spec_;
- trainer_spec_ = nullptr;
+ _impl_._has_bits_[0] &= ~0x00000001u;
+ ::sentencepiece::TrainerSpec* temp = _impl_.trainer_spec_;
+ _impl_.trainer_spec_ = nullptr;
return temp;
}
inline ::sentencepiece::TrainerSpec* ModelProto::_internal_mutable_trainer_spec() {
- _has_bits_[0] |= 0x00000001u;
- if (trainer_spec_ == nullptr) {
- auto* p = CreateMaybeMessage<::sentencepiece::TrainerSpec>(GetArena());
- trainer_spec_ = p;
+ _impl_._has_bits_[0] |= 0x00000001u;
+ if (_impl_.trainer_spec_ == nullptr) {
+ auto* p = CreateMaybeMessage<::sentencepiece::TrainerSpec>(GetArenaForAllocation());
+ _impl_.trainer_spec_ = p;
}
- return trainer_spec_;
+ return _impl_.trainer_spec_;
}
inline ::sentencepiece::TrainerSpec* ModelProto::mutable_trainer_spec() {
+ ::sentencepiece::TrainerSpec* _msg = _internal_mutable_trainer_spec();
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.trainer_spec)
- return _internal_mutable_trainer_spec();
+ return _msg;
}
inline void ModelProto::set_allocated_trainer_spec(::sentencepiece::TrainerSpec* trainer_spec) {
- ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+ ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
- delete trainer_spec_;
+ delete _impl_.trainer_spec_;
}
if (trainer_spec) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
- ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(trainer_spec);
+ ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(trainer_spec);
if (message_arena != submessage_arena) {
trainer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, trainer_spec, submessage_arena);
}
- _has_bits_[0] |= 0x00000001u;
+ _impl_._has_bits_[0] |= 0x00000001u;
} else {
- _has_bits_[0] &= ~0x00000001u;
+ _impl_._has_bits_[0] &= ~0x00000001u;
}
- trainer_spec_ = trainer_spec;
+ _impl_.trainer_spec_ = trainer_spec;
// @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.trainer_spec)
}
// optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
inline bool ModelProto::_internal_has_normalizer_spec() const {
- bool value = (_has_bits_[0] & 0x00000002u) != 0;
- PROTOBUF_ASSUME(!value || normalizer_spec_ != nullptr);
+ bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
+ PROTOBUF_ASSUME(!value || _impl_.normalizer_spec_ != nullptr);
return value;
}
inline bool ModelProto::has_normalizer_spec() const {
return _internal_has_normalizer_spec();
}
inline void ModelProto::clear_normalizer_spec() {
- if (normalizer_spec_ != nullptr) normalizer_spec_->Clear();
- _has_bits_[0] &= ~0x00000002u;
+ if (_impl_.normalizer_spec_ != nullptr) _impl_.normalizer_spec_->Clear();
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
inline const ::sentencepiece::NormalizerSpec& ModelProto::_internal_normalizer_spec() const {
- const ::sentencepiece::NormalizerSpec* p = normalizer_spec_;
+ const ::sentencepiece::NormalizerSpec* p = _impl_.normalizer_spec_;
return p != nullptr ? *p : reinterpret_cast<const ::sentencepiece::NormalizerSpec&>(
::sentencepiece::_NormalizerSpec_default_instance_);
}
@@ -4455,80 +5310,87 @@ inline const ::sentencepiece::NormalizerSpec& ModelProto::normalizer_spec() cons
}
inline void ModelProto::unsafe_arena_set_allocated_normalizer_spec(
::sentencepiece::NormalizerSpec* normalizer_spec) {
- if (GetArena() == nullptr) {
- delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(normalizer_spec_);
+ if (GetArenaForAllocation() == nullptr) {
+ delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.normalizer_spec_);
}
- normalizer_spec_ = normalizer_spec;
+ _impl_.normalizer_spec_ = normalizer_spec;
if (normalizer_spec) {
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:sentencepiece.ModelProto.normalizer_spec)
}
inline ::sentencepiece::NormalizerSpec* ModelProto::release_normalizer_spec() {
- _has_bits_[0] &= ~0x00000002u;
- ::sentencepiece::NormalizerSpec* temp = normalizer_spec_;
- normalizer_spec_ = nullptr;
- if (GetArena() != nullptr) {
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ ::sentencepiece::NormalizerSpec* temp = _impl_.normalizer_spec_;
+ _impl_.normalizer_spec_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+ auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+ temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+ if (GetArenaForAllocation() == nullptr) { delete old; }
+#else // PROTOBUF_FORCE_COPY_IN_RELEASE
+ if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
+#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_normalizer_spec() {
// @@protoc_insertion_point(field_release:sentencepiece.ModelProto.normalizer_spec)
- _has_bits_[0] &= ~0x00000002u;
- ::sentencepiece::NormalizerSpec* temp = normalizer_spec_;
- normalizer_spec_ = nullptr;
+ _impl_._has_bits_[0] &= ~0x00000002u;
+ ::sentencepiece::NormalizerSpec* temp = _impl_.normalizer_spec_;
+ _impl_.normalizer_spec_ = nullptr;
return temp;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::_internal_mutable_normalizer_spec() {
- _has_bits_[0] |= 0x00000002u;
- if (normalizer_spec_ == nullptr) {
- auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArena());
- normalizer_spec_ = p;
+ _impl_._has_bits_[0] |= 0x00000002u;
+ if (_impl_.normalizer_spec_ == nullptr) {
+ auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArenaForAllocation());
+ _impl_.normalizer_spec_ = p;
}
- return normalizer_spec_;
+ return _impl_.normalizer_spec_;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::mutable_normalizer_spec() {
+ ::sentencepiece::NormalizerSpec* _msg = _internal_mutable_normalizer_spec();
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.normalizer_spec)
- return _internal_mutable_normalizer_spec();
+ return _msg;
}
inline void ModelProto::set_allocated_normalizer_spec(::sentencepiece::NormalizerSpec* normalizer_spec) {
- ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+ ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
- delete normalizer_spec_;
+ delete _impl_.normalizer_spec_;
}
if (normalizer_spec) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
- ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(normalizer_spec);
+ ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(normalizer_spec);
if (message_arena != submessage_arena) {
normalizer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, normalizer_spec, submessage_arena);
}
- _has_bits_[0] |= 0x00000002u;
+ _impl_._has_bits_[0] |= 0x00000002u;
} else {
- _has_bits_[0] &= ~0x00000002u;
+ _impl_._has_bits_[0] &= ~0x00000002u;
}
- normalizer_spec_ = normalizer_spec;
+ _impl_.normalizer_spec_ = normalizer_spec;
// @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.normalizer_spec)
}
// optional .sentencepiece.SelfTestData self_test_data = 4;
inline bool ModelProto::_internal_has_self_test_data() const {
- bool value = (_has_bits_[0] & 0x00000004u) != 0;
- PROTOBUF_ASSUME(!value || self_test_data_ != nullptr);
+ bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
+ PROTOBUF_ASSUME(!value || _impl_.self_test_data_ != nullptr);
return value;
}
inline bool ModelProto::has_self_test_data() const {
return _internal_has_self_test_data();
}
inline void ModelProto::clear_self_test_data() {
- if (self_test_data_ != nullptr) self_test_data_->Clear();
- _has_bits_[0] &= ~0x00000004u;
+ if (_impl_.self_test_data_ != nullptr) _impl_.self_test_data_->Clear();
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
inline const ::sentencepiece::SelfTestData& ModelProto::_internal_self_test_data() const {
- const ::sentencepiece::SelfTestData* p = self_test_data_;
+ const ::sentencepiece::SelfTestData* p = _impl_.self_test_data_;
return p != nullptr ? *p : reinterpret_cast<const ::sentencepiece::SelfTestData&>(
::sentencepiece::_SelfTestData_default_instance_);
}
@@ -4538,80 +5400,87 @@ inline const ::sentencepiece::SelfTestData& ModelProto::self_test_data() const {
}
inline void ModelProto::unsafe_arena_set_allocated_self_test_data(
::sentencepiece::SelfTestData* self_test_data) {
- if (GetArena() == nullptr) {
- delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(self_test_data_);
+ if (GetArenaForAllocation() == nullptr) {
+ delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.self_test_data_);
}
- self_test_data_ = self_test_data;
+ _impl_.self_test_data_ = self_test_data;
if (self_test_data) {
- _has_bits_[0] |= 0x00000004u;
+ _impl_._has_bits_[0] |= 0x00000004u;
} else {
- _has_bits_[0] &= ~0x00000004u;
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:sentencepiece.ModelProto.self_test_data)
}
inline ::sentencepiece::SelfTestData* ModelProto::release_self_test_data() {
- _has_bits_[0] &= ~0x00000004u;
- ::sentencepiece::SelfTestData* temp = self_test_data_;
- self_test_data_ = nullptr;
- if (GetArena() != nullptr) {
+ _impl_._has_bits_[0] &= ~0x00000004u;
+ ::sentencepiece::SelfTestData* temp = _impl_.self_test_data_;
+ _impl_.self_test_data_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+ auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+ temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+ if (GetArenaForAllocation() == nullptr) { delete old; }
+#else // PROTOBUF_FORCE_COPY_IN_RELEASE
+ if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
+#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::sentencepiece::SelfTestData* ModelProto::unsafe_arena_release_self_test_data() {
// @@protoc_insertion_point(field_release:sentencepiece.ModelProto.self_test_data)
- _has_bits_[0] &= ~0x00000004u;
- ::sentencepiece::SelfTestData* temp = self_test_data_;
- self_test_data_ = nullptr;
+ _impl_._has_bits_[0] &= ~0x00000004u;
+ ::sentencepiece::SelfTestData* temp = _impl_.self_test_data_;
+ _impl_.self_test_data_ = nullptr;
return temp;
}
inline ::sentencepiece::SelfTestData* ModelProto::_internal_mutable_self_test_data() {
- _has_bits_[0] |= 0x00000004u;
- if (self_test_data_ == nullptr) {
- auto* p = CreateMaybeMessage<::sentencepiece::SelfTestData>(GetArena());
- self_test_data_ = p;
+ _impl_._has_bits_[0] |= 0x00000004u;
+ if (_impl_.self_test_data_ == nullptr) {
+ auto* p = CreateMaybeMessage<::sentencepiece::SelfTestData>(GetArenaForAllocation());
+ _impl_.self_test_data_ = p;
}
- return self_test_data_;
+ return _impl_.self_test_data_;
}
inline ::sentencepiece::SelfTestData* ModelProto::mutable_self_test_data() {
+ ::sentencepiece::SelfTestData* _msg = _internal_mutable_self_test_data();
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.self_test_data)
- return _internal_mutable_self_test_data();
+ return _msg;
}
inline void ModelProto::set_allocated_self_test_data(::sentencepiece::SelfTestData* self_test_data) {
- ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+ ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
- delete self_test_data_;
+ delete _impl_.self_test_data_;
}
if (self_test_data) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
- ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(self_test_data);
+ ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(self_test_data);
if (message_arena != submessage_arena) {
self_test_data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, self_test_data, submessage_arena);
}
- _has_bits_[0] |= 0x00000004u;
+ _impl_._has_bits_[0] |= 0x00000004u;
} else {
- _has_bits_[0] &= ~0x00000004u;
+ _impl_._has_bits_[0] &= ~0x00000004u;
}
- self_test_data_ = self_test_data;
+ _impl_.self_test_data_ = self_test_data;
// @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.self_test_data)
}
// optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
inline bool ModelProto::_internal_has_denormalizer_spec() const {
- bool value = (_has_bits_[0] & 0x00000008u) != 0;
- PROTOBUF_ASSUME(!value || denormalizer_spec_ != nullptr);
+ bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
+ PROTOBUF_ASSUME(!value || _impl_.denormalizer_spec_ != nullptr);
return value;
}
inline bool ModelProto::has_denormalizer_spec() const {
return _internal_has_denormalizer_spec();
}
inline void ModelProto::clear_denormalizer_spec() {
- if (denormalizer_spec_ != nullptr) denormalizer_spec_->Clear();
- _has_bits_[0] &= ~0x00000008u;
+ if (_impl_.denormalizer_spec_ != nullptr) _impl_.denormalizer_spec_->Clear();
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
inline const ::sentencepiece::NormalizerSpec& ModelProto::_internal_denormalizer_spec() const {
- const ::sentencepiece::NormalizerSpec* p = denormalizer_spec_;
+ const ::sentencepiece::NormalizerSpec* p = _impl_.denormalizer_spec_;
return p != nullptr ? *p : reinterpret_cast<const ::sentencepiece::NormalizerSpec&>(
::sentencepiece::_NormalizerSpec_default_instance_);
}
@@ -4621,62 +5490,69 @@ inline const ::sentencepiece::NormalizerSpec& ModelProto::denormalizer_spec() co
}
inline void ModelProto::unsafe_arena_set_allocated_denormalizer_spec(
::sentencepiece::NormalizerSpec* denormalizer_spec) {
- if (GetArena() == nullptr) {
- delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(denormalizer_spec_);
+ if (GetArenaForAllocation() == nullptr) {
+ delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.denormalizer_spec_);
}
- denormalizer_spec_ = denormalizer_spec;
+ _impl_.denormalizer_spec_ = denormalizer_spec;
if (denormalizer_spec) {
- _has_bits_[0] |= 0x00000008u;
+ _impl_._has_bits_[0] |= 0x00000008u;
} else {
- _has_bits_[0] &= ~0x00000008u;
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:sentencepiece.ModelProto.denormalizer_spec)
}
inline ::sentencepiece::NormalizerSpec* ModelProto::release_denormalizer_spec() {
- _has_bits_[0] &= ~0x00000008u;
- ::sentencepiece::NormalizerSpec* temp = denormalizer_spec_;
- denormalizer_spec_ = nullptr;
- if (GetArena() != nullptr) {
+ _impl_._has_bits_[0] &= ~0x00000008u;
+ ::sentencepiece::NormalizerSpec* temp = _impl_.denormalizer_spec_;
+ _impl_.denormalizer_spec_ = nullptr;
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+ auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+ temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+ if (GetArenaForAllocation() == nullptr) { delete old; }
+#else // PROTOBUF_FORCE_COPY_IN_RELEASE
+ if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
+#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_denormalizer_spec() {
// @@protoc_insertion_point(field_release:sentencepiece.ModelProto.denormalizer_spec)
- _has_bits_[0] &= ~0x00000008u;
- ::sentencepiece::NormalizerSpec* temp = denormalizer_spec_;
- denormalizer_spec_ = nullptr;
+ _impl_._has_bits_[0] &= ~0x00000008u;
+ ::sentencepiece::NormalizerSpec* temp = _impl_.denormalizer_spec_;
+ _impl_.denormalizer_spec_ = nullptr;
return temp;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::_internal_mutable_denormalizer_spec() {
- _has_bits_[0] |= 0x00000008u;
- if (denormalizer_spec_ == nullptr) {
- auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArena());
- denormalizer_spec_ = p;
+ _impl_._has_bits_[0] |= 0x00000008u;
+ if (_impl_.denormalizer_spec_ == nullptr) {
+ auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArenaForAllocation());
+ _impl_.denormalizer_spec_ = p;
}
- return denormalizer_spec_;
+ return _impl_.denormalizer_spec_;
}
inline ::sentencepiece::NormalizerSpec* ModelProto::mutable_denormalizer_spec() {
+ ::sentencepiece::NormalizerSpec* _msg = _internal_mutable_denormalizer_spec();
// @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.denormalizer_spec)
- return _internal_mutable_denormalizer_spec();
+ return _msg;
}
inline void ModelProto::set_allocated_denormalizer_spec(::sentencepiece::NormalizerSpec* denormalizer_spec) {
- ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+ ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
- delete denormalizer_spec_;
+ delete _impl_.denormalizer_spec_;
}
if (denormalizer_spec) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
- ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(denormalizer_spec);
+ ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(denormalizer_spec);
if (message_arena != submessage_arena) {
denormalizer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, denormalizer_spec, submessage_arena);
}
- _has_bits_[0] |= 0x00000008u;
+ _impl_._has_bits_[0] |= 0x00000008u;
} else {
- _has_bits_[0] &= ~0x00000008u;
+ _impl_._has_bits_[0] &= ~0x00000008u;
}
- denormalizer_spec_ = denormalizer_spec;
+ _impl_.denormalizer_spec_ = denormalizer_spec;
// @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.denormalizer_spec)
}