diff --git a/Cargo.lock b/Cargo.lock index aef883418f890..fcd6dff7dd486 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" @@ -4535,6 +4544,7 @@ dependencies = [ "anyhow", "arrow2", "camino", + "clang-format", "convert_case", "flatbuffers", "indent", diff --git a/crates/re_types/build.rs b/crates/re_types/build.rs index 431aeba6c0af6..3184f6c9eb087 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"; @@ -106,6 +107,8 @@ fn main() { let (objects, arrow_registry) = re_types_builder::generate_lang_agnostic(DEFINITIONS_DIR_PATH, ENTRYPOINT_PATH); + 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); // We need to run `cago fmt` several times because it is not idempotent! diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index d7ce7105f41ea..15ce0f7b970ce 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. -79a77e7e24972298df0817e449fb2fda1a8a8de96ef269b4e58dabf1262062fd \ No newline at end of file +61313d55df25b523cddc1555e2f92d7c75f18d55e43706cdf8ac0da898fdb22f \ No newline at end of file diff --git a/crates/re_types_builder/Cargo.toml b/crates/re_types_builder/Cargo.toml index d3886bd206db2..a0b7596e4fdd9 100644 --- a/crates/re_types_builder/Cargo.toml +++ b/crates/re_types_builder/Cargo.toml @@ -23,6 +23,7 @@ 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" 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 0000000000000..1dd988be15755 --- /dev/null +++ b/crates/re_types_builder/src/codegen/cpp.rs @@ -0,0 +1,144 @@ +use std::collections::BTreeSet; + +use anyhow::Context as _; +use camino::Utf8PathBuf; +use proc_macro2::TokenStream; +use quote::{format_ident, quote}; + +use crate::{codegen::AUTOGEN_WARNING, ArrowRegistry, Object, 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( + &mut self, + objects: &Objects, + arrow_registry: &ArrowRegistry, + object_kind: ObjectKind, + folder_name: &str, + ) -> BTreeSet { + let mut filepaths = BTreeSet::default(); + + let folder_path = self.output_path.join(folder_name); + std::fs::create_dir_all(&folder_path) + .with_context(|| format!("{folder_path:?}")) + .unwrap(); + for obj in objects.ordered_objects(object_kind.into()) { + 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(obj, &tokens); + let filepath = folder_path.join(format!("{filename}.{extension}")); + 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 { + let mut filepaths = BTreeSet::new(); + + for object_kind in ObjectKind::ALL { + let folder_name = object_kind.plural_snake_case(); + filepaths.extend(self.generate_folder( + objects, + arrow_registry, + object_kind, + folder_name, + )); + } + + filepaths + } +} + +fn string_from_token_stream(obj: &Object, token_stream: &TokenStream) -> String { + let mut code = String::new(); + code.push_str(&format!("// {AUTOGEN_WARNING}\n")); + if let Some(relative_path) = obj.relative_filepath() { + code.push_str(&format!("// Based on {relative_path:?}")); + } + + 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 header_file_name = format!("{snake_case_name}.hpp"); + + let hpp = quote! { + #hash pragma once #NEWLINE_TOKEN #NEWLINE_TOKEN + + namespace rr { + namespace #obj_kind_ident { + struct #pascal_case_ident { }; + } + } + }; + let cpp = quote! { #hash include #header_file_name }; + + (hpp, cpp) +} diff --git a/crates/re_types_builder/src/codegen/mod.rs b/crates/re_types_builder/src/codegen/mod.rs index 0608ace213794..f46cb55ff1851 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 0e73c65e3aae3..e792874321344 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/lib.rs b/crates/re_types_builder/src/lib.rs index 76213c2ccd1a0..9c910a5c94e5f 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 (object, 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 e9be98b443f6c..3aa8958f152d8 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,21 @@ impl Object { .try_get::(&self.fqname, crate::ATTR_TRANSPARENT) .is_some() } + + /// Try to find the relative file path of the `.fbs` soruce 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 filename of the object, e.g. `point2d`. + pub fn snake_case_name(&self) -> String { + Utf8PathBuf::from(&self.virtpath) + .file_stem() + .unwrap() + .to_owned() + } } /// Properties specific to either structs or unions, but not both. diff --git a/rerun_cpp/example/main.cpp b/rerun_cpp/example/main.cpp index 2570abbb4feda..232fb53467204 100644 --- a/rerun_cpp/example/main.cpp +++ b/rerun_cpp/example/main.cpp @@ -1,7 +1,3 @@ -#include - -#define RERUN_WITH_ARROW 1 - #include #include diff --git a/rerun_cpp/src/archetypes/fuzzy.cpp b/rerun_cpp/src/archetypes/fuzzy.cpp new file mode 100644 index 0000000000000..da958e692679b --- /dev/null +++ b/rerun_cpp/src/archetypes/fuzzy.cpp @@ -0,0 +1,3 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/archetypes/fuzzy.fbs" +#include "fuzzy.hpp" diff --git a/rerun_cpp/src/archetypes/fuzzy.hpp b/rerun_cpp/src/archetypes/fuzzy.hpp new file mode 100644 index 0000000000000..e54c76f206ca6 --- /dev/null +++ b/rerun_cpp/src/archetypes/fuzzy.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..c5ccc29a7da45 --- /dev/null +++ b/rerun_cpp/src/archetypes/points2d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..0a071bdd95009 --- /dev/null +++ b/rerun_cpp/src/archetypes/points2d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..8ff520f73ff4d --- /dev/null +++ b/rerun_cpp/src/archetypes/transform3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..c216f0883f200 --- /dev/null +++ b/rerun_cpp/src/archetypes/transform3d.hpp @@ -0,0 +1,9 @@ +// 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/class_id.cpp b/rerun_cpp/src/components/class_id.cpp new file mode 100644 index 0000000000000..6b427c4a9378f --- /dev/null +++ b/rerun_cpp/src/components/class_id.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..c38fffc165b96 --- /dev/null +++ b/rerun_cpp/src/components/class_id.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..bda6f5ec6124e --- /dev/null +++ b/rerun_cpp/src/components/color.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..9d98846d70339 --- /dev/null +++ b/rerun_cpp/src/components/color.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..89375dc5bf518 --- /dev/null +++ b/rerun_cpp/src/components/draw_order.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..0703cf5064c40 --- /dev/null +++ b/rerun_cpp/src/components/draw_order.hpp @@ -0,0 +1,9 @@ +// 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/fuzzy.cpp b/rerun_cpp/src/components/fuzzy.cpp new file mode 100644 index 0000000000000..a06ff0287561f --- /dev/null +++ b/rerun_cpp/src/components/fuzzy.cpp @@ -0,0 +1,3 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/components/fuzzy.fbs" +#include "fuzzy.hpp" diff --git a/rerun_cpp/src/components/fuzzy.hpp b/rerun_cpp/src/components/fuzzy.hpp new file mode 100644 index 0000000000000..e97507fcbc55a --- /dev/null +++ b/rerun_cpp/src/components/fuzzy.hpp @@ -0,0 +1,9 @@ +// 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/instance_key.cpp b/rerun_cpp/src/components/instance_key.cpp new file mode 100644 index 0000000000000..7ad1f2bdbff36 --- /dev/null +++ b/rerun_cpp/src/components/instance_key.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..21a86338095b9 --- /dev/null +++ b/rerun_cpp/src/components/instance_key.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..b85c481ae94ba --- /dev/null +++ b/rerun_cpp/src/components/keypoint_id.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..b426e3b1ed691 --- /dev/null +++ b/rerun_cpp/src/components/keypoint_id.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..a1e153a8d45bf --- /dev/null +++ b/rerun_cpp/src/components/label.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..ddb0a1f536bb9 --- /dev/null +++ b/rerun_cpp/src/components/label.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..c920df5490542 --- /dev/null +++ b/rerun_cpp/src/components/point2d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..03a1d36c6e8e6 --- /dev/null +++ b/rerun_cpp/src/components/point2d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..3b0dea8d01088 --- /dev/null +++ b/rerun_cpp/src/components/radius.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..4b5e38a442e41 --- /dev/null +++ b/rerun_cpp/src/components/radius.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..87697a5c7b1b5 --- /dev/null +++ b/rerun_cpp/src/components/transform3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..fa7efba851d72 --- /dev/null +++ b/rerun_cpp/src/components/transform3d.hpp @@ -0,0 +1,9 @@ +// 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/angle.cpp b/rerun_cpp/src/datatypes/angle.cpp new file mode 100644 index 0000000000000..d5fd07d3eacda --- /dev/null +++ b/rerun_cpp/src/datatypes/angle.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..900675576bcaf --- /dev/null +++ b/rerun_cpp/src/datatypes/angle.hpp @@ -0,0 +1,9 @@ +// 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/fuzzy.cpp b/rerun_cpp/src/datatypes/fuzzy.cpp new file mode 100644 index 0000000000000..81fc907945356 --- /dev/null +++ b/rerun_cpp/src/datatypes/fuzzy.cpp @@ -0,0 +1,3 @@ +// NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. +// Based on "definitions/rerun/testing/datatypes/fuzzy.fbs" +#include "fuzzy.hpp" diff --git a/rerun_cpp/src/datatypes/fuzzy.hpp b/rerun_cpp/src/datatypes/fuzzy.hpp new file mode 100644 index 0000000000000..7cbd8c65fdf45 --- /dev/null +++ b/rerun_cpp/src/datatypes/fuzzy.hpp @@ -0,0 +1,9 @@ +// 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/mat3x3.cpp b/rerun_cpp/src/datatypes/mat3x3.cpp new file mode 100644 index 0000000000000..3c2a0f9007324 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat3x3.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..bff38c5876807 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat3x3.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..fa00854a9c007 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat4x4.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..ee8c8d0546788 --- /dev/null +++ b/rerun_cpp/src/datatypes/mat4x4.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..2573a2ac3bd2c --- /dev/null +++ b/rerun_cpp/src/datatypes/point2d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..90fa7b5a194e9 --- /dev/null +++ b/rerun_cpp/src/datatypes/point2d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..bd044e78087cb --- /dev/null +++ b/rerun_cpp/src/datatypes/quaternion.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..d18a28ff780d0 --- /dev/null +++ b/rerun_cpp/src/datatypes/quaternion.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..bbb0c7de72ddd --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..71e26757a43b8 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation3d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..92ea21ec034d0 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..6ba99ec1ebf56 --- /dev/null +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..fc6f95c6e34ab --- /dev/null +++ b/rerun_cpp/src/datatypes/scale3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..9ac1a15270b26 --- /dev/null +++ b/rerun_cpp/src/datatypes/scale3d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..e0c756f482198 --- /dev/null +++ b/rerun_cpp/src/datatypes/transform3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..e841b68cd1141 --- /dev/null +++ b/rerun_cpp/src/datatypes/transform3d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..bbc5b2b74117d --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..3309bcdcc83c9 --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..092b56a07fd5b --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..dac0069ab9e3a --- /dev/null +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..fa3f1312da8c8 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec2d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..8911d4fb106a5 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec2d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..0ee1c9bf0a4ec --- /dev/null +++ b/rerun_cpp/src/datatypes/vec3d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..9a8ff11a20914 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec3d.hpp @@ -0,0 +1,9 @@ +// 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 0000000000000..fd7dbbe208c00 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec4d.cpp @@ -0,0 +1,3 @@ +// 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 0000000000000..2689ad7bff480 --- /dev/null +++ b/rerun_cpp/src/datatypes/vec4d.hpp @@ -0,0 +1,9 @@ +// 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