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

#include "second/protos/sampler.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 second {
namespace protos {
PROTOBUF_CONSTEXPR Group_NameToMaxNumEntry_DoNotUse::Group_NameToMaxNumEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct Group_NameToMaxNumEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Group_NameToMaxNumEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Group_NameToMaxNumEntry_DoNotUseDefaultTypeInternal() {}
  union {
    Group_NameToMaxNumEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Group_NameToMaxNumEntry_DoNotUseDefaultTypeInternal _Group_NameToMaxNumEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR Group::Group(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.name_to_max_num_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct GroupDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GroupDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~GroupDefaultTypeInternal() {}
  union {
    Group _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroupDefaultTypeInternal _Group_default_instance_;
PROTOBUF_CONSTEXPR Sampler::Sampler(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.sample_groups_)*/{}
  , /*decltype(_impl_.database_prep_steps_)*/{}
  , /*decltype(_impl_.global_random_rotation_range_per_object_)*/{}
  , /*decltype(_impl_.database_info_path_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.rate_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct SamplerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR SamplerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~SamplerDefaultTypeInternal() {}
  union {
    Sampler _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SamplerDefaultTypeInternal _Sampler_default_instance_;
}  // namespace protos
}  // namespace second
static ::_pb::Metadata file_level_metadata_second_2fprotos_2fsampler_2eproto[3];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_second_2fprotos_2fsampler_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_second_2fprotos_2fsampler_2eproto = nullptr;

const uint32_t TableStruct_second_2fprotos_2fsampler_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::second::protos::Group_NameToMaxNumEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Group_NameToMaxNumEntry_DoNotUse, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::Group_NameToMaxNumEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Group_NameToMaxNumEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::Group, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::Group, _impl_.name_to_max_num_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _impl_.database_info_path_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _impl_.sample_groups_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _impl_.database_prep_steps_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _impl_.global_random_rotation_range_per_object_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Sampler, _impl_.rate_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::second::protos::Group_NameToMaxNumEntry_DoNotUse)},
  { 10, -1, -1, sizeof(::second::protos::Group)},
  { 17, -1, -1, sizeof(::second::protos::Sampler)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::second::protos::_Group_NameToMaxNumEntry_DoNotUse_default_instance_._instance,
  &::second::protos::_Group_default_instance_._instance,
  &::second::protos::_Sampler_default_instance_._instance,
};

const char descriptor_table_protodef_second_2fprotos_2fsampler_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\033second/protos/sampler.proto\022\rsecond.pr"
  "otos\032\036second/protos/preprocess.proto\"}\n\005"
  "Group\022\?\n\017name_to_max_num\030\001 \003(\0132&.second."
  "protos.Group.NameToMaxNumEntry\0323\n\021NameTo"
  "MaxNumEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\r:"
  "\0028\001\"\330\001\n\007Sampler\022\032\n\022database_info_path\030\001 "
  "\001(\t\022+\n\rsample_groups\030\002 \003(\0132\024.second.prot"
  "os.Group\022E\n\023database_prep_steps\030\003 \003(\0132(."
  "second.protos.DatabasePreprocessingStep\022"
  "/\n\'global_random_rotation_range_per_obje"
  "ct\030\004 \003(\002\022\014\n\004rate\030\005 \001(\002b\006proto3"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_second_2fprotos_2fsampler_2eproto_deps[1] = {
  &::descriptor_table_second_2fprotos_2fpreprocess_2eproto,
};
static ::_pbi::once_flag descriptor_table_second_2fprotos_2fsampler_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_second_2fprotos_2fsampler_2eproto = {
    false, false, 430, descriptor_table_protodef_second_2fprotos_2fsampler_2eproto,
    "second/protos/sampler.proto",
    &descriptor_table_second_2fprotos_2fsampler_2eproto_once, descriptor_table_second_2fprotos_2fsampler_2eproto_deps, 1, 3,
    schemas, file_default_instances, TableStruct_second_2fprotos_2fsampler_2eproto::offsets,
    file_level_metadata_second_2fprotos_2fsampler_2eproto, file_level_enum_descriptors_second_2fprotos_2fsampler_2eproto,
    file_level_service_descriptors_second_2fprotos_2fsampler_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_second_2fprotos_2fsampler_2eproto_getter() {
  return &descriptor_table_second_2fprotos_2fsampler_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_second_2fprotos_2fsampler_2eproto(&descriptor_table_second_2fprotos_2fsampler_2eproto);
namespace second {
namespace protos {

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

Group_NameToMaxNumEntry_DoNotUse::Group_NameToMaxNumEntry_DoNotUse() {}
Group_NameToMaxNumEntry_DoNotUse::Group_NameToMaxNumEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void Group_NameToMaxNumEntry_DoNotUse::MergeFrom(const Group_NameToMaxNumEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata Group_NameToMaxNumEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2fsampler_2eproto_getter, &descriptor_table_second_2fprotos_2fsampler_2eproto_once,
      file_level_metadata_second_2fprotos_2fsampler_2eproto[0]);
}

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

class Group::_Internal {
 public:
};

Group::Group(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  if (arena != nullptr && !is_message_owned) {
    arena->OwnCustomDestructor(this, &Group::ArenaDtor);
  }
  // @@protoc_insertion_point(arena_constructor:second.protos.Group)
}
Group::Group(const Group& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Group* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_.name_to_max_num_)*/{}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.name_to_max_num_.MergeFrom(from._impl_.name_to_max_num_);
  // @@protoc_insertion_point(copy_constructor:second.protos.Group)
}

inline void Group::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.name_to_max_num_)*/{::_pbi::ArenaInitialized(), arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void Group::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.name_to_max_num_.Destruct();
  _impl_.name_to_max_num_.~MapField();
}

void Group::ArenaDtor(void* object) {
  Group* _this = reinterpret_cast< Group* >(object);
  _this->_impl_.name_to_max_num_.Destruct();
}
void Group::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

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

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

const char* Group::_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) {
      // map<string, uint32> name_to_max_num = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&_impl_.name_to_max_num_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(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* Group::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.Group)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // map<string, uint32> name_to_max_num = 1;
  if (!this->_internal_name_to_max_num().empty()) {
    using MapType = ::_pb::Map<std::string, uint32_t>;
    using WireHelper = Group_NameToMaxNumEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_name_to_max_num();
    auto check_utf8 = [](const MapType::value_type& entry) {
      (void)entry;
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        entry.first.data(), static_cast<int>(entry.first.length()),
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
        "second.protos.Group.NameToMaxNumEntry.key");
    };

    if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
      for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
        target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    } else {
      for (const auto& entry : map_field) {
        target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    }
  }

  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:second.protos.Group)
  return target;
}

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

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

  // map<string, uint32> name_to_max_num = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_name_to_max_num_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, uint32_t >::const_iterator
      it = this->_internal_name_to_max_num().begin();
      it != this->_internal_name_to_max_num().end(); ++it) {
    total_size += Group_NameToMaxNumEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  _this->_impl_.name_to_max_num_.MergeFrom(from._impl_.name_to_max_num_);
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void Group::InternalSwap(Group* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.name_to_max_num_.InternalSwap(&other->_impl_.name_to_max_num_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Group::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2fsampler_2eproto_getter, &descriptor_table_second_2fprotos_2fsampler_2eproto_once,
      file_level_metadata_second_2fprotos_2fsampler_2eproto[1]);
}

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

class Sampler::_Internal {
 public:
};

void Sampler::clear_database_prep_steps() {
  _impl_.database_prep_steps_.Clear();
}
Sampler::Sampler(::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:second.protos.Sampler)
}
Sampler::Sampler(const Sampler& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Sampler* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.sample_groups_){from._impl_.sample_groups_}
    , decltype(_impl_.database_prep_steps_){from._impl_.database_prep_steps_}
    , decltype(_impl_.global_random_rotation_range_per_object_){from._impl_.global_random_rotation_range_per_object_}
    , decltype(_impl_.database_info_path_){}
    , decltype(_impl_.rate_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.database_info_path_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.database_info_path_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_database_info_path().empty()) {
    _this->_impl_.database_info_path_.Set(from._internal_database_info_path(), 
      _this->GetArenaForAllocation());
  }
  _this->_impl_.rate_ = from._impl_.rate_;
  // @@protoc_insertion_point(copy_constructor:second.protos.Sampler)
}

