// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: WordEmbedding.proto

#include "WordEmbedding.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace CoreML {
namespace Specification {
namespace CoreMLModels {
constexpr WordEmbedding::WordEmbedding(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : language_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , modelparameterdata_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , revision_(0u){}
struct WordEmbeddingDefaultTypeInternal {
  constexpr WordEmbeddingDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~WordEmbeddingDefaultTypeInternal() {}
  union {
    WordEmbedding _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT WordEmbeddingDefaultTypeInternal _WordEmbedding_default_instance_;
}  // namespace CoreMLModels
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {
namespace CoreMLModels {

// ===================================================================

class WordEmbedding::_Internal {
 public:
};

WordEmbedding::WordEmbedding(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.CoreMLModels.WordEmbedding)
}
WordEmbedding::WordEmbedding(const WordEmbedding& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  language_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    language_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_language().empty()) {
    language_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_language(), 
      GetArenaForAllocation());
  }
  modelparameterdata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    modelparameterdata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_modelparameterdata().empty()) {
    modelparameterdata_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_modelparameterdata(), 
      GetArenaForAllocation());
  }
  revision_ = from.revision_;
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.CoreMLModels.WordEmbedding)
}

inline void WordEmbedding::SharedCtor() {
language_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  language_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
modelparameterdata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  modelparameterdata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
revision_ = 0u;
}

WordEmbedding::~WordEmbedding() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.CoreMLModels.WordEmbedding)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void WordEmbedding::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  language_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  modelparameterdata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void WordEmbedding::ArenaDtor(void* object) {
  WordEmbedding* _this = reinterpret_cast< WordEmbedding* >(object);
  (void)_this;
}
void WordEmbedding::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void WordEmbedding::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void WordEmbedding::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.CoreMLModels.WordEmbedding)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  language_.ClearToEmpty();
  modelparameterdata_.ClearToEmpty();
  revision_ = 0u;
  _internal_metadata_.Clear<std::string>();
}

const char* WordEmbedding::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint32 revision = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string language = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_language();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes modelParameterData = 100;
      case 100:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_modelparameterdata();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } 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;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* WordEmbedding::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.CoreMLModels.WordEmbedding)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 revision = 1;
  if (this->_internal_revision() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_revision(), target);
  }

  // string language = 10;
  if (!this->_internal_language().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_language().data(), static_cast<int>(this->_internal_language().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.CoreMLModels.WordEmbedding.language");
    target = stream->WriteStringMaybeAliased(
        10, this->_internal_language(), target);
  }

  // bytes modelParameterData = 100;
  if (!this->_internal_modelparameterdata().empty()) {
    target = stream->WriteBytesMaybeAliased(
        100, this->_internal_modelparameterdata(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:CoreML.Specification.CoreMLModels.WordEmbedding)
  return target;
}

size_t WordEmbedding::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.CoreMLModels.WordEmbedding)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // string language = 10;
  if (!this->_internal_language().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_language());
  }

  // bytes modelParameterData = 100;
  if (!this->_internal_modelparameterdata().empty()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_modelparameterdata());
  }

  // uint32 revision = 1;
  if (this->_internal_revision() != 0) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_revision());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void WordEmbedding::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const WordEmbedding*>(
      &from));
}

void WordEmbedding::MergeFrom(const WordEmbedding& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.CoreMLModels.WordEmbedding)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_language().empty()) {
    _internal_set_language(from._internal_language());
  }
  if (!from._internal_modelparameterdata().empty()) {
    _internal_set_modelparameterdata(from._internal_modelparameterdata());
  }
  if (from._internal_revision() != 0) {
    _internal_set_revision(from._internal_revision());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void WordEmbedding::CopyFrom(const WordEmbedding& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.CoreMLModels.WordEmbedding)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool WordEmbedding::IsInitialized() const {
  return true;
}

void WordEmbedding::InternalSwap(WordEmbedding* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &language_, lhs_arena,
      &other->language_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &modelparameterdata_, lhs_arena,
      &other->modelparameterdata_, rhs_arena
  );
  swap(revision_, other->revision_);
}

std::string WordEmbedding::GetTypeName() const {
  return "CoreML.Specification.CoreMLModels.WordEmbedding";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace CoreMLModels
}  // namespace Specification
}  // namespace CoreML
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::CoreML::Specification::CoreMLModels::WordEmbedding* Arena::CreateMaybeMessage< ::CoreML::Specification::CoreMLModels::WordEmbedding >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::CoreMLModels::WordEmbedding >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
