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

#include "Scaler.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 Scaler::Scaler(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : shiftvalue_()
  , scalevalue_(){}
struct ScalerDefaultTypeInternal {
  constexpr ScalerDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ScalerDefaultTypeInternal() {}
  union {
    Scaler _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ScalerDefaultTypeInternal _Scaler_default_instance_;
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {

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

class Scaler::_Internal {
 public:
};

Scaler::Scaler(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  shiftvalue_(arena),
  scalevalue_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.Scaler)
}
Scaler::Scaler(const Scaler& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      shiftvalue_(from.shiftvalue_),
      scalevalue_(from.scalevalue_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.Scaler)
}

inline void Scaler::SharedCtor() {
}

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

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

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

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

  shiftvalue_.Clear();
  scalevalue_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Scaler::_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) {
      // repeated double shiftValue = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_shiftvalue(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 9) {
          _internal_add_shiftvalue(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // repeated double scaleValue = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_scalevalue(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 17) {
          _internal_add_scalevalue(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } 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* Scaler::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.Scaler)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated double shiftValue = 1;
  if (this->_internal_shiftvalue_size() > 0) {
    target = stream->WriteFixedPacked(1, _internal_shiftvalue(), target);
  }

  // repeated double scaleValue = 2;
  if (this->_internal_scalevalue_size() > 0) {
    target = stream->WriteFixedPacked(2, _internal_scalevalue(), 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.Scaler)
  return target;
}

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

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

  // repeated double shiftValue = 1;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_shiftvalue_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated double scaleValue = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_scalevalue_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

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

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

  shiftvalue_.MergeFrom(from.shiftvalue_);
  scalevalue_.MergeFrom(from.scalevalue_);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void Scaler::InternalSwap(Scaler* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  shiftvalue_.InternalSwap(&other->shiftvalue_);
  scalevalue_.InternalSwap(&other->scalevalue_);
}

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


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

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