inline void Sampler::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.sample_groups_){arena}
    , decltype(_impl_.database_prep_steps_){arena}
    , decltype(_impl_.global_random_rotation_range_per_object_){arena}
    , decltype(_impl_.database_info_path_){}
    , decltype(_impl_.rate_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.database_info_path_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.database_info_path_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void Sampler::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.sample_groups_.~RepeatedPtrField();
  _impl_.database_prep_steps_.~RepeatedPtrField();
  _impl_.global_random_rotation_range_per_object_.~RepeatedField();
  _impl_.database_info_path_.Destroy();
}

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

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

  _impl_.sample_groups_.Clear();
  _impl_.database_prep_steps_.Clear();
  _impl_.global_random_rotation_range_per_object_.Clear();
  _impl_.database_info_path_.ClearToEmpty();
  _impl_.rate_ = 0;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Sampler::_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) {
      // string database_info_path = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_database_info_path();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "second.protos.Sampler.database_info_path"));
        } else
          goto handle_unusual;
        continue;
      // repeated .second.protos.Group sample_groups = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_sample_groups(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .second.protos.DatabasePreprocessingStep database_prep_steps = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_database_prep_steps(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated float global_random_rotation_range_per_object = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_global_random_rotation_range_per_object(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 37) {
          _internal_add_global_random_rotation_range_per_object(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float rate = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
          _impl_.rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } 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* Sampler::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.Sampler)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string database_info_path = 1;
  if (!this->_internal_database_info_path().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_database_info_path().data(), static_cast<int>(this->_internal_database_info_path().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "second.protos.Sampler.database_info_path");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_database_info_path(), target);
  }

  // repeated .second.protos.Group sample_groups = 2;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_sample_groups_size()); i < n; i++) {
    const auto& repfield = this->_internal_sample_groups(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
  }

  // repeated .second.protos.DatabasePreprocessingStep database_prep_steps = 3;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_database_prep_steps_size()); i < n; i++) {
    const auto& repfield = this->_internal_database_prep_steps(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
  }

  // repeated float global_random_rotation_range_per_object = 4;
  if (this->_internal_global_random_rotation_range_per_object_size() > 0) {
    target = stream->WriteFixedPacked(4, _internal_global_random_rotation_range_per_object(), target);
  }

  // float rate = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_rate = this->_internal_rate();
  uint32_t raw_rate;
  memcpy(&raw_rate, &tmp_rate, sizeof(tmp_rate));
  if (raw_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(5, this->_internal_rate(), target);
  }

  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:second.protos.Sampler)
  return target;
}

