// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: object_detection/protos/model.proto

#include "object_detection/protos/model.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/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace object_detection {
namespace protos {
PROTOBUF_CONSTEXPR DetectionModel::DetectionModel(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.model_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct DetectionModelDefaultTypeInternal {
  PROTOBUF_CONSTEXPR DetectionModelDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~DetectionModelDefaultTypeInternal() {}
  union {
    DetectionModel _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DetectionModelDefaultTypeInternal _DetectionModel_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2fmodel_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_object_5fdetection_2fprotos_2fmodel_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2fmodel_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2fmodel_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::DetectionModel, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::DetectionModel, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::DetectionModel, _impl_.model_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::object_detection::protos::DetectionModel)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::object_detection::protos::_DetectionModel_default_instance_._instance,
};

const char descriptor_table_protodef_object_5fdetection_2fprotos_2fmodel_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n#object_detection/protos/model.proto\022\027o"
  "bject_detection.protos\032)object_detection"
  "/protos/faster_rcnn.proto\032!object_detect"
  "ion/protos/ssd.proto\"\202\001\n\016DetectionModel\022"
  ":\n\013faster_rcnn\030\001 \001(\0132#.object_detection."
  "protos.FasterRcnnH\000\022+\n\003ssd\030\002 \001(\0132\034.objec"
  "t_detection.protos.SsdH\000B\007\n\005model"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_deps[2] = {
  &::descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto,
};
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto = {
    false, false, 273, descriptor_table_protodef_object_5fdetection_2fprotos_2fmodel_2eproto,
    "object_detection/protos/model.proto",
    &descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_once, descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_deps, 2, 1,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2fmodel_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2fmodel_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2fmodel_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2fmodel_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_object_5fdetection_2fprotos_2fmodel_2eproto(&descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto);
namespace object_detection {
namespace protos {

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

class DetectionModel::_Internal {
 public:
  static const ::object_detection::protos::FasterRcnn& faster_rcnn(const DetectionModel* msg);
  static const ::object_detection::protos::Ssd& ssd(const DetectionModel* msg);
};

const ::object_detection::protos::FasterRcnn&
DetectionModel::_Internal::faster_rcnn(const DetectionModel* msg) {
  return *msg->_impl_.model_.faster_rcnn_;
}
const ::object_detection::protos::Ssd&
DetectionModel::_Internal::ssd(const DetectionModel* msg) {
  return *msg->_impl_.model_.ssd_;
}
void DetectionModel::set_allocated_faster_rcnn(::object_detection::protos::FasterRcnn* faster_rcnn) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_model();
  if (faster_rcnn) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(faster_rcnn));
    if (message_arena != submessage_arena) {
      faster_rcnn = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, faster_rcnn, submessage_arena);
    }
    set_has_faster_rcnn();
    _impl_.model_.faster_rcnn_ = faster_rcnn;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.DetectionModel.faster_rcnn)
}
void DetectionModel::clear_faster_rcnn() {
  if (_internal_has_faster_rcnn()) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.model_.faster_rcnn_;
    }
    clear_has_model();
  }
}
void DetectionModel::set_allocated_ssd(::object_detection::protos::Ssd* ssd) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_model();
  if (ssd) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
                reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(ssd));
    if (message_arena != submessage_arena) {
      ssd = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, ssd, submessage_arena);
    }
    set_has_ssd();
    _impl_.model_.ssd_ = ssd;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.DetectionModel.ssd)
}
void DetectionModel::clear_ssd() {
  if (_internal_has_ssd()) {
    if (GetArenaForAllocation() == nullptr) {
      delete _impl_.model_.ssd_;
    }
    clear_has_model();
  }
}
DetectionModel::DetectionModel(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.DetectionModel)
}
DetectionModel::DetectionModel(const DetectionModel& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  DetectionModel* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.model_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  clear_has_model();
  switch (from.model_case()) {
    case kFasterRcnn: {
      _this->_internal_mutable_faster_rcnn()->::object_detection::protos::FasterRcnn::MergeFrom(
          from._internal_faster_rcnn());
      break;
    }
    case kSsd: {
      _this->_internal_mutable_ssd()->::object_detection::protos::Ssd::MergeFrom(
          from._internal_ssd());
      break;
    }
    case MODEL_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.DetectionModel)
}

inline void DetectionModel::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.model_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_model();
}

DetectionModel::~DetectionModel() {
  // @@protoc_insertion_point(destructor:object_detection.protos.DetectionModel)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void DetectionModel::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_model()) {
    clear_model();
  }
}

void DetectionModel::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void DetectionModel::clear_model() {
// @@protoc_insertion_point(one_of_clear_start:object_detection.protos.DetectionModel)
  switch (model_case()) {
    case kFasterRcnn: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.model_.faster_rcnn_;
      }
      break;
    }
    case kSsd: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.model_.ssd_;
      }
      break;
    }
    case MODEL_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = MODEL_NOT_SET;
}


void DetectionModel::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.DetectionModel)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_model();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* DetectionModel::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .object_detection.protos.FasterRcnn faster_rcnn = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_faster_rcnn(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .object_detection.protos.Ssd ssd = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_ssd(), ptr);
          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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* DetectionModel::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.DetectionModel)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (model_case()) {
    case kFasterRcnn: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::faster_rcnn(this),
          _Internal::faster_rcnn(this).GetCachedSize(), target, stream);
      break;
    }
    case kSsd: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::ssd(this),
          _Internal::ssd(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:object_detection.protos.DetectionModel)
  return target;
}

size_t DetectionModel::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.DetectionModel)
  size_t total_size = 0;

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

  switch (model_case()) {
    // .object_detection.protos.FasterRcnn faster_rcnn = 1;
    case kFasterRcnn: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.model_.faster_rcnn_);
      break;
    }
    // .object_detection.protos.Ssd ssd = 2;
    case kSsd: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.model_.ssd_);
      break;
    }
    case MODEL_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData DetectionModel::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    DetectionModel::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*DetectionModel::GetClassData() const { return &_class_data_; }


void DetectionModel::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<DetectionModel*>(&to_msg);
  auto& from = static_cast<const DetectionModel&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.DetectionModel)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.model_case()) {
    case kFasterRcnn: {
      _this->_internal_mutable_faster_rcnn()->::object_detection::protos::FasterRcnn::MergeFrom(
          from._internal_faster_rcnn());
      break;
    }
    case kSsd: {
      _this->_internal_mutable_ssd()->::object_detection::protos::Ssd::MergeFrom(
          from._internal_ssd());
      break;
    }
    case MODEL_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void DetectionModel::CopyFrom(const DetectionModel& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.DetectionModel)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void DetectionModel::InternalSwap(DetectionModel* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.model_, other->_impl_.model_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata DetectionModel::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fmodel_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fmodel_2eproto[0]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace object_detection
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::object_detection::protos::DetectionModel*
Arena::CreateMaybeMessage< ::object_detection::protos::DetectionModel >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::DetectionModel >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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