From 18e2475716f8e180549fcccb112af8b33ca1fa4d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 13 Jul 2023 17:28:45 +0200 Subject: [PATCH] C++ codegen (#2678) Part of: * #2647 ### What Adds minimal code-gen for C++. It generates a `.hpp/.cpp` pair for each type, plus a module file each for datatypes, components, and archetypes. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2678) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2678) - [Docs preview](https://rerun.io/preview/pr%3Aemilk%2Fcpp-codegen/docs) - [Examples preview](https://rerun.io/preview/pr%3Aemilk%2Fcpp-codegen/examples) --------- Co-authored-by: Andreas Reich --- .gitignore | 8 +- .vscode/extensions.json | 5 +- CMakeLists.txt | 6 + Cargo.lock | 19 ++ crates/re_types/Cargo.toml | 1 + crates/re_types/build.rs | 43 +++-- crates/re_types/source_hash.txt | 2 +- crates/re_types_builder/Cargo.toml | 3 + crates/re_types_builder/src/codegen/cpp.rs | 175 ++++++++++++++++++ crates/re_types_builder/src/codegen/mod.rs | 2 + crates/re_types_builder/src/codegen/python.rs | 10 +- crates/re_types_builder/src/codegen/rust.rs | 48 +++-- crates/re_types_builder/src/lib.rs | 29 ++- crates/re_types_builder/src/objects.rs | 49 +++++ crates/rerun_c/run_examples.sh | 7 - examples/c/README.md | 1 + .../example => examples/c/minimal}/.gitignore | 0 .../example => examples/c/minimal}/Makefile | 2 +- .../example => examples/c/minimal}/README.md | 0 .../example => examples/c/minimal}/main.c | 0 examples/cpp/README.md | 1 + .../cpp/minimal}/CMakeLists.txt | 2 +- examples/cpp/minimal/README.md | 5 + .../cpp/minimal}/build_and_run.sh | 8 +- .../example => examples/cpp/minimal}/main.cpp | 4 - rerun_cpp/CMakeLists.txt | 71 ++++++- rerun_cpp/README.md | 2 +- rerun_cpp/example/README.md | 5 - rerun_cpp/src/CMakeLists.txt | 67 ------- rerun_cpp/src/archetypes.hpp | 7 + rerun_cpp/src/archetypes/affix_fuzzer1.cpp | 4 + rerun_cpp/src/archetypes/affix_fuzzer1.hpp | 10 + rerun_cpp/src/archetypes/points2d.cpp | 4 + rerun_cpp/src/archetypes/points2d.hpp | 10 + rerun_cpp/src/archetypes/transform3d.cpp | 4 + rerun_cpp/src/archetypes/transform3d.hpp | 10 + rerun_cpp/src/components.hpp | 31 ++++ rerun_cpp/src/components/affix_fuzzer1.cpp | 4 + rerun_cpp/src/components/affix_fuzzer1.hpp | 10 + rerun_cpp/src/components/affix_fuzzer10.cpp | 4 + rerun_cpp/src/components/affix_fuzzer10.hpp | 10 + rerun_cpp/src/components/affix_fuzzer11.cpp | 4 + rerun_cpp/src/components/affix_fuzzer11.hpp | 10 + rerun_cpp/src/components/affix_fuzzer12.cpp | 4 + rerun_cpp/src/components/affix_fuzzer12.hpp | 10 + rerun_cpp/src/components/affix_fuzzer13.cpp | 4 + rerun_cpp/src/components/affix_fuzzer13.hpp | 10 + rerun_cpp/src/components/affix_fuzzer14.cpp | 4 + rerun_cpp/src/components/affix_fuzzer14.hpp | 10 + rerun_cpp/src/components/affix_fuzzer16.cpp | 4 + rerun_cpp/src/components/affix_fuzzer16.hpp | 10 + rerun_cpp/src/components/affix_fuzzer17.cpp | 4 + rerun_cpp/src/components/affix_fuzzer17.hpp | 10 + rerun_cpp/src/components/affix_fuzzer18.cpp | 4 + rerun_cpp/src/components/affix_fuzzer18.hpp | 10 + rerun_cpp/src/components/affix_fuzzer19.cpp | 4 + rerun_cpp/src/components/affix_fuzzer19.hpp | 10 + rerun_cpp/src/components/affix_fuzzer2.cpp | 4 + rerun_cpp/src/components/affix_fuzzer2.hpp | 10 + rerun_cpp/src/components/affix_fuzzer3.cpp | 4 + rerun_cpp/src/components/affix_fuzzer3.hpp | 10 + rerun_cpp/src/components/affix_fuzzer4.cpp | 4 + rerun_cpp/src/components/affix_fuzzer4.hpp | 10 + rerun_cpp/src/components/affix_fuzzer5.cpp | 4 + rerun_cpp/src/components/affix_fuzzer5.hpp | 10 + rerun_cpp/src/components/affix_fuzzer6.cpp | 4 + rerun_cpp/src/components/affix_fuzzer6.hpp | 10 + rerun_cpp/src/components/affix_fuzzer7.cpp | 4 + rerun_cpp/src/components/affix_fuzzer7.hpp | 10 + rerun_cpp/src/components/affix_fuzzer8.cpp | 4 + rerun_cpp/src/components/affix_fuzzer8.hpp | 10 + rerun_cpp/src/components/affix_fuzzer9.cpp | 4 + rerun_cpp/src/components/affix_fuzzer9.hpp | 10 + rerun_cpp/src/components/class_id.cpp | 4 + rerun_cpp/src/components/class_id.hpp | 10 + rerun_cpp/src/components/color.cpp | 4 + rerun_cpp/src/components/color.hpp | 10 + rerun_cpp/src/components/draw_order.cpp | 4 + rerun_cpp/src/components/draw_order.hpp | 10 + rerun_cpp/src/components/instance_key.cpp | 4 + rerun_cpp/src/components/instance_key.hpp | 10 + rerun_cpp/src/components/keypoint_id.cpp | 4 + rerun_cpp/src/components/keypoint_id.hpp | 10 + rerun_cpp/src/components/label.cpp | 4 + rerun_cpp/src/components/label.hpp | 10 + rerun_cpp/src/components/point2d.cpp | 4 + rerun_cpp/src/components/point2d.hpp | 10 + rerun_cpp/src/components/radius.cpp | 4 + rerun_cpp/src/components/radius.hpp | 10 + rerun_cpp/src/components/transform3d.cpp | 4 + rerun_cpp/src/components/transform3d.hpp | 10 + rerun_cpp/src/datatypes.hpp | 24 +++ rerun_cpp/src/datatypes/affix_fuzzer1.cpp | 4 + rerun_cpp/src/datatypes/affix_fuzzer1.hpp | 10 + rerun_cpp/src/datatypes/affix_fuzzer2.cpp | 4 + rerun_cpp/src/datatypes/affix_fuzzer2.hpp | 10 + rerun_cpp/src/datatypes/affix_fuzzer3.cpp | 4 + rerun_cpp/src/datatypes/affix_fuzzer3.hpp | 10 + rerun_cpp/src/datatypes/affix_fuzzer4.cpp | 4 + rerun_cpp/src/datatypes/affix_fuzzer4.hpp | 10 + rerun_cpp/src/datatypes/affix_fuzzer5.cpp | 4 + rerun_cpp/src/datatypes/affix_fuzzer5.hpp | 10 + rerun_cpp/src/datatypes/angle.cpp | 4 + rerun_cpp/src/datatypes/angle.hpp | 10 + rerun_cpp/src/datatypes/flattened_scalar.cpp | 4 + rerun_cpp/src/datatypes/flattened_scalar.hpp | 10 + rerun_cpp/src/datatypes/mat3x3.cpp | 4 + rerun_cpp/src/datatypes/mat3x3.hpp | 10 + rerun_cpp/src/datatypes/mat4x4.cpp | 4 + rerun_cpp/src/datatypes/mat4x4.hpp | 10 + rerun_cpp/src/datatypes/point2d.cpp | 4 + rerun_cpp/src/datatypes/point2d.hpp | 10 + rerun_cpp/src/datatypes/quaternion.cpp | 4 + rerun_cpp/src/datatypes/quaternion.hpp | 10 + rerun_cpp/src/datatypes/rotation3d.cpp | 4 + rerun_cpp/src/datatypes/rotation3d.hpp | 10 + .../src/datatypes/rotation_axis_angle.cpp | 4 + .../src/datatypes/rotation_axis_angle.hpp | 10 + rerun_cpp/src/datatypes/scale3d.cpp | 4 + rerun_cpp/src/datatypes/scale3d.hpp | 10 + rerun_cpp/src/datatypes/transform3d.cpp | 4 + rerun_cpp/src/datatypes/transform3d.hpp | 10 + .../src/datatypes/translation_and_mat3x3.cpp | 4 + .../src/datatypes/translation_and_mat3x3.hpp | 10 + .../translation_rotation_scale3d.cpp | 4 + .../translation_rotation_scale3d.hpp | 10 + rerun_cpp/src/datatypes/vec2d.cpp | 4 + rerun_cpp/src/datatypes/vec2d.hpp | 10 + rerun_cpp/src/datatypes/vec3d.cpp | 4 + rerun_cpp/src/datatypes/vec3d.hpp | 10 + rerun_cpp/src/datatypes/vec4d.cpp | 4 + rerun_cpp/src/datatypes/vec4d.hpp | 10 + rerun_cpp/src/rerun.hpp | 6 + scripts/setup_dev.sh | 2 +- 134 files changed, 1211 insertions(+), 134 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 crates/re_types_builder/src/codegen/cpp.rs delete mode 100755 crates/rerun_c/run_examples.sh create mode 100644 examples/c/README.md rename {crates/rerun_c/example => examples/c/minimal}/.gitignore (100%) rename {crates/rerun_c/example => examples/c/minimal}/Makefile (93%) rename {crates/rerun_c/example => examples/c/minimal}/README.md (100%) rename {crates/rerun_c/example => examples/c/minimal}/main.c (100%) create mode 100644 examples/cpp/README.md rename {rerun_cpp/example => examples/cpp/minimal}/CMakeLists.txt (88%) create mode 100644 examples/cpp/minimal/README.md rename {rerun_cpp => examples/cpp/minimal}/build_and_run.sh (53%) rename {rerun_cpp/example => examples/cpp/minimal}/main.cpp (94%) delete mode 100644 rerun_cpp/example/README.md delete mode 100644 rerun_cpp/src/CMakeLists.txt create mode 100644 rerun_cpp/src/archetypes.hpp create mode 100644 rerun_cpp/src/archetypes/affix_fuzzer1.cpp create mode 100644 rerun_cpp/src/archetypes/affix_fuzzer1.hpp create mode 100644 rerun_cpp/src/archetypes/points2d.cpp create mode 100644 rerun_cpp/src/archetypes/points2d.hpp create mode 100644 rerun_cpp/src/archetypes/transform3d.cpp create mode 100644 rerun_cpp/src/archetypes/transform3d.hpp create mode 100644 rerun_cpp/src/components.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer1.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer1.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer10.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer10.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer11.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer11.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer12.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer12.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer13.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer13.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer14.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer14.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer16.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer16.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer17.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer17.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer18.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer18.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer19.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer19.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer2.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer2.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer3.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer3.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer4.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer4.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer5.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer5.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer6.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer6.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer7.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer7.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer8.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer8.hpp create mode 100644 rerun_cpp/src/components/affix_fuzzer9.cpp create mode 100644 rerun_cpp/src/components/affix_fuzzer9.hpp create mode 100644 rerun_cpp/src/components/class_id.cpp create mode 100644 rerun_cpp/src/components/class_id.hpp create mode 100644 rerun_cpp/src/components/color.cpp create mode 100644 rerun_cpp/src/components/color.hpp create mode 100644 rerun_cpp/src/components/draw_order.cpp create mode 100644 rerun_cpp/src/components/draw_order.hpp create mode 100644 rerun_cpp/src/components/instance_key.cpp create mode 100644 rerun_cpp/src/components/instance_key.hpp create mode 100644 rerun_cpp/src/components/keypoint_id.cpp create mode 100644 rerun_cpp/src/components/keypoint_id.hpp create mode 100644 rerun_cpp/src/components/label.cpp create mode 100644 rerun_cpp/src/components/label.hpp create mode 100644 rerun_cpp/src/components/point2d.cpp create mode 100644 rerun_cpp/src/components/point2d.hpp create mode 100644 rerun_cpp/src/components/radius.cpp create mode 100644 rerun_cpp/src/components/radius.hpp create mode 100644 rerun_cpp/src/components/transform3d.cpp create mode 100644 rerun_cpp/src/components/transform3d.hpp create mode 100644 rerun_cpp/src/datatypes.hpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer1.cpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer1.hpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer2.cpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer2.hpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer3.cpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer3.hpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer4.cpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer4.hpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer5.cpp create mode 100644 rerun_cpp/src/datatypes/affix_fuzzer5.hpp create mode 100644 rerun_cpp/src/datatypes/angle.cpp create mode 100644 rerun_cpp/src/datatypes/angle.hpp create mode 100644 rerun_cpp/src/datatypes/flattened_scalar.cpp create mode 100644 rerun_cpp/src/datatypes/flattened_scalar.hpp create mode 100644 rerun_cpp/src/datatypes/mat3x3.cpp create mode 100644 rerun_cpp/src/datatypes/mat3x3.hpp create mode 100644 rerun_cpp/src/datatypes/mat4x4.cpp create mode 100644 rerun_cpp/src/datatypes/mat4x4.hpp create mode 100644 rerun_cpp/src/datatypes/point2d.cpp create mode 100644 rerun_cpp/src/datatypes/point2d.hpp create mode 100644 rerun_cpp/src/datatypes/quaternion.cpp create mode 100644 rerun_cpp/src/datatypes/quaternion.hpp create mode 100644 rerun_cpp/src/datatypes/rotation3d.cpp create mode 100644 rerun_cpp/src/datatypes/rotation3d.hpp create mode 100644 rerun_cpp/src/datatypes/rotation_axis_angle.cpp create mode 100644 rerun_cpp/src/datatypes/rotation_axis_angle.hpp create mode 100644 rerun_cpp/src/datatypes/scale3d.cpp create mode 100644 rerun_cpp/src/datatypes/scale3d.hpp create mode 100644 rerun_cpp/src/datatypes/transform3d.cpp create mode 100644 rerun_cpp/src/datatypes/transform3d.hpp create mode 100644 rerun_cpp/src/datatypes/translation_and_mat3x3.cpp create mode 100644 rerun_cpp/src/datatypes/translation_and_mat3x3.hpp create mode 100644 rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp create mode 100644 rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp create mode 100644 rerun_cpp/src/datatypes/vec2d.cpp create mode 100644 rerun_cpp/src/datatypes/vec2d.hpp create mode 100644 rerun_cpp/src/datatypes/vec3d.cpp create mode 100644 rerun_cpp/src/datatypes/vec3d.hpp create mode 100644 rerun_cpp/src/datatypes/vec4d.cpp create mode 100644 rerun_cpp/src/datatypes/vec4d.hpp diff --git a/.gitignore b/.gitignore index 2e5a0c07c1d8..3cbc2d380cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ .DS_Store # C++ and CMake stuff: -**/CMakeFiles/ +*.bin +*.o **/build/ +**/CMakeFiles/ +**/CMakeCache.txt +**/Makefile +**/cmake_install.cmake +_deps # Rust compile target directory: **/target diff --git a/.vscode/extensions.json b/.vscode/extensions.json index fbfebbbfbbd6..c70dfaf8f8c6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,10 @@ "charliermarsh.ruff", "gaborv.flatbuffers", "github.vscode-github-actions", + "josetr.cmake-language-support-vscode", "ms-python.python", + "ms-vscode.cmake-tools", + "ms-vscode.cpptools-extension-pack", "ms-vsliveshare.vsliveshare", "polymeilex.wgsl", "rust-lang.rust-analyzer", @@ -15,7 +18,7 @@ "vadimcn.vscode-lldb", "wayou.vscode-todo-highlight", "webfreak.debug", - "xaver.clang-format", // C++ formatter + "xaver.clang-format", // C++ formatter "zxh404.vscode-proto3", ] } diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..2cf3cd01cdca --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.16) + +project(rerun_cpp_proj LANGUAGES CXX) + +add_subdirectory(rerun_cpp) # The Rerun C++ SDK library +add_subdirectory(examples/cpp/minimal) diff --git a/Cargo.lock b/Cargo.lock index aef883418f89..44ae562e9e3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -792,6 +792,15 @@ dependencies = [ "half 1.8.2", ] +[[package]] +name = "clang-format" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6a49aa81aee4ac71d780395eb37788414b1fdb85033b52b5f13e80cd6b9f4a" +dependencies = [ + "once_cell", +] + [[package]] name = "clap" version = "4.3.0" @@ -4521,6 +4530,7 @@ dependencies = [ "glam", "itertools 0.11.0", "macaw", + "rayon", "re_build_tools", "re_types_builder", "similar-asserts", @@ -4535,13 +4545,16 @@ dependencies = [ "anyhow", "arrow2", "camino", + "clang-format", "convert_case", "flatbuffers", "indent", "itertools 0.11.0", "proc-macro2", "quote", + "rayon", "re_build_tools", + "rust-format", "syn 2.0.16", "unindent", "xshell", @@ -4973,6 +4986,12 @@ dependencies = [ "webbrowser", ] +[[package]] +name = "rust-format" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e7c00b6c3bf5e38a880eec01d7e829d12ca682079f8238a464def3c4b31627" + [[package]] name = "rustc-demangle" version = "0.1.23" diff --git a/crates/re_types/Cargo.toml b/crates/re_types/Cargo.toml index e3abc22738eb..38757582e846 100644 --- a/crates/re_types/Cargo.toml +++ b/crates/re_types/Cargo.toml @@ -62,4 +62,5 @@ re_build_tools.workspace = true re_types_builder.workspace = true # External +rayon.workspace = true xshell = "0.2" diff --git a/crates/re_types/build.rs b/crates/re_types/build.rs index 9474f9454160..97897f52916a 100644 --- a/crates/re_types/build.rs +++ b/crates/re_types/build.rs @@ -18,6 +18,7 @@ const SOURCE_HASH_PATH: &str = "./source_hash.txt"; const DEFINITIONS_DIR_PATH: &str = "./definitions"; const ENTRYPOINT_PATH: &str = "./definitions/rerun/archetypes.fbs"; const DOC_EXAMPLES_DIR_PATH: &str = "../../docs/code-examples"; +const CPP_OUTPUT_DIR_PATH: &str = "../../rerun_cpp/src"; const RUST_OUTPUT_DIR_PATH: &str = "."; const PYTHON_OUTPUT_DIR_PATH: &str = "../../rerun_py/rerun_sdk/rerun/_rerun2"; @@ -100,27 +101,24 @@ fn main() { panic!("re_types' fbs definitions and generated code are out-of-sync!"); } - let sh = Shell::new().unwrap(); - // passes 1 through 3: bfbs, semantic, arrow registry let (objects, arrow_registry) = re_types_builder::generate_lang_agnostic(DEFINITIONS_DIR_PATH, ENTRYPOINT_PATH); - re_types_builder::generate_rust_code(RUST_OUTPUT_DIR_PATH, &objects, &arrow_registry); - - // We need to run `cago fmt` several times because it is not idempotent! - // See https://github.com/rust-lang/rustfmt/issues/5824 - for _ in 0..2 { - // NOTE: We're purposefully ignoring the error here. - // - // In the very unlikely chance that the user doesn't have the `fmt` component installed, - // there's still no good reason to fail the build. - // - // The CI will catch the unformatted file at PR time and complain appropriately anyhow. - cmd!(sh, "cargo fmt -p re_types").run().ok(); - } + join3( + || re_types_builder::generate_cpp_code(CPP_OUTPUT_DIR_PATH, &objects, &arrow_registry), + || re_types_builder::generate_rust_code(RUST_OUTPUT_DIR_PATH, &objects, &arrow_registry), + || generate_and_format_python_code(&objects, &arrow_registry), + ); - re_types_builder::generate_python_code(PYTHON_OUTPUT_DIR_PATH, &objects, &arrow_registry); + write_versioning_hash(SOURCE_HASH_PATH, new_hash); +} + +fn generate_and_format_python_code( + objects: &re_types_builder::Objects, + arrow_registry: &re_types_builder::ArrowRegistry, +) { + re_types_builder::generate_python_code(PYTHON_OUTPUT_DIR_PATH, objects, arrow_registry); let pyproject_path = PathBuf::from(PYTHON_OUTPUT_DIR_PATH) .parent() @@ -133,6 +131,13 @@ fn main() { .to_string_lossy() .to_string(); + // TODO(emilk): format the python code _before_ writing them to file instead, + // just like we do with C++ and Rust. + // This should be doable py piping the code of each file to black/ruff via stdin. + // Why? Right now the python code is written once, then changed, which means + // it is in flux while building, which creates weird phantom git diffs for a few seconds, + // and also update the modified file stamps. + // NOTE: This requires both `black` and `ruff` to be in $PATH, but only for contributors, // not end users. // Even for contributors, `black` and `ruff` won't be needed unless they edit some of the @@ -146,11 +151,15 @@ fn main() { // 2) Call ruff, which requires line-lengths to be correct // 3) Call black again to cleanup some whitespace issues ruff might introduce + let sh = Shell::new().unwrap(); call_black(&sh, &pyproject_path); call_ruff(&sh, &pyproject_path); call_black(&sh, &pyproject_path); +} - write_versioning_hash(SOURCE_HASH_PATH, new_hash); +// Do 3 things in parallel +fn join3(a: impl FnOnce() + Send, b: impl FnOnce() + Send, c: impl FnOnce() + Send) { + rayon::join(a, || rayon::join(b, c)); } fn call_black(sh: &Shell, pyproject_path: &String) { diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index d0337024e624..83f10cf132d3 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -7b07a9ead58634313a05cbe4384f177af85241e46701dea4e14fa46ac85916a3 +48b1929d5cb17125eaae7733df116017fed8e27f5202d2365146e68e9a1a5b16 diff --git a/crates/re_types_builder/Cargo.toml b/crates/re_types_builder/Cargo.toml index d3886bd206db..77bb97ace330 100644 --- a/crates/re_types_builder/Cargo.toml +++ b/crates/re_types_builder/Cargo.toml @@ -23,12 +23,15 @@ all-features = true anyhow.workspace = true arrow2.workspace = true camino.workspace = true +clang-format = "0.1" convert_case = "0.6" flatbuffers = "23.0" indent = "0.1" itertools.workspace = true proc-macro2 = { version = "1.0", default-features = false } quote = "1.0" +rayon.workspace = true +rust-format = "0.3" syn = "2.0" unindent.workspace = true xshell = "0.2" diff --git a/crates/re_types_builder/src/codegen/cpp.rs b/crates/re_types_builder/src/codegen/cpp.rs new file mode 100644 index 000000000000..9d3e1c074bf5 --- /dev/null +++ b/crates/re_types_builder/src/codegen/cpp.rs @@ -0,0 +1,175 @@ +use std::collections::BTreeSet; + +use anyhow::Context as _; +use camino::{Utf8Path, Utf8PathBuf}; +use proc_macro2::TokenStream; +use quote::{format_ident, quote}; +use rayon::prelude::*; + +use crate::{codegen::AUTOGEN_WARNING, ArrowRegistry, ObjectKind, Objects}; + +const NEWLINE_TOKEN: &str = "RE_TOKEN_NEWLINE"; + +pub struct CppCodeGenerator { + output_path: Utf8PathBuf, +} + +impl CppCodeGenerator { + pub fn new(output_path: impl Into) -> Self { + Self { + output_path: output_path.into(), + } + } + + fn generate_folder( + &self, + objects: &Objects, + arrow_registry: &ArrowRegistry, + object_kind: ObjectKind, + folder_name: &str, + ) -> BTreeSet { + let folder_path = self.output_path.join(folder_name); + std::fs::create_dir_all(&folder_path) + .with_context(|| format!("{folder_path:?}")) + .unwrap(); + + let mut filepaths = BTreeSet::default(); + + // Generate folder contents: + let ordered_objects = objects.ordered_objects(object_kind.into()); + for &obj in &ordered_objects { + let filename = obj.snake_case_name(); + let (hpp, cpp) = generate_hpp_cpp(objects, arrow_registry, obj); + for (extension, tokens) in [("hpp", hpp), ("cpp", cpp)] { + let string = string_from_token_stream(&tokens, obj.relative_filepath()); + let filepath = folder_path.join(format!("{filename}.{extension}")); + write_file(&filepath, string); + let inserted = filepaths.insert(filepath); + assert!( + inserted, + "Multiple objects with the same name: {:?}", + obj.name + ); + } + } + + { + // Generate module file that includes all the headers: + let hash = quote! { # }; + let pragma_once = pragma_once(); + let header_file_names = ordered_objects + .iter() + .map(|obj| format!("{folder_name}/{}.hpp", obj.snake_case_name())); + let tokens = quote! { + #pragma_once + #(#hash include #header_file_names "RE_TOKEN_NEWLINE")* + }; + let filepath = folder_path + .parent() + .unwrap() + .join(format!("{folder_name}.hpp")); + let string = string_from_token_stream(&tokens, None); + write_file(&filepath, string); + filepaths.insert(filepath); + } + + // Clean up old files: + for entry in std::fs::read_dir(folder_path).unwrap().flatten() { + let filepath = Utf8PathBuf::try_from(entry.path()).unwrap(); + if !filepaths.contains(&filepath) { + std::fs::remove_file(filepath).ok(); + } + } + + filepaths + } +} + +impl crate::CodeGenerator for CppCodeGenerator { + fn generate( + &mut self, + objects: &Objects, + arrow_registry: &ArrowRegistry, + ) -> BTreeSet { + ObjectKind::ALL + .par_iter() + .map(|object_kind| { + let folder_name = object_kind.plural_snake_case(); + self.generate_folder(objects, arrow_registry, *object_kind, folder_name) + }) + .flatten() + .collect() + } +} + +fn string_from_token_stream(token_stream: &TokenStream, source_path: Option<&Utf8Path>) -> String { + let mut code = String::new(); + code.push_str(&format!("// {AUTOGEN_WARNING}\n")); + if let Some(source_path) = source_path { + code.push_str(&format!("// Based on {source_path:?}\n")); + } + + code.push('\n'); + code.push_str( + &token_stream + .to_string() + .replace(&format!("{NEWLINE_TOKEN:?}"), "\n"), + ); + code.push('\n'); + + // clang_format has a bit of an ugly API: https://github.com/KDAB/clang-format-rs/issues/3 + clang_format::CLANG_FORMAT_STYLE + .set(clang_format::ClangFormatStyle::File) + .ok(); + code = clang_format::clang_format(&code).expect("Failed to run clang-format"); + + code +} + +fn write_file(filepath: &Utf8PathBuf, code: String) { + if let Ok(existing) = std::fs::read_to_string(filepath) { + if existing == code { + // Don't touch the timestamp unnecessarily + return; + } + } + + std::fs::write(filepath, code) + .with_context(|| format!("{filepath}")) + .unwrap(); +} + +fn generate_hpp_cpp( + _objects: &Objects, + _arrow_registry: &ArrowRegistry, + obj: &crate::Object, +) -> (TokenStream, TokenStream) { + let obj_kind_ident = format_ident!("{}", obj.kind.plural_snake_case()); + + let pascal_case_name = &obj.name; + let pascal_case_ident = format_ident!("{pascal_case_name}"); + let snake_case_name = obj.snake_case_name(); + + let hash = quote! { # }; + let pragma_once = pragma_once(); + let header_file_name = format!("{snake_case_name}.hpp"); + + let hpp = quote! { + #pragma_once + namespace rr { + namespace #obj_kind_ident { + struct #pascal_case_ident { }; + } + } + }; + let cpp = quote! { #hash include #header_file_name }; + + (hpp, cpp) +} + +fn pragma_once() -> TokenStream { + let hash = quote! { # }; + quote! { + #hash pragma once #NEWLINE_TOKEN #NEWLINE_TOKEN + } +} diff --git a/crates/re_types_builder/src/codegen/mod.rs b/crates/re_types_builder/src/codegen/mod.rs index 0608ace21379..f46cb55ff185 100644 --- a/crates/re_types_builder/src/codegen/mod.rs +++ b/crates/re_types_builder/src/codegen/mod.rs @@ -20,8 +20,10 @@ pub const AUTOGEN_WARNING: &str = mod common; use self::common::{get_documentation, StringExt}; +mod cpp; mod python; mod rust; +pub use self::cpp::CppCodeGenerator; pub use self::python::PythonCodeGenerator; pub use self::rust::RustCodeGenerator; diff --git a/crates/re_types_builder/src/codegen/python.rs b/crates/re_types_builder/src/codegen/python.rs index 0e73c65e3aae..e79287432134 100644 --- a/crates/re_types_builder/src/codegen/python.rs +++ b/crates/re_types_builder/src/codegen/python.rs @@ -92,7 +92,7 @@ impl CodeGenerator for PythonCodeGenerator { ) -> BTreeSet { let mut filepaths = BTreeSet::new(); - let datatypes_path = self.pkg_path.join("datatypes"); + let datatypes_path = self.pkg_path.join(ObjectKind::Datatype.plural_snake_case()); let datatype_overrides = load_overrides(&datatypes_path); std::fs::create_dir_all(&datatypes_path) .with_context(|| format!("{datatypes_path:?}")) @@ -109,7 +109,9 @@ impl CodeGenerator for PythonCodeGenerator { .0, ); - let components_path = self.pkg_path.join("components"); + let components_path = self + .pkg_path + .join(ObjectKind::Component.plural_snake_case()); let component_overrides = load_overrides(&components_path); std::fs::create_dir_all(&components_path) .with_context(|| format!("{components_path:?}")) @@ -126,7 +128,9 @@ impl CodeGenerator for PythonCodeGenerator { .0, ); - let archetypes_path = self.pkg_path.join("archetypes"); + let archetypes_path = self + .pkg_path + .join(ObjectKind::Archetype.plural_snake_case()); let archetype_overrides = load_overrides(&archetypes_path); std::fs::create_dir_all(&archetypes_path) .with_context(|| format!("{archetypes_path:?}")) diff --git a/crates/re_types_builder/src/codegen/rust.rs b/crates/re_types_builder/src/codegen/rust.rs index bb7854bb36bf..21f5ec23b1d7 100644 --- a/crates/re_types_builder/src/codegen/rust.rs +++ b/crates/re_types_builder/src/codegen/rust.rs @@ -1,9 +1,6 @@ //! Implements the Rust codegen pass. -use std::{ - collections::{BTreeSet, HashMap}, - io::Write, -}; +use std::collections::{BTreeSet, HashMap}; use anyhow::Context as _; use arrow2::datatypes::DataType; @@ -119,11 +116,6 @@ fn create_files( .or_default() .extend(names); - filepaths.insert(filepath.clone()); - let mut file = std::fs::File::create(&filepath) - .with_context(|| format!("{filepath:?}")) - .unwrap(); - let mut code = String::new(); #[rustfmt::skip] { @@ -184,9 +176,8 @@ fn create_files( code = replace_doc_attrb_with_doc_comment(&code); - file.write_all(code.as_bytes()) - .with_context(|| format!("{filepath:?}")) - .unwrap(); + write_file(&filepath, code); + filepaths.insert(filepath.clone()); } // src/{datatypes|components|archetypes}/mod.rs @@ -217,14 +208,41 @@ fn create_files( } filepaths.insert(path.clone()); - std::fs::write(&path, code) - .with_context(|| format!("{path:?}")) - .unwrap(); + write_file(&path, code); } filepaths } +fn write_file(filepath: &Utf8PathBuf, mut code: String) { + // We need to run `cago fmt` several times because it is not idempotent! + // See https://github.com/rust-lang/rustfmt/issues/5824 + for _ in 0..2 { + // NOTE: We're purposefully ignoring the error here. + // + // In the very unlikely chance that the user doesn't have the `fmt` component installed, + // there's still no good reason to fail the build. + // + // The CI will catch the unformatted file at PR time and complain appropriately anyhow. + + use rust_format::Formatter as _; + if let Ok(formatted) = rust_format::RustFmt::default().format_str(&code) { + code = formatted; + } + } + + if let Ok(existing) = std::fs::read_to_string(filepath) { + if existing == code { + // Don't touch the timestamp unnecessarily + return; + } + } + + std::fs::write(filepath, code) + .with_context(|| format!("{filepath}")) + .unwrap(); +} + /// Replace `#[doc = "…"]` attributes with `/// …` doc comments, /// while also removing trailing whitespace. fn replace_doc_attrb_with_doc_comment(code: &String) -> String { diff --git a/crates/re_types_builder/src/lib.rs b/crates/re_types_builder/src/lib.rs index c4b509d9e1d7..055308e00fa2 100644 --- a/crates/re_types_builder/src/lib.rs +++ b/crates/re_types_builder/src/lib.rs @@ -131,7 +131,7 @@ mod codegen; mod objects; pub use self::arrow_registry::{ArrowRegistry, LazyDatatype, LazyField}; -pub use self::codegen::{CodeGenerator, PythonCodeGenerator, RustCodeGenerator}; +pub use self::codegen::{CodeGenerator, CppCodeGenerator, PythonCodeGenerator, RustCodeGenerator}; pub use self::objects::{ Attributes, Docs, ElementType, Object, ObjectField, ObjectKind, Objects, Type, }; @@ -252,6 +252,33 @@ pub fn generate_lang_agnostic( (objects, arrow_registry) } +/// Generates C++ code. +/// +/// Panics on error. +/// +/// - `output_path`: path to the root of the output. +/// +/// E.g.: +/// ```no_run +/// let (objects, arrow_registry) = re_types_builder::generate_lang_agnostic( +/// "./definitions", +/// "./definitions/rerun/archetypes.fbs", +/// ); +/// re_types_builder::generate_cpp_code( +/// ".", +/// &objects, +/// &arrow_registry, +/// ); +/// ``` +pub fn generate_cpp_code( + output_path: impl AsRef, + objects: &Objects, + arrow_registry: &ArrowRegistry, +) { + let mut gen = CppCodeGenerator::new(output_path.as_ref()); + let _filepaths = gen.generate(objects, arrow_registry); +} + /// Generates Rust code. /// /// Panics on error. diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index e9be98b443f6..feb73f69b116 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -207,6 +207,8 @@ pub enum ObjectKind { } impl ObjectKind { + pub const ALL: [Self; 3] = [Self::Datatype, Self::Component, Self::Archetype]; + // TODO(#2364): use an attr instead of the path pub fn from_pkg_name(pkg_name: impl AsRef) -> Self { let pkg_name = pkg_name.as_ref().replace(".testing", ""); @@ -220,6 +222,14 @@ impl ObjectKind { panic!("unknown package {pkg_name:?}"); } } + + pub fn plural_snake_case(&self) -> &'static str { + match self { + ObjectKind::Datatype => "datatypes", + ObjectKind::Component => "components", + ObjectKind::Archetype => "archetypes", + } + } } /// A high-level representation of a flatbuffers object's documentation. @@ -596,6 +606,45 @@ impl Object { .try_get::(&self.fqname, crate::ATTR_TRANSPARENT) .is_some() } + + /// Try to find the relative file path of the `.fbs` source file. + pub fn relative_filepath(&self) -> Option<&Utf8Path> { + std::env::var("CARGO_MANIFEST_DIR") + .ok() + .and_then(|manifest_dir| self.filepath.strip_prefix(manifest_dir).ok()) + } + + /// The `snake_case` name of the object, e.g. `translation_and_mat3x3`. + pub fn snake_case_name(&self) -> String { + to_snake_case(&self.name) + } +} + +fn to_snake_case(s: &str) -> String { + // Other crates (convert_case, case, heck, …) all get this wrong. See unit test. + let mut last_char: Option = None; + + let mut out = String::new(); + for c in s.chars() { + if let Some(last_char) = last_char { + if last_char.is_lowercase() && c.is_uppercase() { + out.push('_'); + } + } + out.push(c.to_ascii_lowercase()); + last_char = Some(c); + } + + out +} + +#[test] +fn test_snake_case() { + assert_eq!(to_snake_case("Point2D"), "point2d"); + assert_eq!( + to_snake_case("TranslationAndMat3x3"), + "translation_and_mat3x3" + ); } /// Properties specific to either structs or unions, but not both. diff --git a/crates/rerun_c/run_examples.sh b/crates/rerun_c/run_examples.sh deleted file mode 100755 index e4a3770cf04c..000000000000 --- a/crates/rerun_c/run_examples.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -eu -script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -set -x - -(cd "$script_path/example" && make run) diff --git a/examples/c/README.md b/examples/c/README.md new file mode 100644 index 000000000000..1bacc94d5a08 --- /dev/null +++ b/examples/c/README.md @@ -0,0 +1 @@ +The Rerun C SDK is in its infancy, and not ready for production. diff --git a/crates/rerun_c/example/.gitignore b/examples/c/minimal/.gitignore similarity index 100% rename from crates/rerun_c/example/.gitignore rename to examples/c/minimal/.gitignore diff --git a/crates/rerun_c/example/Makefile b/examples/c/minimal/Makefile similarity index 93% rename from crates/rerun_c/example/Makefile rename to examples/c/minimal/Makefile index 4e00643d109e..4b10ddf20e6b 100644 --- a/crates/rerun_c/example/Makefile +++ b/examples/c/minimal/Makefile @@ -1,7 +1,7 @@ CC = gcc CFLAGS = --std=c99 -O2 -g -DNDEBUG CFLAGS += -Wall -Wextra -Wpedantic -Wcast-align -Wcast-qual -Wformat=2 -Wmissing-include-dirs -Wnull-dereference -Woverloaded-virtual -Wpointer-arith -Wshadow -Wswitch-enum -Wvla -Wno-sign-compare -Wconversion -Wunused -Wold-style-cast -Wno-missing-braces -CFLAGS += -I ../src # Make sure rerun.h is found +CFLAGS += -I ../../../crates/rerun_c/src # Make sure rerun.h is found LDLIBS = OBJECTS = main.o diff --git a/crates/rerun_c/example/README.md b/examples/c/minimal/README.md similarity index 100% rename from crates/rerun_c/example/README.md rename to examples/c/minimal/README.md diff --git a/crates/rerun_c/example/main.c b/examples/c/minimal/main.c similarity index 100% rename from crates/rerun_c/example/main.c rename to examples/c/minimal/main.c diff --git a/examples/cpp/README.md b/examples/cpp/README.md new file mode 100644 index 000000000000..555ca37bda36 --- /dev/null +++ b/examples/cpp/README.md @@ -0,0 +1 @@ +The Rerun C++ SDK is in its infancy, and not ready for production. diff --git a/rerun_cpp/example/CMakeLists.txt b/examples/cpp/minimal/CMakeLists.txt similarity index 88% rename from rerun_cpp/example/CMakeLists.txt rename to examples/cpp/minimal/CMakeLists.txt index af764b822b9c..2dedec771f0f 100644 --- a/rerun_cpp/example/CMakeLists.txt +++ b/examples/cpp/minimal/CMakeLists.txt @@ -21,6 +21,6 @@ else() target_compile_options(rerun_example PRIVATE -Wall -Wextra -Wpedantic -Wcast-align -Wcast-qual -Wformat=2 -Wmissing-include-dirs -Wnull-dereference -Woverloaded-virtual -Wpointer-arith -Wshadow -Wswitch-enum -Wvla -Wno-sign-compare -Wconversion -Wunused -Wold-style-cast -Wno-missing-braces) endif() -include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/../src) # For rerun.hpp (Rerun C++ SDK) +include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/../../../rerun_cpp/src) # For rerun.hpp (Rerun C++ SDK) target_link_libraries(rerun_example PRIVATE loguru::loguru rerun_sdk) diff --git a/examples/cpp/minimal/README.md b/examples/cpp/minimal/README.md new file mode 100644 index 000000000000..5041110c8676 --- /dev/null +++ b/examples/cpp/minimal/README.md @@ -0,0 +1,5 @@ +# Example of using the Rerun C SDK + +``` +make run +``` diff --git a/rerun_cpp/build_and_run.sh b/examples/cpp/minimal/build_and_run.sh similarity index 53% rename from rerun_cpp/build_and_run.sh rename to examples/cpp/minimal/build_and_run.sh index 58ef0b2e04bf..b19b24164e42 100755 --- a/rerun_cpp/build_and_run.sh +++ b/examples/cpp/minimal/build_and_run.sh @@ -2,15 +2,13 @@ set -eu script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -cd "$script_path" +cd "$script_path/../../.." set -x mkdir -p build pushd build - cargo build -p rerun_c # TODO(emilk): add this to CMakelists.txt instead? cmake -DCMAKE_BUILD_TYPE=Debug .. - make # VERBOSE=1 + make -j8 # VERBOSE=1 popd -./build/example/rerun_example - +./build/examples/cpp/minimal/rerun_example diff --git a/rerun_cpp/example/main.cpp b/examples/cpp/minimal/main.cpp similarity index 94% rename from rerun_cpp/example/main.cpp rename to examples/cpp/minimal/main.cpp index 2570abbb4fed..232fb5346720 100644 --- a/rerun_cpp/example/main.cpp +++ b/examples/cpp/minimal/main.cpp @@ -1,7 +1,3 @@ -#include - -#define RERUN_WITH_ARROW 1 - #include #include diff --git a/rerun_cpp/CMakeLists.txt b/rerun_cpp/CMakeLists.txt index 13f41954602f..a937d45ba0c4 100644 --- a/rerun_cpp/CMakeLists.txt +++ b/rerun_cpp/CMakeLists.txt @@ -1,6 +1,71 @@ cmake_minimum_required(VERSION 3.16) -project(rerun_cpp_proj LANGUAGES CXX) +# NOTE: CMake docs strongly discourages using GLOB, and instead suggests +# manually listing all the files, like it's 1972. +# However, that won't work for use since we auto-generate the source tree. +# See https://cmake.org/cmake/help/latest/command/file.html#glob +file(GLOB_RECURSE rerun_sdk_SRC CONFIGURE_DEPENDS + "*.hpp" + "*.cpp" +) -add_subdirectory(src) # The Rerun C++ SDK library -add_subdirectory(example) +add_library(rerun_sdk ${rerun_sdk_SRC}) + +# ------------------------------------------------------------------------------ + +# For rerun.h (Rerun C SDK): +include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/../crates/rerun_c/src) + +# Make sure the compiler can find include files for rerun +# when other libraries or executables link to rerun: +target_include_directories(rerun_sdk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +# ------------------------------------------------------------------------------ +# Loguru logging library (https://github.com/emilk/loguru): +set(CMAKE_DL_LIBS "dl") # Required by Loguru for backtraces + +# Loguru, see https://github.com/emilk/loguru/blob/master/loguru_cmake_example/CMakeLists.txt +include(FetchContent) +FetchContent_Declare(LoguruGitRepo + GIT_REPOSITORY "https://github.com/emilk/loguru" # can be a filesystem path + GIT_TAG "master" +) + +# set any loguru compile-time flags before calling MakeAvailable() +set(LOGURU_STACKTRACES 1) +FetchContent_MakeAvailable(LoguruGitRepo) # defines target 'loguru::loguru' + +target_link_libraries(rerun_sdk PRIVATE loguru::loguru) + +# ------------------------------------------------------------------------------ +execute_process(COMMAND cargo build -p re_types) # Generates most of the C++ source files +execute_process(COMMAND cargo build -p rerun_c) # We link against this, so must be up-to-date + +# ------------------------------------------------------------------------------ +if(APPLE) + target_link_libraries(rerun_sdk PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../target/debug/librerun_c.a) + target_link_libraries(rerun_sdk PRIVATE "-framework CoreFoundation" "-framework IOKit") +endif() + +if(LINUX) + target_link_libraries(rerun_sdk PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../target/debug/librerun_c.a) + target_link_libraries(rerun_sdk PRIVATE "-lm") +endif() + +# ----------------------------------------------------------------------------- +# Arrow: +option(ARROW_LINK_SHARED "Link to the Arrow shared library" ON) + +find_package(Arrow REQUIRED) + +# Arrow requires a C++17 compliant compiler +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +message(STATUS "Arrow version: ${ARROW_VERSION}") +message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}") + +if(ARROW_LINK_SHARED) + target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_shared) +else() + target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_static) +endif() diff --git a/rerun_cpp/README.md b/rerun_cpp/README.md index e27e375d5287..634458e4b160 100644 --- a/rerun_cpp/README.md +++ b/rerun_cpp/README.md @@ -6,7 +6,7 @@ This is not yet ready to be used. Run `scripts/setup.sh`. ## Test it -rerun_cpp/example/build_and_run.sh +`examples/cpp/minimal/build_and_run.sh` # To do: * CI diff --git a/rerun_cpp/example/README.md b/rerun_cpp/example/README.md deleted file mode 100644 index adb11aefbb05..000000000000 --- a/rerun_cpp/example/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Example of using the Rerun C++ SDK - -``` -make run -``` diff --git a/rerun_cpp/src/CMakeLists.txt b/rerun_cpp/src/CMakeLists.txt deleted file mode 100644 index 2687315aa452..000000000000 --- a/rerun_cpp/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -cmake_minimum_required(VERSION 3.16) - -# NOTE: CMake docs strongly discourages using GLOB, and instead suggests -# manually listing all the files, like it's 1972. -# However, that won't work for use since we auto-generate the source tree. -# See https://cmake.org/cmake/help/latest/command/file.html#glob -file(GLOB rerun_sdk_SRC CONFIGURE_DEPENDS - "*.hpp" - "*.cpp" -) - -add_library(rerun_sdk ${rerun_sdk_SRC}) - -# ------------------------------------------------------------------------------ - -# For rerun.h (Rerun C SDK): -include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/../../crates/rerun_c/src) - -# Make sure the compiler can find include files for rerun -# when other libraries or executables link to rerun: -target_include_directories(rerun_sdk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - -# ------------------------------------------------------------------------------ -# Loguru logging library (https://github.com/emilk/loguru): -set(CMAKE_DL_LIBS "dl") # Required by Loguru for backtraces - -# Loguru, see https://github.com/emilk/loguru/blob/master/loguru_cmake_example/CMakeLists.txt -include(FetchContent) -FetchContent_Declare(LoguruGitRepo - GIT_REPOSITORY "https://github.com/emilk/loguru" # can be a filesystem path - GIT_TAG "master" -) - -# set any loguru compile-time flags before calling MakeAvailable() -set(LOGURU_STACKTRACES 1) -FetchContent_MakeAvailable(LoguruGitRepo) # defines target 'loguru::loguru' - -target_link_libraries(rerun_sdk PRIVATE loguru::loguru) - -# ------------------------------------------------------------------------------ -if(APPLE) - target_link_libraries(rerun_sdk PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../target/debug/librerun_c.a) - target_link_libraries(rerun_sdk PRIVATE "-framework CoreFoundation" "-framework IOKit") -endif() - -if(LINUX) - target_link_libraries(rerun_sdk PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../target/debug/librerun_c.a) - target_link_libraries(rerun_sdk PRIVATE "-lm") -endif() - -# ----------------------------------------------------------------------------- -# Arrow: -option(ARROW_LINK_SHARED "Link to the Arrow shared library" ON) - -find_package(Arrow REQUIRED) - -# Arrow requires a C++17 compliant compiler -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -message(STATUS "Arrow version: ${ARROW_VERSION}") -message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}") - -if(ARROW_LINK_SHARED) - target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_shared) -else() - target_link_libraries(rerun_sdk PRIVATE Arrow::arrow_static) -endif() diff --git a/rerun_cpp/src/archetypes.hpp b/rerun_cpp/src/archetypes.hpp new file mode 100644 index 000000000000..e69cd7d5414f --- /dev/null +++ b/rerun_cpp/src/archetypes.hpp @@ -0,0 +1,7 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. + +#pragma once + +#include "archetypes/affix_fuzzer1.hpp" +#include "archetypes/points2d.hpp" +#include "archetypes/transform3d.hpp" diff --git a/rerun_cpp/src/archetypes/affix_fuzzer1.cpp b/rerun_cpp/src/archetypes/affix_fuzzer1.cpp new file mode 100644 index 000000000000..01cdfb4917c4 --- /dev/null +++ b/rerun_cpp/src/archetypes/affix_fuzzer1.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/archetypes/fuzzy.fbs" + +#include "affix_fuzzer1.hpp" diff --git a/rerun_cpp/src/archetypes/affix_fuzzer1.hpp b/rerun_cpp/src/archetypes/affix_fuzzer1.hpp new file mode 100644 index 000000000000..d282d2639d9d --- /dev/null +++ b/rerun_cpp/src/archetypes/affix_fuzzer1.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/archetypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace archetypes { + struct AffixFuzzer1 {}; + } // namespace archetypes +} // namespace rr diff --git a/rerun_cpp/src/archetypes/points2d.cpp b/rerun_cpp/src/archetypes/points2d.cpp new file mode 100644 index 000000000000..60b131e73a41 --- /dev/null +++ b/rerun_cpp/src/archetypes/points2d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/archetypes/points2d.fbs" + +#include "points2d.hpp" diff --git a/rerun_cpp/src/archetypes/points2d.hpp b/rerun_cpp/src/archetypes/points2d.hpp new file mode 100644 index 000000000000..8914b4f1e9ec --- /dev/null +++ b/rerun_cpp/src/archetypes/points2d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/archetypes/points2d.fbs" + +#pragma once + +namespace rr { + namespace archetypes { + struct Points2D {}; + } // namespace archetypes +} // namespace rr diff --git a/rerun_cpp/src/archetypes/transform3d.cpp b/rerun_cpp/src/archetypes/transform3d.cpp new file mode 100644 index 000000000000..dfe591cc2888 --- /dev/null +++ b/rerun_cpp/src/archetypes/transform3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/archetypes/transform3d.fbs" + +#include "transform3d.hpp" diff --git a/rerun_cpp/src/archetypes/transform3d.hpp b/rerun_cpp/src/archetypes/transform3d.hpp new file mode 100644 index 000000000000..828d211ca89e --- /dev/null +++ b/rerun_cpp/src/archetypes/transform3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/archetypes/transform3d.fbs" + +#pragma once + +namespace rr { + namespace archetypes { + struct Transform3D {}; + } // namespace archetypes +} // namespace rr diff --git a/rerun_cpp/src/components.hpp b/rerun_cpp/src/components.hpp new file mode 100644 index 000000000000..7ee5874c31a7 --- /dev/null +++ b/rerun_cpp/src/components.hpp @@ -0,0 +1,31 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. + +#pragma once + +#include "components/affix_fuzzer1.hpp" +#include "components/affix_fuzzer10.hpp" +#include "components/affix_fuzzer11.hpp" +#include "components/affix_fuzzer12.hpp" +#include "components/affix_fuzzer13.hpp" +#include "components/affix_fuzzer14.hpp" +#include "components/affix_fuzzer16.hpp" +#include "components/affix_fuzzer17.hpp" +#include "components/affix_fuzzer18.hpp" +#include "components/affix_fuzzer19.hpp" +#include "components/affix_fuzzer2.hpp" +#include "components/affix_fuzzer3.hpp" +#include "components/affix_fuzzer4.hpp" +#include "components/affix_fuzzer5.hpp" +#include "components/affix_fuzzer6.hpp" +#include "components/affix_fuzzer7.hpp" +#include "components/affix_fuzzer8.hpp" +#include "components/affix_fuzzer9.hpp" +#include "components/class_id.hpp" +#include "components/color.hpp" +#include "components/draw_order.hpp" +#include "components/instance_key.hpp" +#include "components/keypoint_id.hpp" +#include "components/label.hpp" +#include "components/point2d.hpp" +#include "components/radius.hpp" +#include "components/transform3d.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer1.cpp b/rerun_cpp/src/components/affix_fuzzer1.cpp new file mode 100644 index 000000000000..b2c9f2ab67f8 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer1.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer1.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer1.hpp b/rerun_cpp/src/components/affix_fuzzer1.hpp new file mode 100644 index 000000000000..ee862c698948 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer1.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer1 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer10.cpp b/rerun_cpp/src/components/affix_fuzzer10.cpp new file mode 100644 index 000000000000..c1d8f9fe8970 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer10.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer10.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer10.hpp b/rerun_cpp/src/components/affix_fuzzer10.hpp new file mode 100644 index 000000000000..3f118b2d83ff --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer10.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer10 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer11.cpp b/rerun_cpp/src/components/affix_fuzzer11.cpp new file mode 100644 index 000000000000..dc1275432f7a --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer11.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer11.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer11.hpp b/rerun_cpp/src/components/affix_fuzzer11.hpp new file mode 100644 index 000000000000..cc38f30d352a --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer11.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer11 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer12.cpp b/rerun_cpp/src/components/affix_fuzzer12.cpp new file mode 100644 index 000000000000..7e71b62dd4f4 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer12.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer12.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer12.hpp b/rerun_cpp/src/components/affix_fuzzer12.hpp new file mode 100644 index 000000000000..8023e1b383fd --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer12.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer12 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer13.cpp b/rerun_cpp/src/components/affix_fuzzer13.cpp new file mode 100644 index 000000000000..406ea79af0e3 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer13.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer13.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer13.hpp b/rerun_cpp/src/components/affix_fuzzer13.hpp new file mode 100644 index 000000000000..23c044603713 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer13.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer13 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer14.cpp b/rerun_cpp/src/components/affix_fuzzer14.cpp new file mode 100644 index 000000000000..0b92a2737aaa --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer14.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer14.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer14.hpp b/rerun_cpp/src/components/affix_fuzzer14.hpp new file mode 100644 index 000000000000..27f5113528af --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer14.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer14 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer16.cpp b/rerun_cpp/src/components/affix_fuzzer16.cpp new file mode 100644 index 000000000000..a0f65983210e --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer16.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer16.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer16.hpp b/rerun_cpp/src/components/affix_fuzzer16.hpp new file mode 100644 index 000000000000..03e0dce624cb --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer16.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer16 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer17.cpp b/rerun_cpp/src/components/affix_fuzzer17.cpp new file mode 100644 index 000000000000..0e22b89254be --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer17.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer17.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer17.hpp b/rerun_cpp/src/components/affix_fuzzer17.hpp new file mode 100644 index 000000000000..6949e285326d --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer17.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer17 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer18.cpp b/rerun_cpp/src/components/affix_fuzzer18.cpp new file mode 100644 index 000000000000..150c2ed65be2 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer18.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer18.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer18.hpp b/rerun_cpp/src/components/affix_fuzzer18.hpp new file mode 100644 index 000000000000..e628d5c67517 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer18.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer18 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer19.cpp b/rerun_cpp/src/components/affix_fuzzer19.cpp new file mode 100644 index 000000000000..928bbc0d83a2 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer19.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer19.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer19.hpp b/rerun_cpp/src/components/affix_fuzzer19.hpp new file mode 100644 index 000000000000..3a19ea5be974 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer19.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer19 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer2.cpp b/rerun_cpp/src/components/affix_fuzzer2.cpp new file mode 100644 index 000000000000..b9265e47d44e --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer2.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer2.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer2.hpp b/rerun_cpp/src/components/affix_fuzzer2.hpp new file mode 100644 index 000000000000..9c7cfff36af5 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer2.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer2 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer3.cpp b/rerun_cpp/src/components/affix_fuzzer3.cpp new file mode 100644 index 000000000000..ed75408e61e2 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer3.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer3.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer3.hpp b/rerun_cpp/src/components/affix_fuzzer3.hpp new file mode 100644 index 000000000000..57ccadeb7ef2 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer3.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer3 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer4.cpp b/rerun_cpp/src/components/affix_fuzzer4.cpp new file mode 100644 index 000000000000..cb06ca6be631 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer4.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer4.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer4.hpp b/rerun_cpp/src/components/affix_fuzzer4.hpp new file mode 100644 index 000000000000..a93c5bd001db --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer4.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer4 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer5.cpp b/rerun_cpp/src/components/affix_fuzzer5.cpp new file mode 100644 index 000000000000..f6d349c9c49b --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer5.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer5.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer5.hpp b/rerun_cpp/src/components/affix_fuzzer5.hpp new file mode 100644 index 000000000000..8c91cd56400f --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer5.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer5 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer6.cpp b/rerun_cpp/src/components/affix_fuzzer6.cpp new file mode 100644 index 000000000000..88479ef8858f --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer6.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer6.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer6.hpp b/rerun_cpp/src/components/affix_fuzzer6.hpp new file mode 100644 index 000000000000..6bfa12e7727a --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer6.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer6 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer7.cpp b/rerun_cpp/src/components/affix_fuzzer7.cpp new file mode 100644 index 000000000000..da2d7fd958f7 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer7.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer7.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer7.hpp b/rerun_cpp/src/components/affix_fuzzer7.hpp new file mode 100644 index 000000000000..76a4819c9413 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer7.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer7 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer8.cpp b/rerun_cpp/src/components/affix_fuzzer8.cpp new file mode 100644 index 000000000000..ccee9bad933c --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer8.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer8.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer8.hpp b/rerun_cpp/src/components/affix_fuzzer8.hpp new file mode 100644 index 000000000000..cc6216a2bc5c --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer8.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer8 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer9.cpp b/rerun_cpp/src/components/affix_fuzzer9.cpp new file mode 100644 index 000000000000..d8bb9a7ab769 --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer9.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#include "affix_fuzzer9.hpp" diff --git a/rerun_cpp/src/components/affix_fuzzer9.hpp b/rerun_cpp/src/components/affix_fuzzer9.hpp new file mode 100644 index 000000000000..05367dfe289d --- /dev/null +++ b/rerun_cpp/src/components/affix_fuzzer9.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace components { + struct AffixFuzzer9 {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/class_id.cpp b/rerun_cpp/src/components/class_id.cpp new file mode 100644 index 000000000000..234ddbb8082d --- /dev/null +++ b/rerun_cpp/src/components/class_id.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/class_id.fbs" + +#include "class_id.hpp" diff --git a/rerun_cpp/src/components/class_id.hpp b/rerun_cpp/src/components/class_id.hpp new file mode 100644 index 000000000000..0ba0aa1968dc --- /dev/null +++ b/rerun_cpp/src/components/class_id.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/class_id.fbs" + +#pragma once + +namespace rr { + namespace components { + struct ClassId {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/color.cpp b/rerun_cpp/src/components/color.cpp new file mode 100644 index 000000000000..d897f50ab3cd --- /dev/null +++ b/rerun_cpp/src/components/color.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/color.fbs" + +#include "color.hpp" diff --git a/rerun_cpp/src/components/color.hpp b/rerun_cpp/src/components/color.hpp new file mode 100644 index 000000000000..8b85b790c80e --- /dev/null +++ b/rerun_cpp/src/components/color.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/color.fbs" + +#pragma once + +namespace rr { + namespace components { + struct Color {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/draw_order.cpp b/rerun_cpp/src/components/draw_order.cpp new file mode 100644 index 000000000000..92f00a0992a1 --- /dev/null +++ b/rerun_cpp/src/components/draw_order.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/draw_order.fbs" + +#include "draw_order.hpp" diff --git a/rerun_cpp/src/components/draw_order.hpp b/rerun_cpp/src/components/draw_order.hpp new file mode 100644 index 000000000000..d0169cf06d1d --- /dev/null +++ b/rerun_cpp/src/components/draw_order.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/draw_order.fbs" + +#pragma once + +namespace rr { + namespace components { + struct DrawOrder {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/instance_key.cpp b/rerun_cpp/src/components/instance_key.cpp new file mode 100644 index 000000000000..8b3011b5f487 --- /dev/null +++ b/rerun_cpp/src/components/instance_key.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/instance_key.fbs" + +#include "instance_key.hpp" diff --git a/rerun_cpp/src/components/instance_key.hpp b/rerun_cpp/src/components/instance_key.hpp new file mode 100644 index 000000000000..3fd206a0f39b --- /dev/null +++ b/rerun_cpp/src/components/instance_key.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/instance_key.fbs" + +#pragma once + +namespace rr { + namespace components { + struct InstanceKey {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/keypoint_id.cpp b/rerun_cpp/src/components/keypoint_id.cpp new file mode 100644 index 000000000000..16daabd77f65 --- /dev/null +++ b/rerun_cpp/src/components/keypoint_id.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/keypoint_id.fbs" + +#include "keypoint_id.hpp" diff --git a/rerun_cpp/src/components/keypoint_id.hpp b/rerun_cpp/src/components/keypoint_id.hpp new file mode 100644 index 000000000000..40b6c7b75371 --- /dev/null +++ b/rerun_cpp/src/components/keypoint_id.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/keypoint_id.fbs" + +#pragma once + +namespace rr { + namespace components { + struct KeypointId {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/label.cpp b/rerun_cpp/src/components/label.cpp new file mode 100644 index 000000000000..0ef7dd89ae23 --- /dev/null +++ b/rerun_cpp/src/components/label.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/label.fbs" + +#include "label.hpp" diff --git a/rerun_cpp/src/components/label.hpp b/rerun_cpp/src/components/label.hpp new file mode 100644 index 000000000000..7b03bc5be817 --- /dev/null +++ b/rerun_cpp/src/components/label.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/label.fbs" + +#pragma once + +namespace rr { + namespace components { + struct Label {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/point2d.cpp b/rerun_cpp/src/components/point2d.cpp new file mode 100644 index 000000000000..d7d7e25c00c6 --- /dev/null +++ b/rerun_cpp/src/components/point2d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/point2d.fbs" + +#include "point2d.hpp" diff --git a/rerun_cpp/src/components/point2d.hpp b/rerun_cpp/src/components/point2d.hpp new file mode 100644 index 000000000000..36e11f7eb784 --- /dev/null +++ b/rerun_cpp/src/components/point2d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/point2d.fbs" + +#pragma once + +namespace rr { + namespace components { + struct Point2D {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/radius.cpp b/rerun_cpp/src/components/radius.cpp new file mode 100644 index 000000000000..669646a1b9b0 --- /dev/null +++ b/rerun_cpp/src/components/radius.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/radius.fbs" + +#include "radius.hpp" diff --git a/rerun_cpp/src/components/radius.hpp b/rerun_cpp/src/components/radius.hpp new file mode 100644 index 000000000000..3312c472a463 --- /dev/null +++ b/rerun_cpp/src/components/radius.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/radius.fbs" + +#pragma once + +namespace rr { + namespace components { + struct Radius {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/transform3d.cpp b/rerun_cpp/src/components/transform3d.cpp new file mode 100644 index 000000000000..d65d87753452 --- /dev/null +++ b/rerun_cpp/src/components/transform3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/transform3d.fbs" + +#include "transform3d.hpp" diff --git a/rerun_cpp/src/components/transform3d.hpp b/rerun_cpp/src/components/transform3d.hpp new file mode 100644 index 000000000000..d33f462b17a1 --- /dev/null +++ b/rerun_cpp/src/components/transform3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/components/transform3d.fbs" + +#pragma once + +namespace rr { + namespace components { + struct Transform3D {}; + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/datatypes.hpp b/rerun_cpp/src/datatypes.hpp new file mode 100644 index 000000000000..65bfaa796e8e --- /dev/null +++ b/rerun_cpp/src/datatypes.hpp @@ -0,0 +1,24 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. + +#pragma once + +#include "datatypes/affix_fuzzer1.hpp" +#include "datatypes/affix_fuzzer2.hpp" +#include "datatypes/affix_fuzzer3.hpp" +#include "datatypes/affix_fuzzer4.hpp" +#include "datatypes/affix_fuzzer5.hpp" +#include "datatypes/angle.hpp" +#include "datatypes/flattened_scalar.hpp" +#include "datatypes/mat3x3.hpp" +#include "datatypes/mat4x4.hpp" +#include "datatypes/point2d.hpp" +#include "datatypes/quaternion.hpp" +#include "datatypes/rotation3d.hpp" +#include "datatypes/rotation_axis_angle.hpp" +#include "datatypes/scale3d.hpp" +#include "datatypes/transform3d.hpp" +#include "datatypes/translation_and_mat3x3.hpp" +#include "datatypes/translation_rotation_scale3d.hpp" +#include "datatypes/vec2d.hpp" +#include "datatypes/vec3d.hpp" +#include "datatypes/vec4d.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer1.cpp b/rerun_cpp/src/datatypes/affix_fuzzer1.cpp new file mode 100644 index 000000000000..53bcc179d50c --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer1.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "affix_fuzzer1.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer1.hpp b/rerun_cpp/src/datatypes/affix_fuzzer1.hpp new file mode 100644 index 000000000000..05b82a9a0b9e --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer1.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct AffixFuzzer1 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer2.cpp b/rerun_cpp/src/datatypes/affix_fuzzer2.cpp new file mode 100644 index 000000000000..7cac9a9dfc70 --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer2.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "affix_fuzzer2.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer2.hpp b/rerun_cpp/src/datatypes/affix_fuzzer2.hpp new file mode 100644 index 000000000000..8b2ebb3011fb --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer2.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct AffixFuzzer2 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer3.cpp b/rerun_cpp/src/datatypes/affix_fuzzer3.cpp new file mode 100644 index 000000000000..1ec601b1dcd2 --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer3.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "affix_fuzzer3.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer3.hpp b/rerun_cpp/src/datatypes/affix_fuzzer3.hpp new file mode 100644 index 000000000000..9a39b095893c --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer3.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct AffixFuzzer3 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer4.cpp b/rerun_cpp/src/datatypes/affix_fuzzer4.cpp new file mode 100644 index 000000000000..4eff902f8274 --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer4.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "affix_fuzzer4.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer4.hpp b/rerun_cpp/src/datatypes/affix_fuzzer4.hpp new file mode 100644 index 000000000000..aca90cb71cea --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer4.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct AffixFuzzer4 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer5.cpp b/rerun_cpp/src/datatypes/affix_fuzzer5.cpp new file mode 100644 index 000000000000..78b473585562 --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer5.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "affix_fuzzer5.hpp" diff --git a/rerun_cpp/src/datatypes/affix_fuzzer5.hpp b/rerun_cpp/src/datatypes/affix_fuzzer5.hpp new file mode 100644 index 000000000000..a7d1cd3c95b9 --- /dev/null +++ b/rerun_cpp/src/datatypes/affix_fuzzer5.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct AffixFuzzer5 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/angle.cpp b/rerun_cpp/src/datatypes/angle.cpp new file mode 100644 index 000000000000..606b65de611a --- /dev/null +++ b/rerun_cpp/src/datatypes/angle.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/angle.fbs" + +#include "angle.hpp" diff --git a/rerun_cpp/src/datatypes/angle.hpp b/rerun_cpp/src/datatypes/angle.hpp new file mode 100644 index 000000000000..466e6aaa363b --- /dev/null +++ b/rerun_cpp/src/datatypes/angle.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/angle.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Angle {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/flattened_scalar.cpp b/rerun_cpp/src/datatypes/flattened_scalar.cpp new file mode 100644 index 000000000000..2a372b531389 --- /dev/null +++ b/rerun_cpp/src/datatypes/flattened_scalar.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#include "flattened_scalar.hpp" diff --git a/rerun_cpp/src/datatypes/flattened_scalar.hpp b/rerun_cpp/src/datatypes/flattened_scalar.hpp new file mode 100644 index 000000000000..f3af24ce8824 --- /dev/null +++ b/rerun_cpp/src/datatypes/flattened_scalar.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct FlattenedScalar {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/mat3x3.cpp b/rerun_cpp/src/datatypes/mat3x3.cpp new file mode 100644 index 000000000000..482256c15ed7 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat3x3.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/mat3x3.fbs" + +#include "mat3x3.hpp" diff --git a/rerun_cpp/src/datatypes/mat3x3.hpp b/rerun_cpp/src/datatypes/mat3x3.hpp new file mode 100644 index 000000000000..42239db4fceb --- /dev/null +++ b/rerun_cpp/src/datatypes/mat3x3.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/mat3x3.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Mat3x3 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/mat4x4.cpp b/rerun_cpp/src/datatypes/mat4x4.cpp new file mode 100644 index 000000000000..5062e861a617 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat4x4.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/mat4x4.fbs" + +#include "mat4x4.hpp" diff --git a/rerun_cpp/src/datatypes/mat4x4.hpp b/rerun_cpp/src/datatypes/mat4x4.hpp new file mode 100644 index 000000000000..f15a57628b73 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat4x4.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/mat4x4.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Mat4x4 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/point2d.cpp b/rerun_cpp/src/datatypes/point2d.cpp new file mode 100644 index 000000000000..917b94019e7e --- /dev/null +++ b/rerun_cpp/src/datatypes/point2d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/point2d.fbs" + +#include "point2d.hpp" diff --git a/rerun_cpp/src/datatypes/point2d.hpp b/rerun_cpp/src/datatypes/point2d.hpp new file mode 100644 index 000000000000..973a22e262ae --- /dev/null +++ b/rerun_cpp/src/datatypes/point2d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/point2d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Point2D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/quaternion.cpp b/rerun_cpp/src/datatypes/quaternion.cpp new file mode 100644 index 000000000000..45556a1eb960 --- /dev/null +++ b/rerun_cpp/src/datatypes/quaternion.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/quaternion.fbs" + +#include "quaternion.hpp" diff --git a/rerun_cpp/src/datatypes/quaternion.hpp b/rerun_cpp/src/datatypes/quaternion.hpp new file mode 100644 index 000000000000..c2409a1a74c3 --- /dev/null +++ b/rerun_cpp/src/datatypes/quaternion.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/quaternion.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Quaternion {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/rotation3d.cpp b/rerun_cpp/src/datatypes/rotation3d.cpp new file mode 100644 index 000000000000..244f1ab8fd71 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/rotation3d.fbs" + +#include "rotation3d.hpp" diff --git a/rerun_cpp/src/datatypes/rotation3d.hpp b/rerun_cpp/src/datatypes/rotation3d.hpp new file mode 100644 index 000000000000..27dc63d3a713 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/rotation3d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Rotation3D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/rotation_axis_angle.cpp b/rerun_cpp/src/datatypes/rotation_axis_angle.cpp new file mode 100644 index 000000000000..339b7dd87190 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/rotation_axis_angle.fbs" + +#include "rotation_axis_angle.hpp" diff --git a/rerun_cpp/src/datatypes/rotation_axis_angle.hpp b/rerun_cpp/src/datatypes/rotation_axis_angle.hpp new file mode 100644 index 000000000000..87ee461ebb86 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/rotation_axis_angle.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct RotationAxisAngle {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/scale3d.cpp b/rerun_cpp/src/datatypes/scale3d.cpp new file mode 100644 index 000000000000..8731b5748400 --- /dev/null +++ b/rerun_cpp/src/datatypes/scale3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/scale3d.fbs" + +#include "scale3d.hpp" diff --git a/rerun_cpp/src/datatypes/scale3d.hpp b/rerun_cpp/src/datatypes/scale3d.hpp new file mode 100644 index 000000000000..186b029e0c77 --- /dev/null +++ b/rerun_cpp/src/datatypes/scale3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/scale3d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Scale3D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/transform3d.cpp b/rerun_cpp/src/datatypes/transform3d.cpp new file mode 100644 index 000000000000..54f042d2092e --- /dev/null +++ b/rerun_cpp/src/datatypes/transform3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/transform3d.fbs" + +#include "transform3d.hpp" diff --git a/rerun_cpp/src/datatypes/transform3d.hpp b/rerun_cpp/src/datatypes/transform3d.hpp new file mode 100644 index 000000000000..ac5d2f02cd27 --- /dev/null +++ b/rerun_cpp/src/datatypes/transform3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/transform3d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Transform3D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp b/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp new file mode 100644 index 000000000000..65477804eaa6 --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/translation_and_mat3x3.fbs" + +#include "translation_and_mat3x3.hpp" diff --git a/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp b/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp new file mode 100644 index 000000000000..2605cc788e45 --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/translation_and_mat3x3.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct TranslationAndMat3x3 {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp b/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp new file mode 100644 index 000000000000..a73150c21254 --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/translation_rotation_scale3d.fbs" + +#include "translation_rotation_scale3d.hpp" diff --git a/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp b/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp new file mode 100644 index 000000000000..963b061702f1 --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/translation_rotation_scale3d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct TranslationRotationScale3D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec2d.cpp b/rerun_cpp/src/datatypes/vec2d.cpp new file mode 100644 index 000000000000..bf28aca4b742 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec2d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec2d.fbs" + +#include "vec2d.hpp" diff --git a/rerun_cpp/src/datatypes/vec2d.hpp b/rerun_cpp/src/datatypes/vec2d.hpp new file mode 100644 index 000000000000..dc9c87da0c59 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec2d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec2d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Vec2D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec3d.cpp b/rerun_cpp/src/datatypes/vec3d.cpp new file mode 100644 index 000000000000..5caa1e961566 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec3d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec3d.fbs" + +#include "vec3d.hpp" diff --git a/rerun_cpp/src/datatypes/vec3d.hpp b/rerun_cpp/src/datatypes/vec3d.hpp new file mode 100644 index 000000000000..19d1f8c6a7da --- /dev/null +++ b/rerun_cpp/src/datatypes/vec3d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec3d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Vec3D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec4d.cpp b/rerun_cpp/src/datatypes/vec4d.cpp new file mode 100644 index 000000000000..6babd548d1a8 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec4d.cpp @@ -0,0 +1,4 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec4d.fbs" + +#include "vec4d.hpp" diff --git a/rerun_cpp/src/datatypes/vec4d.hpp b/rerun_cpp/src/datatypes/vec4d.hpp new file mode 100644 index 000000000000..51734627882c --- /dev/null +++ b/rerun_cpp/src/datatypes/vec4d.hpp @@ -0,0 +1,10 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/datatypes/vec4d.fbs" + +#pragma once + +namespace rr { + namespace datatypes { + struct Vec4D {}; + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/rerun.hpp b/rerun_cpp/src/rerun.hpp index adb28a7d1ef4..a8e8c27a99c0 100644 --- a/rerun_cpp/src/rerun.hpp +++ b/rerun_cpp/src/rerun.hpp @@ -1,6 +1,12 @@ // The Rerun C++ SDK. #pragma once +// Auto-generated: +#include "archetypes.hpp" +#include "components.hpp" +#include "datatypes.hpp" + +// Manually written: #include "recording_stream.hpp" namespace rr { diff --git a/scripts/setup_dev.sh b/scripts/setup_dev.sh index b954dd16c098..d7dc8ebef98b 100755 --- a/scripts/setup_dev.sh +++ b/scripts/setup_dev.sh @@ -15,7 +15,7 @@ cargo install taplo-cli --locked # https://github.com/tamasfe/taplo - toml forma cargo install typos-cli # https://github.com/crate-ci/typos - typo detector -packagesNeeded='pngcrush pipx' +packagesNeeded='pngcrush pipx clang-format' if [ -x "$(command -v brew)" ]; then brew install $packagesNeeded elif [ -x "$(command -v port)" ]; then sudo port install $packagesNeeded elif [ -x "$(command -v apt-get)" ]; then sudo apt-get -y install $packagesNeeded