size_t Sampler::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.Sampler)
  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 .second.protos.Group sample_groups = 2;
  total_size += 1UL * this->_internal_sample_groups_size();
  for (const auto& msg : this->_impl_.sample_groups_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .second.protos.DatabasePreprocessingStep database_prep_steps = 3;
  total_size += 1UL * this->_internal_database_prep_steps_size();
  for (const auto& msg : this->_impl_.database_prep_steps_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated float global_random_rotation_range_per_object = 4;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_global_random_rotation_range_per_object_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

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

  // float rate = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_rate = this->_internal_rate();
  uint32_t raw_rate;
  memcpy(&raw_rate, &tmp_rate, sizeof(tmp_rate));
  if (raw_rate != 0) {
    total_size += 1 + 4;
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  _this->_impl_.sample_groups_.MergeFrom(from._impl_.sample_groups_);
  _this->_impl_.database_prep_steps_.MergeFrom(from._impl_.database_prep_steps_);
  _this->_impl_.global_random_rotation_range_per_object_.MergeFrom(from._impl_.global_random_rotation_range_per_object_);
  if (!from._internal_database_info_path().empty()) {
    _this->_internal_set_database_info_path(from._internal_database_info_path());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_rate = from._internal_rate();
  uint32_t raw_rate;
  memcpy(&raw_rate, &tmp_rate, sizeof(tmp_rate));
  if (raw_rate != 0) {
    _this->_internal_set_rate(from._internal_rate());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void Sampler::InternalSwap(Sampler* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.sample_groups_.InternalSwap(&other->_impl_.sample_groups_);
  _impl_.database_prep_steps_.InternalSwap(&other->_impl_.database_prep_steps_);
  _impl_.global_random_rotation_range_per_object_.InternalSwap(&other->_impl_.global_random_rotation_range_per_object_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.database_info_path_, lhs_arena,
      &other->_impl_.database_info_path_, rhs_arena
  );
  swap(_impl_.rate_, other->_impl_.rate_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Sampler::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2fsampler_2eproto_getter, &descriptor_table_second_2fprotos_2fsampler_2eproto_once,
      file_level_metadata_second_2fprotos_2fsampler_2eproto[2]);
}

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

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