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

#include "second/protos/voxel_generator.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 VoxelGenerator::VoxelGenerator(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.voxel_size_)*/{}
  , /*decltype(_impl_.point_cloud_range_)*/{}
  , /*decltype(_impl_.submanifold_size_)*/{}
  , /*decltype(_impl_._submanifold_size_cached_byte_size_)*/{0}
  , /*decltype(_impl_.max_number_of_points_per_voxel_)*/0u
  , /*decltype(_impl_.submanifold_group_)*/false
  , /*decltype(_impl_.submanifold_max_points_)*/0u
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct VoxelGeneratorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR VoxelGeneratorDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~VoxelGeneratorDefaultTypeInternal() {}
  union {
    VoxelGenerator _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VoxelGeneratorDefaultTypeInternal _VoxelGenerator_default_instance_;
}  // namespace protos
}  // namespace second
static ::_pb::Metadata file_level_metadata_second_2fprotos_2fvoxel_5fgenerator_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_second_2fprotos_2fvoxel_5fgenerator_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_second_2fprotos_2fvoxel_5fgenerator_2eproto = nullptr;

const uint32_t TableStruct_second_2fprotos_2fvoxel_5fgenerator_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.voxel_size_),
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.point_cloud_range_),
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.max_number_of_points_per_voxel_),
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.submanifold_group_),
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.submanifold_size_),
  PROTOBUF_FIELD_OFFSET(::second::protos::VoxelGenerator, _impl_.submanifold_max_points_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::second::protos::VoxelGenerator)},
};

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

const char descriptor_table_protodef_second_2fprotos_2fvoxel_5fgenerator_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n#second/protos/voxel_generator.proto\022\rs"
  "econd.protos\"\274\001\n\016VoxelGenerator\022\022\n\nvoxel"
  "_size\030\001 \003(\002\022\031\n\021point_cloud_range\030\002 \003(\002\022&"
  "\n\036max_number_of_points_per_voxel\030\003 \001(\r\022\031"
  "\n\021submanifold_group\030\004 \001(\010\022\030\n\020submanifold"
  "_size\030\005 \003(\r\022\036\n\026submanifold_max_points\030\006 "
  "\001(\rb\006proto3"
  ;
static ::_pbi::once_flag descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto = {
    false, false, 251, descriptor_table_protodef_second_2fprotos_2fvoxel_5fgenerator_2eproto,
    "second/protos/voxel_generator.proto",
    &descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto_once, nullptr, 0, 1,
    schemas, file_default_instances, TableStruct_second_2fprotos_2fvoxel_5fgenerator_2eproto::offsets,
    file_level_metadata_second_2fprotos_2fvoxel_5fgenerator_2eproto, file_level_enum_descriptors_second_2fprotos_2fvoxel_5fgenerator_2eproto,
    file_level_service_descriptors_second_2fprotos_2fvoxel_5fgenerator_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto_getter() {
  return &descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto;
}

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

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

class VoxelGenerator::_Internal {
 public:
};

VoxelGenerator::VoxelGenerator(::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.VoxelGenerator)
}
VoxelGenerator::VoxelGenerator(const VoxelGenerator& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  VoxelGenerator* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.voxel_size_){from._impl_.voxel_size_}
    , decltype(_impl_.point_cloud_range_){from._impl_.point_cloud_range_}
    , decltype(_impl_.submanifold_size_){from._impl_.submanifold_size_}
    , /*decltype(_impl_._submanifold_size_cached_byte_size_)*/{0}
    , decltype(_impl_.max_number_of_points_per_voxel_){}
    , decltype(_impl_.submanifold_group_){}
    , decltype(_impl_.submanifold_max_points_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.max_number_of_points_per_voxel_, &from._impl_.max_number_of_points_per_voxel_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.submanifold_max_points_) -
    reinterpret_cast<char*>(&_impl_.max_number_of_points_per_voxel_)) + sizeof(_impl_.submanifold_max_points_));
  // @@protoc_insertion_point(copy_constructor:second.protos.VoxelGenerator)
}

