From d139fa5a1184991f0a5328086fa44449b2065bf7 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 19 Oct 2023 10:01:19 +0200 Subject: [PATCH] fix cpp orphan opt out check --- crates/re_types_builder/src/lib.rs | 2 +- rerun_cpp/src/rerun/datatypes/u_int32.cpp | 47 -------------------- rerun_cpp/src/rerun/datatypes/u_int32.hpp | 52 ----------------------- 3 files changed, 1 insertion(+), 100 deletions(-) delete mode 100644 rerun_cpp/src/rerun/datatypes/u_int32.cpp delete mode 100644 rerun_cpp/src/rerun/datatypes/u_int32.hpp diff --git a/crates/re_types_builder/src/lib.rs b/crates/re_types_builder/src/lib.rs index 7bc418fe9dd2..68a7b71eba87 100644 --- a/crates/re_types_builder/src/lib.rs +++ b/crates/re_types_builder/src/lib.rs @@ -408,7 +408,7 @@ pub fn generate_cpp_code( // Make sure to filter out that directory, or else we will end up removing those handwritten // files. let root_src = output_path.as_ref().join("src/rerun"); - files.retain(|filepath, _| !filepath.starts_with(&root_src)); + files.retain(|filepath, _| filepath.parent() != Some(root_src.as_path())); crate::codegen::common::remove_orphaned_files(reporter, &files); fn format_code(code: &str) -> String { diff --git a/rerun_cpp/src/rerun/datatypes/u_int32.cpp b/rerun_cpp/src/rerun/datatypes/u_int32.cpp deleted file mode 100644 index f931f3e2ac79..000000000000 --- a/rerun_cpp/src/rerun/datatypes/u_int32.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/datatypes/uint32.fbs". - -#include "u_int32.hpp" - -#include -#include - -namespace rerun { - namespace datatypes { - const std::shared_ptr& UInt32::arrow_datatype() { - static const auto datatype = arrow::uint32(); - return datatype; - } - - Result> UInt32::new_arrow_array_builder( - arrow::MemoryPool* memory_pool - ) { - if (memory_pool == nullptr) { - return Error(ErrorCode::UnexpectedNullArgument, "Memory pool is null."); - } - - return Result(std::make_shared(memory_pool)); - } - - Error UInt32::fill_arrow_array_builder( - arrow::UInt32Builder* builder, const UInt32* elements, size_t num_elements - ) { - if (builder == nullptr) { - return Error(ErrorCode::UnexpectedNullArgument, "Passed array builder is null."); - } - if (elements == nullptr) { - return Error( - ErrorCode::UnexpectedNullArgument, - "Cannot serialize null pointer to arrow array." - ); - } - - static_assert(sizeof(*elements) == sizeof(elements->value)); - ARROW_RETURN_NOT_OK( - builder->AppendValues(&elements->value, static_cast(num_elements)) - ); - - return Error::ok(); - } - } // namespace datatypes -} // namespace rerun diff --git a/rerun_cpp/src/rerun/datatypes/u_int32.hpp b/rerun_cpp/src/rerun/datatypes/u_int32.hpp deleted file mode 100644 index 42aae277aee6..000000000000 --- a/rerun_cpp/src/rerun/datatypes/u_int32.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/datatypes/uint32.fbs". - -#pragma once - -#include "../result.hpp" - -#include -#include -#include - -namespace arrow { - template - class NumericBuilder; - - class DataType; - class MemoryPool; - class UInt32Type; - using UInt32Builder = NumericBuilder; -} // namespace arrow - -namespace rerun { - namespace datatypes { - /// **Datatype**: A 32bit integer. - struct UInt32 { - uint32_t value; - - public: - UInt32() = default; - - UInt32(uint32_t _value) : value(std::move(_value)) {} - - UInt32& operator=(uint32_t _value) { - value = std::move(_value); - return *this; - } - - /// Returns the arrow data type this type corresponds to. - static const std::shared_ptr& arrow_datatype(); - - /// Creates a new array builder with an array of this type. - static Result> new_arrow_array_builder( - arrow::MemoryPool* memory_pool - ); - - /// Fills an arrow array builder with an array of this type. - static Error fill_arrow_array_builder( - arrow::UInt32Builder* builder, const UInt32* elements, size_t num_elements - ); - }; - } // namespace datatypes -} // namespace rerun