From 48c5f8e0fbe7beea47c60d7370eb22de443177f2 Mon Sep 17 00:00:00 2001 From: cguo51 Date: Thu, 7 Mar 2024 15:52:54 -0700 Subject: [PATCH] remove protobuf dependency --- .gitmodules | 3 - CMakeLists.txt | 2 - proto/treeNode.proto | 17 - tests/unit/CMakeLists.txt | 2 +- .../unit/index/strtree/SimpleSTRtreeTest.cpp | 48 -- tests/unit/index/strtree/treeNode.pb.cpp | 811 ------------------ tests/unit/index/strtree/treeNode.pb.h | 721 ---------------- third_party/protobuf | 1 - 8 files changed, 1 insertion(+), 1604 deletions(-) delete mode 100644 .gitmodules delete mode 100644 proto/treeNode.proto delete mode 100644 tests/unit/index/strtree/treeNode.pb.cpp delete mode 100644 tests/unit/index/strtree/treeNode.pb.h delete mode 160000 third_party/protobuf diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a53f6e56f..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "third_party/protobuf"] - path = third_party/protobuf - url = https://github.com/protocolbuffers/protobuf.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d6a69ca3..63ed743e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,8 +161,6 @@ message(STATUS "GEOS: Archives output: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") include(GNUInstallDirs) include(CMakePackageConfigHelpers) -include_directories(BEFORE third_party/protobuf) -add_subdirectory(third_party/protobuf) include_directories(${CMAKE_CURRENT_BINARY_DIR}) #----------------------------------------------------------------------------- # C++ language version and compilation flags diff --git a/proto/treeNode.proto b/proto/treeNode.proto deleted file mode 100644 index 3d44108e7..000000000 --- a/proto/treeNode.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -message TreeNode { - int32 level = 1; - int32 childSize = 2; - double minx = 3; - double maxx = 4; - double miny = 5; - double maxy = 6; - double minz = 7; - double maxz = 8; - int32 slice_id = 9; -} - -message Tree { - repeated TreeNode treeNodes = 1; -} \ No newline at end of file diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 0c24c30c1..e36add0ff 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -15,7 +15,7 @@ unset(_sources) find_package(Threads) -target_link_libraries(test_geos_unit PRIVATE geos geos_c Threads::Threads protobuf::libprotobuf) +target_link_libraries(test_geos_unit PRIVATE geos geos_c Threads::Threads) target_include_directories(test_geos_unit PRIVATE $) diff --git a/tests/unit/index/strtree/SimpleSTRtreeTest.cpp b/tests/unit/index/strtree/SimpleSTRtreeTest.cpp index a11f11394..af4138ed5 100644 --- a/tests/unit/index/strtree/SimpleSTRtreeTest.cpp +++ b/tests/unit/index/strtree/SimpleSTRtreeTest.cpp @@ -27,7 +27,6 @@ #include #include #endif -#include "treeNode.pb.h" #include // get current process pid inline int GetCurrentPid() @@ -227,40 +226,6 @@ return mem / 1024.0 / 1024.0; #endif } -void serialize(geos::index::strtree::SimpleSTRnode3d *node_ptr, Tree &serializeList) { - geos::geom::Envelope3d *bounds = (geom::Envelope3d *) node_ptr->getBounds(); - std::size_t nChildren = node_ptr->getChildNodes().size(); - TreeNode signleNode; - signleNode.set_level((int) node_ptr->getLevel()); - signleNode.set_childsize((int) node_ptr->getChildNodes().size()); - signleNode.set_minx(bounds->getMinX()); - signleNode.set_maxx(bounds->getMaxX()); - signleNode.set_miny(bounds->getMinY()); - signleNode.set_maxy(bounds->getMaxY()); - signleNode.set_minz(bounds->getMinZ()); - signleNode.set_maxz(bounds->getMaxZ()); - signleNode.set_slice_id((int) bounds->getSliceId()); - - serializeList.add_treenodes()->CopyFrom(signleNode); - for (std::size_t j = 0; j < nChildren; j++) { - serialize(node_ptr->getChildNodes()[j], serializeList); - } -} - -void deSerialize(geos::index::strtree::SimpleSTRnode3d *&node_ptr, Tree *serializeList, int &seq) { - const TreeNode &node = (*serializeList).treenodes(seq); - geos::geom::Envelope3d e(node.minx(), node.maxx(), node.miny(), node.maxy(), node.minz(), node.maxz(), node.slice_id()); - node_ptr = new geos::index::strtree::SimpleSTRnode3d(static_cast(node.level()), &e, - static_cast(&e)); - if (node.childsize() != 0) { - for (int j = 0; j < node.childsize(); j++) { - geos::index::strtree::SimpleSTRnode3d *child = nullptr; - seq = seq + 1; - deSerialize(child, serializeList, seq); - node_ptr->addChildNode3d(child); - } - } -} template<> @@ -284,19 +249,6 @@ void object::test<4> } } t.getRoot3d(); - Tree serializeList; - serialize(t.root3d, serializeList); - std::string serializeString; - serializeList.SerializeToString(&serializeString); - - Tree readSerializeList; - geos::index::strtree::SimpleSTRnode3d *root_node = nullptr; - if (!readSerializeList.ParseFromString(serializeString)) { - std::cerr << "Failed to parse file." << std::endl; - } - int seq = 0; - deSerialize(root_node, &readSerializeList, seq); - std::cout << "deSerialize successfully" << std::endl; } diff --git a/tests/unit/index/strtree/treeNode.pb.cpp b/tests/unit/index/strtree/treeNode.pb.cpp deleted file mode 100644 index 227b0c80f..000000000 --- a/tests/unit/index/strtree/treeNode.pb.cpp +++ /dev/null @@ -1,811 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: treeNode.proto - -#include "treeNode.pb.h" - -#include -#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) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::PROTOBUF_NAMESPACE_ID; -namespace _pbi = ::PROTOBUF_NAMESPACE_ID::internal; -PROTOBUF_CONSTEXPR TreeNode::TreeNode( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.level_)*/ 0 - - , /*decltype(_impl_.childsize_)*/ 0 - - , /*decltype(_impl_.minx_)*/ 0 - - , /*decltype(_impl_.maxx_)*/ 0 - - , /*decltype(_impl_.miny_)*/ 0 - - , /*decltype(_impl_.maxy_)*/ 0 - - , /*decltype(_impl_.minz_)*/ 0 - - , /*decltype(_impl_.maxz_)*/ 0 - - , /*decltype(_impl_.slice_id_)*/ 0 - - , /*decltype(_impl_._cached_size_)*/{}} {} -struct TreeNodeDefaultTypeInternal { - PROTOBUF_CONSTEXPR TreeNodeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~TreeNodeDefaultTypeInternal() {} - union { - TreeNode _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TreeNodeDefaultTypeInternal _TreeNode_default_instance_; -PROTOBUF_CONSTEXPR Tree::Tree( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.treenodes_)*/{} - , /*decltype(_impl_._cached_size_)*/{}} {} -struct TreeDefaultTypeInternal { - PROTOBUF_CONSTEXPR TreeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~TreeDefaultTypeInternal() {} - union { - Tree _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TreeDefaultTypeInternal _Tree_default_instance_; -static ::_pb::Metadata file_level_metadata_treeNode_2eproto[2]; -static constexpr const ::_pb::EnumDescriptor** - file_level_enum_descriptors_treeNode_2eproto = nullptr; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_treeNode_2eproto = nullptr; -const ::uint32_t TableStruct_treeNode_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( - protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::TreeNode, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.level_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.childsize_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.minx_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.maxx_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.miny_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.maxy_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.minz_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.maxz_), - PROTOBUF_FIELD_OFFSET(::TreeNode, _impl_.slice_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::Tree, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::Tree, _impl_.treenodes_), -}; - -static const ::_pbi::MigrationSchema - schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::TreeNode)}, - { 17, -1, -1, sizeof(::Tree)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::_TreeNode_default_instance_._instance, - &::_Tree_default_instance_._instance, -}; -const char descriptor_table_protodef_treeNode_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\016treeNode.proto\"\222\001\n\010TreeNode\022\r\n\005level\030\001" - " \001(\005\022\021\n\tchildSize\030\002 \001(\005\022\014\n\004minx\030\003 \001(\001\022\014\n" - "\004maxx\030\004 \001(\001\022\014\n\004miny\030\005 \001(\001\022\014\n\004maxy\030\006 \001(\001\022" - "\014\n\004minz\030\007 \001(\001\022\014\n\004maxz\030\010 \001(\001\022\020\n\010slice_id\030" - "\t \001(\005\"$\n\004Tree\022\034\n\ttreeNodes\030\001 \003(\0132\t.TreeN" - "odeb\006proto3" -}; -static ::absl::once_flag descriptor_table_treeNode_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_treeNode_2eproto = { - false, - false, - 211, - descriptor_table_protodef_treeNode_2eproto, - "treeNode.proto", - &descriptor_table_treeNode_2eproto_once, - nullptr, - 0, - 2, - schemas, - file_default_instances, - TableStruct_treeNode_2eproto::offsets, - file_level_metadata_treeNode_2eproto, - file_level_enum_descriptors_treeNode_2eproto, - file_level_service_descriptors_treeNode_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_treeNode_2eproto_getter() { - return &descriptor_table_treeNode_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_treeNode_2eproto(&descriptor_table_treeNode_2eproto); -// =================================================================== - -class TreeNode::_Internal { - public: -}; - -TreeNode::TreeNode(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:TreeNode) -} -TreeNode::TreeNode(const TreeNode& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), _impl_(from._impl_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>( - from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:TreeNode) -} - -inline void TreeNode::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_.level_) { 0 } - - , decltype(_impl_.childsize_) { 0 } - - , decltype(_impl_.minx_) { 0 } - - , decltype(_impl_.maxx_) { 0 } - - , decltype(_impl_.miny_) { 0 } - - , decltype(_impl_.maxy_) { 0 } - - , decltype(_impl_.minz_) { 0 } - - , decltype(_impl_.maxz_) { 0 } - - , decltype(_impl_.slice_id_) { 0 } - - , /*decltype(_impl_._cached_size_)*/{} - }; -} - -TreeNode::~TreeNode() { - // @@protoc_insertion_point(destructor:TreeNode) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void TreeNode::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); -} - -void TreeNode::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void TreeNode::Clear() { -// @@protoc_insertion_point(message_clear_start:TreeNode) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.level_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.slice_id_) - - reinterpret_cast(&_impl_.level_)) + sizeof(_impl_.slice_id_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* TreeNode::_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) { - // int32 level = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) { - _impl_.level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else { - goto handle_unusual; - } - continue; - // int32 childSize = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) { - _impl_.childsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else { - goto handle_unusual; - } - continue; - // double minx = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 25)) { - _impl_.minx_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // double maxx = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 33)) { - _impl_.maxx_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // double miny = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 41)) { - _impl_.miny_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // double maxy = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 49)) { - _impl_.maxy_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // double minz = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 57)) { - _impl_.minz_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // double maxz = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 65)) { - _impl_.maxz_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else { - goto handle_unusual; - } - continue; - // int32 slice_id = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) { - _impl_.slice_id_ = ::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* TreeNode::_InternalSerialize( - ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:TreeNode) - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // int32 level = 1; - if (this->_internal_level() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 1, this->_internal_level(), target); - } - - // int32 childSize = 2; - if (this->_internal_childsize() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 2, this->_internal_childsize(), target); - } - - // double minx = 3; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minx = this->_internal_minx(); - ::uint64_t raw_minx; - memcpy(&raw_minx, &tmp_minx, sizeof(tmp_minx)); - if (raw_minx != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 3, this->_internal_minx(), target); - } - - // double maxx = 4; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxx = this->_internal_maxx(); - ::uint64_t raw_maxx; - memcpy(&raw_maxx, &tmp_maxx, sizeof(tmp_maxx)); - if (raw_maxx != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 4, this->_internal_maxx(), target); - } - - // double miny = 5; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_miny = this->_internal_miny(); - ::uint64_t raw_miny; - memcpy(&raw_miny, &tmp_miny, sizeof(tmp_miny)); - if (raw_miny != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 5, this->_internal_miny(), target); - } - - // double maxy = 6; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxy = this->_internal_maxy(); - ::uint64_t raw_maxy; - memcpy(&raw_maxy, &tmp_maxy, sizeof(tmp_maxy)); - if (raw_maxy != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 6, this->_internal_maxy(), target); - } - - // double minz = 7; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minz = this->_internal_minz(); - ::uint64_t raw_minz; - memcpy(&raw_minz, &tmp_minz, sizeof(tmp_minz)); - if (raw_minz != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 7, this->_internal_minz(), target); - } - - // double maxz = 8; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxz = this->_internal_maxz(); - ::uint64_t raw_maxz; - memcpy(&raw_maxz, &tmp_maxz, sizeof(tmp_maxz)); - if (raw_maxz != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray( - 8, this->_internal_maxz(), target); - } - - // int32 slice_id = 9; - if (this->_internal_slice_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray( - 9, this->_internal_slice_id(), 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:TreeNode) - return target; -} - -::size_t TreeNode::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:TreeNode) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int32 level = 1; - if (this->_internal_level() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_level()); - } - - // int32 childSize = 2; - if (this->_internal_childsize() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_childsize()); - } - - // double minx = 3; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minx = this->_internal_minx(); - ::uint64_t raw_minx; - memcpy(&raw_minx, &tmp_minx, sizeof(tmp_minx)); - if (raw_minx != 0) { - total_size += 9; - } - - // double maxx = 4; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxx = this->_internal_maxx(); - ::uint64_t raw_maxx; - memcpy(&raw_maxx, &tmp_maxx, sizeof(tmp_maxx)); - if (raw_maxx != 0) { - total_size += 9; - } - - // double miny = 5; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_miny = this->_internal_miny(); - ::uint64_t raw_miny; - memcpy(&raw_miny, &tmp_miny, sizeof(tmp_miny)); - if (raw_miny != 0) { - total_size += 9; - } - - // double maxy = 6; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxy = this->_internal_maxy(); - ::uint64_t raw_maxy; - memcpy(&raw_maxy, &tmp_maxy, sizeof(tmp_maxy)); - if (raw_maxy != 0) { - total_size += 9; - } - - // double minz = 7; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minz = this->_internal_minz(); - ::uint64_t raw_minz; - memcpy(&raw_minz, &tmp_minz, sizeof(tmp_minz)); - if (raw_minz != 0) { - total_size += 9; - } - - // double maxz = 8; - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxz = this->_internal_maxz(); - ::uint64_t raw_maxz; - memcpy(&raw_maxz, &tmp_maxz, sizeof(tmp_maxz)); - if (raw_maxz != 0) { - total_size += 9; - } - - // int32 slice_id = 9; - if (this->_internal_slice_id() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( - this->_internal_slice_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TreeNode::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - TreeNode::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TreeNode::GetClassData() const { return &_class_data_; } - - -void TreeNode::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:TreeNode) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_level() != 0) { - _this->_internal_set_level(from._internal_level()); - } - if (from._internal_childsize() != 0) { - _this->_internal_set_childsize(from._internal_childsize()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minx = from._internal_minx(); - ::uint64_t raw_minx; - memcpy(&raw_minx, &tmp_minx, sizeof(tmp_minx)); - if (raw_minx != 0) { - _this->_internal_set_minx(from._internal_minx()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxx = from._internal_maxx(); - ::uint64_t raw_maxx; - memcpy(&raw_maxx, &tmp_maxx, sizeof(tmp_maxx)); - if (raw_maxx != 0) { - _this->_internal_set_maxx(from._internal_maxx()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_miny = from._internal_miny(); - ::uint64_t raw_miny; - memcpy(&raw_miny, &tmp_miny, sizeof(tmp_miny)); - if (raw_miny != 0) { - _this->_internal_set_miny(from._internal_miny()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxy = from._internal_maxy(); - ::uint64_t raw_maxy; - memcpy(&raw_maxy, &tmp_maxy, sizeof(tmp_maxy)); - if (raw_maxy != 0) { - _this->_internal_set_maxy(from._internal_maxy()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_minz = from._internal_minz(); - ::uint64_t raw_minz; - memcpy(&raw_minz, &tmp_minz, sizeof(tmp_minz)); - if (raw_minz != 0) { - _this->_internal_set_minz(from._internal_minz()); - } - static_assert(sizeof(::uint64_t) == sizeof(double), "Code assumes ::uint64_t and double are the same size."); - double tmp_maxz = from._internal_maxz(); - ::uint64_t raw_maxz; - memcpy(&raw_maxz, &tmp_maxz, sizeof(tmp_maxz)); - if (raw_maxz != 0) { - _this->_internal_set_maxz(from._internal_maxz()); - } - if (from._internal_slice_id() != 0) { - _this->_internal_set_slice_id(from._internal_slice_id()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void TreeNode::CopyFrom(const TreeNode& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:TreeNode) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool TreeNode::IsInitialized() const { - return true; -} - -void TreeNode::InternalSwap(TreeNode* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(TreeNode, _impl_.slice_id_) - + sizeof(TreeNode::_impl_.slice_id_) - - PROTOBUF_FIELD_OFFSET(TreeNode, _impl_.level_)>( - reinterpret_cast(&_impl_.level_), - reinterpret_cast(&other->_impl_.level_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata TreeNode::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_treeNode_2eproto_getter, &descriptor_table_treeNode_2eproto_once, - file_level_metadata_treeNode_2eproto[0]); -} -// =================================================================== - -class Tree::_Internal { - public: -}; - -Tree::Tree(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:Tree) -} -Tree::Tree(const Tree& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Tree* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.treenodes_){from._impl_.treenodes_} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:Tree) -} - -inline void Tree::SharedCtor(::_pb::Arena* arena) { - (void)arena; - new (&_impl_) Impl_{ - decltype(_impl_.treenodes_){arena} - , /*decltype(_impl_._cached_size_)*/{} - }; -} - -Tree::~Tree() { - // @@protoc_insertion_point(destructor:Tree) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void Tree::SharedDtor() { - ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.treenodes_.~RepeatedPtrField(); -} - -void Tree::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Tree::Clear() { -// @@protoc_insertion_point(message_clear_start:Tree) - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.treenodes_.Clear(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Tree::_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 .TreeNode treeNodes = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_treenodes(), 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* Tree::_InternalSerialize( - ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:Tree) - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .TreeNode treeNodes = 1; - for (unsigned i = 0, - n = static_cast(this->_internal_treenodes_size()); i < n; i++) { - const auto& repfield = this->_internal_treenodes(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); - } - - 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:Tree) - return target; -} - -::size_t Tree::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:Tree) - ::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 .TreeNode treeNodes = 1; - total_size += 1UL * this->_internal_treenodes_size(); - for (const auto& msg : this->_impl_.treenodes_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Tree::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Tree::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Tree::GetClassData() const { return &_class_data_; } - - -void Tree::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:Tree) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_impl_.treenodes_.MergeFrom(from._impl_.treenodes_); - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Tree::CopyFrom(const Tree& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:Tree) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Tree::IsInitialized() const { - return true; -} - -void Tree::InternalSwap(Tree* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.treenodes_.InternalSwap(&other->_impl_.treenodes_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Tree::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_treeNode_2eproto_getter, &descriptor_table_treeNode_2eproto_once, - file_level_metadata_treeNode_2eproto[1]); -} -// @@protoc_insertion_point(namespace_scope) -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::TreeNode* -Arena::CreateMaybeMessage< ::TreeNode >(Arena* arena) { - return Arena::CreateMessageInternal< ::TreeNode >(arena); -} -template<> PROTOBUF_NOINLINE ::Tree* -Arena::CreateMaybeMessage< ::Tree >(Arena* arena) { - return Arena::CreateMessageInternal< ::Tree >(arena); -} -PROTOBUF_NAMESPACE_CLOSE -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/tests/unit/index/strtree/treeNode.pb.h b/tests/unit/index/strtree/treeNode.pb.h deleted file mode 100644 index 86bcd5510..000000000 --- a/tests/unit/index/strtree/treeNode.pb.h +++ /dev/null @@ -1,721 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: treeNode.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_treeNode_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_treeNode_2eproto_2epb_2eh - -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4022000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4022000 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/unknown_field_set.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_treeNode_2eproto - -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_treeNode_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable - descriptor_table_treeNode_2eproto; -class Tree; -struct TreeDefaultTypeInternal; -extern TreeDefaultTypeInternal _Tree_default_instance_; -class TreeNode; -struct TreeNodeDefaultTypeInternal; -extern TreeNodeDefaultTypeInternal _TreeNode_default_instance_; -PROTOBUF_NAMESPACE_OPEN -template <> -::Tree* Arena::CreateMaybeMessage<::Tree>(Arena*); -template <> -::TreeNode* Arena::CreateMaybeMessage<::TreeNode>(Arena*); -PROTOBUF_NAMESPACE_CLOSE - - -// =================================================================== - - -// ------------------------------------------------------------------- - -class TreeNode final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:TreeNode) */ { - public: - inline TreeNode() : TreeNode(nullptr) {} - ~TreeNode() override; - explicit PROTOBUF_CONSTEXPR TreeNode(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - TreeNode(const TreeNode& from); - TreeNode(TreeNode&& from) noexcept - : TreeNode() { - *this = ::std::move(from); - } - - inline TreeNode& operator=(const TreeNode& from) { - CopyFrom(from); - return *this; - } - inline TreeNode& operator=(TreeNode&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const TreeNode& default_instance() { - return *internal_default_instance(); - } - static inline const TreeNode* internal_default_instance() { - return reinterpret_cast( - &_TreeNode_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(TreeNode& a, TreeNode& b) { - a.Swap(&b); - } - inline void Swap(TreeNode* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(TreeNode* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - TreeNode* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const TreeNode& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const TreeNode& from) { - TreeNode::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(TreeNode* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "TreeNode"; - } - protected: - explicit TreeNode(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kLevelFieldNumber = 1, - kChildSizeFieldNumber = 2, - kMinxFieldNumber = 3, - kMaxxFieldNumber = 4, - kMinyFieldNumber = 5, - kMaxyFieldNumber = 6, - kMinzFieldNumber = 7, - kMaxzFieldNumber = 8, - kSliceIdFieldNumber = 9, - }; - // int32 level = 1; - void clear_level() ; - ::int32_t level() const; - void set_level(::int32_t value); - - private: - ::int32_t _internal_level() const; - void _internal_set_level(::int32_t value); - - public: - // int32 childSize = 2; - void clear_childsize() ; - ::int32_t childsize() const; - void set_childsize(::int32_t value); - - private: - ::int32_t _internal_childsize() const; - void _internal_set_childsize(::int32_t value); - - public: - // double minx = 3; - void clear_minx() ; - double minx() const; - void set_minx(double value); - - private: - double _internal_minx() const; - void _internal_set_minx(double value); - - public: - // double maxx = 4; - void clear_maxx() ; - double maxx() const; - void set_maxx(double value); - - private: - double _internal_maxx() const; - void _internal_set_maxx(double value); - - public: - // double miny = 5; - void clear_miny() ; - double miny() const; - void set_miny(double value); - - private: - double _internal_miny() const; - void _internal_set_miny(double value); - - public: - // double maxy = 6; - void clear_maxy() ; - double maxy() const; - void set_maxy(double value); - - private: - double _internal_maxy() const; - void _internal_set_maxy(double value); - - public: - // double minz = 7; - void clear_minz() ; - double minz() const; - void set_minz(double value); - - private: - double _internal_minz() const; - void _internal_set_minz(double value); - - public: - // double maxz = 8; - void clear_maxz() ; - double maxz() const; - void set_maxz(double value); - - private: - double _internal_maxz() const; - void _internal_set_maxz(double value); - - public: - // int32 slice_id = 9; - void clear_slice_id() ; - ::int32_t slice_id() const; - void set_slice_id(::int32_t value); - - private: - ::int32_t _internal_slice_id() const; - void _internal_set_slice_id(::int32_t value); - - public: - // @@protoc_insertion_point(class_scope:TreeNode) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::int32_t level_; - ::int32_t childsize_; - double minx_; - double maxx_; - double miny_; - double maxy_; - double minz_; - double maxz_; - ::int32_t slice_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_treeNode_2eproto; -};// ------------------------------------------------------------------- - -class Tree final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Tree) */ { - public: - inline Tree() : Tree(nullptr) {} - ~Tree() override; - explicit PROTOBUF_CONSTEXPR Tree(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Tree(const Tree& from); - Tree(Tree&& from) noexcept - : Tree() { - *this = ::std::move(from); - } - - inline Tree& operator=(const Tree& from) { - CopyFrom(from); - return *this; - } - inline Tree& operator=(Tree&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Tree& default_instance() { - return *internal_default_instance(); - } - static inline const Tree* internal_default_instance() { - return reinterpret_cast( - &_Tree_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Tree& a, Tree& b) { - a.Swap(&b); - } - inline void Swap(Tree* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Tree* other) { - if (other == this) return; - ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Tree* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Tree& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Tree& from) { - Tree::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Tree* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "Tree"; - } - protected: - explicit Tree(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kTreeNodesFieldNumber = 1, - }; - // repeated .TreeNode treeNodes = 1; - int treenodes_size() const; - private: - int _internal_treenodes_size() const; - - public: - void clear_treenodes() ; - ::TreeNode* mutable_treenodes(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::TreeNode >* - mutable_treenodes(); - private: - const ::TreeNode& _internal_treenodes(int index) const; - ::TreeNode* _internal_add_treenodes(); - public: - const ::TreeNode& treenodes(int index) const; - ::TreeNode* add_treenodes(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::TreeNode >& - treenodes() const; - // @@protoc_insertion_point(class_scope:Tree) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::TreeNode > treenodes_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_treeNode_2eproto; -}; - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// TreeNode - -// int32 level = 1; -inline void TreeNode::clear_level() { - _impl_.level_ = 0; -} -inline ::int32_t TreeNode::level() const { - // @@protoc_insertion_point(field_get:TreeNode.level) - return _internal_level(); -} -inline void TreeNode::set_level(::int32_t value) { - _internal_set_level(value); - // @@protoc_insertion_point(field_set:TreeNode.level) -} -inline ::int32_t TreeNode::_internal_level() const { - return _impl_.level_; -} -inline void TreeNode::_internal_set_level(::int32_t value) { - ; - _impl_.level_ = value; -} - -// int32 childSize = 2; -inline void TreeNode::clear_childsize() { - _impl_.childsize_ = 0; -} -inline ::int32_t TreeNode::childsize() const { - // @@protoc_insertion_point(field_get:TreeNode.childSize) - return _internal_childsize(); -} -inline void TreeNode::set_childsize(::int32_t value) { - _internal_set_childsize(value); - // @@protoc_insertion_point(field_set:TreeNode.childSize) -} -inline ::int32_t TreeNode::_internal_childsize() const { - return _impl_.childsize_; -} -inline void TreeNode::_internal_set_childsize(::int32_t value) { - ; - _impl_.childsize_ = value; -} - -// double minx = 3; -inline void TreeNode::clear_minx() { - _impl_.minx_ = 0; -} -inline double TreeNode::minx() const { - // @@protoc_insertion_point(field_get:TreeNode.minx) - return _internal_minx(); -} -inline void TreeNode::set_minx(double value) { - _internal_set_minx(value); - // @@protoc_insertion_point(field_set:TreeNode.minx) -} -inline double TreeNode::_internal_minx() const { - return _impl_.minx_; -} -inline void TreeNode::_internal_set_minx(double value) { - ; - _impl_.minx_ = value; -} - -// double maxx = 4; -inline void TreeNode::clear_maxx() { - _impl_.maxx_ = 0; -} -inline double TreeNode::maxx() const { - // @@protoc_insertion_point(field_get:TreeNode.maxx) - return _internal_maxx(); -} -inline void TreeNode::set_maxx(double value) { - _internal_set_maxx(value); - // @@protoc_insertion_point(field_set:TreeNode.maxx) -} -inline double TreeNode::_internal_maxx() const { - return _impl_.maxx_; -} -inline void TreeNode::_internal_set_maxx(double value) { - ; - _impl_.maxx_ = value; -} - -// double miny = 5; -inline void TreeNode::clear_miny() { - _impl_.miny_ = 0; -} -inline double TreeNode::miny() const { - // @@protoc_insertion_point(field_get:TreeNode.miny) - return _internal_miny(); -} -inline void TreeNode::set_miny(double value) { - _internal_set_miny(value); - // @@protoc_insertion_point(field_set:TreeNode.miny) -} -inline double TreeNode::_internal_miny() const { - return _impl_.miny_; -} -inline void TreeNode::_internal_set_miny(double value) { - ; - _impl_.miny_ = value; -} - -// double maxy = 6; -inline void TreeNode::clear_maxy() { - _impl_.maxy_ = 0; -} -inline double TreeNode::maxy() const { - // @@protoc_insertion_point(field_get:TreeNode.maxy) - return _internal_maxy(); -} -inline void TreeNode::set_maxy(double value) { - _internal_set_maxy(value); - // @@protoc_insertion_point(field_set:TreeNode.maxy) -} -inline double TreeNode::_internal_maxy() const { - return _impl_.maxy_; -} -inline void TreeNode::_internal_set_maxy(double value) { - ; - _impl_.maxy_ = value; -} - -// double minz = 7; -inline void TreeNode::clear_minz() { - _impl_.minz_ = 0; -} -inline double TreeNode::minz() const { - // @@protoc_insertion_point(field_get:TreeNode.minz) - return _internal_minz(); -} -inline void TreeNode::set_minz(double value) { - _internal_set_minz(value); - // @@protoc_insertion_point(field_set:TreeNode.minz) -} -inline double TreeNode::_internal_minz() const { - return _impl_.minz_; -} -inline void TreeNode::_internal_set_minz(double value) { - ; - _impl_.minz_ = value; -} - -// double maxz = 8; -inline void TreeNode::clear_maxz() { - _impl_.maxz_ = 0; -} -inline double TreeNode::maxz() const { - // @@protoc_insertion_point(field_get:TreeNode.maxz) - return _internal_maxz(); -} -inline void TreeNode::set_maxz(double value) { - _internal_set_maxz(value); - // @@protoc_insertion_point(field_set:TreeNode.maxz) -} -inline double TreeNode::_internal_maxz() const { - return _impl_.maxz_; -} -inline void TreeNode::_internal_set_maxz(double value) { - ; - _impl_.maxz_ = value; -} - -// int32 slice_id = 9; -inline void TreeNode::clear_slice_id() { - _impl_.slice_id_ = 0; -} -inline ::int32_t TreeNode::slice_id() const { - // @@protoc_insertion_point(field_get:TreeNode.slice_id) - return _internal_slice_id(); -} -inline void TreeNode::set_slice_id(::int32_t value) { - _internal_set_slice_id(value); - // @@protoc_insertion_point(field_set:TreeNode.slice_id) -} -inline ::int32_t TreeNode::_internal_slice_id() const { - return _impl_.slice_id_; -} -inline void TreeNode::_internal_set_slice_id(::int32_t value) { - ; - _impl_.slice_id_ = value; -} - -// ------------------------------------------------------------------- - -// Tree - -// repeated .TreeNode treeNodes = 1; -inline int Tree::_internal_treenodes_size() const { - return _impl_.treenodes_.size(); -} -inline int Tree::treenodes_size() const { - return _internal_treenodes_size(); -} -inline void Tree::clear_treenodes() { - _impl_.treenodes_.Clear(); -} -inline ::TreeNode* Tree::mutable_treenodes(int index) { - // @@protoc_insertion_point(field_mutable:Tree.treeNodes) - return _impl_.treenodes_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::TreeNode >* -Tree::mutable_treenodes() { - // @@protoc_insertion_point(field_mutable_list:Tree.treeNodes) - return &_impl_.treenodes_; -} -inline const ::TreeNode& Tree::_internal_treenodes(int index) const { - return _impl_.treenodes_.Get(index); -} -inline const ::TreeNode& Tree::treenodes(int index) const { - // @@protoc_insertion_point(field_get:Tree.treeNodes) - return _internal_treenodes(index); -} -inline ::TreeNode* Tree::_internal_add_treenodes() { - return _impl_.treenodes_.Add(); -} -inline ::TreeNode* Tree::add_treenodes() { - ::TreeNode* _add = _internal_add_treenodes(); - // @@protoc_insertion_point(field_add:Tree.treeNodes) - return _add; -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::TreeNode >& -Tree::treenodes() const { - // @@protoc_insertion_point(field_list:Tree.treeNodes) - return _impl_.treenodes_; -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) - - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_treeNode_2eproto_2epb_2eh diff --git a/third_party/protobuf b/third_party/protobuf deleted file mode 160000 index a847a8dc4..000000000 --- a/third_party/protobuf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a847a8dc4ba1d99e7ba917146c84438b4de7d085