inline void VoxelGenerator::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.voxel_size_){arena}
    , decltype(_impl_.point_cloud_range_){arena}
    , decltype(_impl_.submanifold_size_){arena}
    , /*decltype(_impl_._submanifold_size_cached_byte_size_)*/{0}
    , decltype(_impl_.max_number_of_points_per_voxel_){0u}
    , decltype(_impl_.submanifold_group_){false}
    , decltype(_impl_.submanifold_max_points_){0u}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void VoxelGenerator::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.voxel_size_.~RepeatedField();
  _impl_.point_cloud_range_.~RepeatedField();
  _impl_.submanifold_size_.~RepeatedField();
}

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

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

  _impl_.voxel_size_.Clear();
  _impl_.point_cloud_range_.Clear();
  _impl_.submanifold_size_.Clear();
  ::memset(&_impl_.max_number_of_points_per_voxel_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.submanifold_max_points_) -
      reinterpret_cast<char*>(&_impl_.max_number_of_points_per_voxel_)) + sizeof(_impl_.submanifold_max_points_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* VoxelGenerator::_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) {
      // repeated float voxel_size = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_voxel_size(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 13) {
          _internal_add_voxel_size(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // repeated float point_cloud_range = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_point_cloud_range(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 21) {
          _internal_add_point_cloud_range(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // uint32 max_number_of_points_per_voxel = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.max_number_of_points_per_voxel_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool submanifold_group = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.submanifold_group_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated uint32 submanifold_size = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_submanifold_size(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 40) {
          _internal_add_submanifold_size(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 submanifold_max_points = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _impl_.submanifold_max_points_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* VoxelGenerator::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.VoxelGenerator)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated float voxel_size = 1;
  if (this->_internal_voxel_size_size() > 0) {
    target = stream->WriteFixedPacked(1, _internal_voxel_size(), target);
  }

  // repeated float point_cloud_range = 2;
  if (this->_internal_point_cloud_range_size() > 0) {
    target = stream->WriteFixedPacked(2, _internal_point_cloud_range(), target);
  }

  // uint32 max_number_of_points_per_voxel = 3;
  if (this->_internal_max_number_of_points_per_voxel() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_max_number_of_points_per_voxel(), target);
  }

  // bool submanifold_group = 4;
  if (this->_internal_submanifold_group() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_submanifold_group(), target);
  }

  // repeated uint32 submanifold_size = 5;
  {
    int byte_size = _impl_._submanifold_size_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          5, _internal_submanifold_size(), byte_size, target);
    }
  }

  // uint32 submanifold_max_points = 6;
  if (this->_internal_submanifold_max_points() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_submanifold_max_points(), 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.VoxelGenerator)
  return target;
}

size_t VoxelGenerator::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.VoxelGenerator)
  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 float voxel_size = 1;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_voxel_size_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;
  }

  // repeated float point_cloud_range = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_point_cloud_range_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;
  }

  // repeated uint32 submanifold_size = 5;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      UInt32Size(this->_impl_.submanifold_size_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _impl_._submanifold_size_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // uint32 max_number_of_points_per_voxel = 3;
  if (this->_internal_max_number_of_points_per_voxel() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_number_of_points_per_voxel());
  }

  // bool submanifold_group = 4;
  if (this->_internal_submanifold_group() != 0) {
    total_size += 1 + 1;
  }

  // uint32 submanifold_max_points = 6;
  if (this->_internal_submanifold_max_points() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_submanifold_max_points());
  }

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

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


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

  _this->_impl_.voxel_size_.MergeFrom(from._impl_.voxel_size_);
  _this->_impl_.point_cloud_range_.MergeFrom(from._impl_.point_cloud_range_);
  _this->_impl_.submanifold_size_.MergeFrom(from._impl_.submanifold_size_);
  if (from._internal_max_number_of_points_per_voxel() != 0) {
    _this->_internal_set_max_number_of_points_per_voxel(from._internal_max_number_of_points_per_voxel());
  }
  if (from._internal_submanifold_group() != 0) {
    _this->_internal_set_submanifold_group(from._internal_submanifold_group());
  }
  if (from._internal_submanifold_max_points() != 0) {
    _this->_internal_set_submanifold_max_points(from._internal_submanifold_max_points());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void VoxelGenerator::InternalSwap(VoxelGenerator* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.voxel_size_.InternalSwap(&other->_impl_.voxel_size_);
  _impl_.point_cloud_range_.InternalSwap(&other->_impl_.point_cloud_range_);
  _impl_.submanifold_size_.InternalSwap(&other->_impl_.submanifold_size_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(VoxelGenerator, _impl_.submanifold_max_points_)
      + sizeof(VoxelGenerator::_impl_.submanifold_max_points_)
      - PROTOBUF_FIELD_OFFSET(VoxelGenerator, _impl_.max_number_of_points_per_voxel_)>(
          reinterpret_cast<char*>(&_impl_.max_number_of_points_per_voxel_),
          reinterpret_cast<char*>(&other->_impl_.max_number_of_points_per_voxel_));
}

::PROTOBUF_NAMESPACE_ID::Metadata VoxelGenerator::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto_getter, &descriptor_table_second_2fprotos_2fvoxel_5fgenerator_2eproto_once,
      file_level_metadata_second_2fprotos_2fvoxel_5fgenerator_2eproto[0]);
}

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

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