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

#include "Normalizer.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 {
constexpr Normalizer::Normalizer(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : normtype_(0)
{}
struct NormalizerDefaultTypeInternal {
  constexpr NormalizerDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~NormalizerDefaultTypeInternal() {}
  union {
    Normalizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NormalizerDefaultTypeInternal _Normalizer_default_instance_;
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {
bool Normalizer_NormType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> Normalizer_NormType_strings[3] = {};

static const char Normalizer_NormType_names[] =
  "L1"
  "L2"
  "LMax";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Normalizer_NormType_entries[] = {
  { {Normalizer_NormType_names + 0, 2}, 1 },
  { {Normalizer_NormType_names + 2, 2}, 2 },
  { {Normalizer_NormType_names + 4, 4}, 0 },
};

static const int Normalizer_NormType_entries_by_number[] = {
  2, // 0 -> LMax
  0, // 1 -> L1
  1, // 2 -> L2
};

const std::string& Normalizer_NormType_Name(
    Normalizer_NormType value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Normalizer_NormType_entries,
          Normalizer_NormType_entries_by_number,
          3, Normalizer_NormType_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Normalizer_NormType_entries,
      Normalizer_NormType_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     Normalizer_NormType_strings[idx].get();
}
bool Normalizer_NormType_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Normalizer_NormType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      Normalizer_NormType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<Normalizer_NormType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr Normalizer_NormType Normalizer::LMax;
constexpr Normalizer_NormType Normalizer::L1;
constexpr Normalizer_NormType Normalizer::L2;
constexpr Normalizer_NormType Normalizer::NormType_MIN;
constexpr Normalizer_NormType Normalizer::NormType_MAX;
constexpr int Normalizer::NormType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class Normalizer::_Internal {
 public:
};

Normalizer::Normalizer(::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.Normalizer)
}
Normalizer::Normalizer(const Normalizer& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  normtype_ = from.normtype_;
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.Normalizer)
}

inline void Normalizer::SharedCtor() {
normtype_ = 0;
}

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

inline void Normalizer::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

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

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

  normtype_ = 0;
  _internal_metadata_.Clear<std::string>();
}

const char* Normalizer::_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) {
      // .CoreML.Specification.Normalizer.NormType normType = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_normtype(static_cast<::CoreML::Specification::Normalizer_NormType>(val));
        } 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* Normalizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.Normalizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .CoreML.Specification.Normalizer.NormType normType = 1;
  if (this->_internal_normtype() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_normtype(), 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.Normalizer)
  return target;
}

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

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

  // .CoreML.Specification.Normalizer.NormType normType = 1;
  if (this->_internal_normtype() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_normtype());
  }

  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 Normalizer::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Normalizer*>(
      &from));
}

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

  if (from._internal_normtype() != 0) {
    _internal_set_normtype(from._internal_normtype());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Normalizer::InternalSwap(Normalizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(normtype_, other->normtype_);
}

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


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

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