diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index af06973b81b7..e864f2d1d95f 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. -e11a5960ff29c75374e3298ae9f2728d9d6d838c517e1b1ee3bc2a18fada0efb +e45f620a5a7e37189161bd67ebaa7b111fa0569a315fb28bd960dd0e564b1149 diff --git a/crates/re_types_builder/src/codegen/cpp/forward_decl.rs b/crates/re_types_builder/src/codegen/cpp/forward_decl.rs new file mode 100644 index 000000000000..8498e27c3e1f --- /dev/null +++ b/crates/re_types_builder/src/codegen/cpp/forward_decl.rs @@ -0,0 +1,74 @@ +use std::collections::{BTreeMap, BTreeSet}; + +use proc_macro2::TokenStream; +use quote::{format_ident, quote}; + +use super::NEWLINE_TOKEN; + +/// A C++ forward declaration. +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +#[allow(dead_code)] +pub enum ForwardDecl { + Struct(String), + Class(String), +} + +impl quote::ToTokens for ForwardDecl { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self { + ForwardDecl::Struct(name) => { + let name_ident = format_ident!("{name}"); + quote! { struct #name_ident; } + } + ForwardDecl::Class(name) => { + let name_ident = format_ident!("{name}"); + quote! { class #name_ident; } + } + } + .to_tokens(tokens); + } +} + +/// Keeps track of necessary forward decls for a file. +#[derive(Default)] +pub struct ForwardDecls { + /// E.g. `DataType` in `arrow` etc. + declarations_per_namespace: BTreeMap>, +} + +impl ForwardDecls { + pub fn insert(&mut self, namespace: impl Into, decl: ForwardDecl) { + self.declarations_per_namespace + .entry(namespace.into()) + .or_default() + .insert(decl); + } +} + +impl quote::ToTokens for ForwardDecls { + fn to_tokens(&self, tokens: &mut TokenStream) { + let Self { + declarations_per_namespace, + } = self; + + let declarations = declarations_per_namespace + .iter() + .map(|(namespace, declarations)| { + let namespace_ident = format_ident!("{namespace}"); + quote! { + #NEWLINE_TOKEN + namespace #namespace_ident { + #(#declarations)* + } + } + }); + + quote! { + #NEWLINE_TOKEN + #(#declarations)* + #NEWLINE_TOKEN + #NEWLINE_TOKEN + } + .to_tokens(tokens); + } +} diff --git a/crates/re_types_builder/src/codegen/cpp/includes.rs b/crates/re_types_builder/src/codegen/cpp/includes.rs new file mode 100644 index 000000000000..37f9fa70a033 --- /dev/null +++ b/crates/re_types_builder/src/codegen/cpp/includes.rs @@ -0,0 +1,40 @@ +use std::collections::BTreeSet; + +use proc_macro2::TokenStream; +use quote::quote; + +use super::{NEWLINE_TOKEN, SYS_INCLUDE_PATH_PREFIX_TOKEN, SYS_INCLUDE_PATH_SUFFIX_TOKEN}; + +/// Keeps track of necessary includes for a file. +#[derive(Default)] +pub struct Includes { + /// `#include ` etc + pub system: BTreeSet, + + /// `#include datatypes.hpp"` etc + pub local: BTreeSet, +} + +impl quote::ToTokens for Includes { + fn to_tokens(&self, tokens: &mut TokenStream) { + let Self { system, local } = self; + + let hash = quote! { # }; + let system = system.iter().map(|name| { + // Need to mark system includes with tokens since they are usually not idents (can contain slashes and dots) + quote! { #hash include #SYS_INCLUDE_PATH_PREFIX_TOKEN #name #SYS_INCLUDE_PATH_SUFFIX_TOKEN #NEWLINE_TOKEN } + }); + let local = local.iter().map(|name| { + quote! { #hash include #name #NEWLINE_TOKEN } + }); + + quote! { + #(#system)* + #NEWLINE_TOKEN + #(#local)* + #NEWLINE_TOKEN + #NEWLINE_TOKEN + } + .to_tokens(tokens); + } +} diff --git a/crates/re_types_builder/src/codegen/cpp/method.rs b/crates/re_types_builder/src/codegen/cpp/method.rs new file mode 100644 index 000000000000..360b41fa94d8 --- /dev/null +++ b/crates/re_types_builder/src/codegen/cpp/method.rs @@ -0,0 +1,122 @@ +use proc_macro2::{Ident, TokenStream}; +use quote::quote; + +use super::{doc_comment, NEWLINE_TOKEN}; + +#[derive(Default)] +pub struct MethodDeclaration { + pub is_static: bool, + pub return_type: TokenStream, + pub name_and_parameters: TokenStream, +} + +impl MethodDeclaration { + pub fn constructor(declaration: TokenStream) -> Self { + Self { + is_static: false, + return_type: TokenStream::new(), + name_and_parameters: declaration, + } + } + + pub fn to_hpp_tokens(&self) -> TokenStream { + let Self { + is_static, + return_type, + name_and_parameters, + } = self; + + let modifiers = if *is_static { + quote! { static } + } else { + quote! {} + }; + quote! { + #modifiers #return_type #name_and_parameters + } + } + + pub fn to_cpp_tokens(&self, class_or_struct_name: &Ident) -> TokenStream { + let Self { + is_static: _, + return_type, + name_and_parameters, + } = self; + + quote! { + #return_type #class_or_struct_name::#name_and_parameters + } + } +} + +/// A Cpp struct/class method. +pub struct Method { + pub doc_string: String, + pub declaration: MethodDeclaration, + pub definition_body: TokenStream, + pub inline: bool, +} + +impl Default for Method { + fn default() -> Self { + Self { + doc_string: String::new(), + declaration: MethodDeclaration::default(), + definition_body: TokenStream::new(), + inline: true, + } + } +} + +impl Method { + pub fn to_hpp_tokens(&self) -> TokenStream { + let Self { + doc_string, + declaration, + definition_body, + inline: is_inline, + } = self; + + let quoted_doc = if doc_string.is_empty() { + quote! {} + } else { + doc_comment(doc_string) + }; + let declaration = declaration.to_hpp_tokens(); + if *is_inline { + quote! { + #NEWLINE_TOKEN + #quoted_doc + #declaration { + #definition_body + } + } + } else { + quote! { + #NEWLINE_TOKEN + #quoted_doc + #declaration; + } + } + } + + pub fn to_cpp_tokens(&self, class_or_struct_name: &Ident) -> TokenStream { + let Self { + doc_string: _, + declaration, + definition_body, + inline, + } = self; + + let declaration = declaration.to_cpp_tokens(class_or_struct_name); + if *inline { + quote! {} + } else { + quote! { + #declaration { + #definition_body + } + } + } + } +} diff --git a/crates/re_types_builder/src/codegen/cpp.rs b/crates/re_types_builder/src/codegen/cpp/mod.rs similarity index 79% rename from crates/re_types_builder/src/codegen/cpp.rs rename to crates/re_types_builder/src/codegen/cpp/mod.rs index 12d484bbff4e..564fc75eb229 100644 --- a/crates/re_types_builder/src/codegen/cpp.rs +++ b/crates/re_types_builder/src/codegen/cpp/mod.rs @@ -1,6 +1,11 @@ +mod forward_decl; +mod includes; +mod method; + use std::collections::BTreeSet; use anyhow::Context as _; +use arrow2::datatypes::DataType; use camino::{Utf8Path, Utf8PathBuf}; use itertools::Itertools; use proc_macro2::{Ident, TokenStream}; @@ -12,6 +17,10 @@ use crate::{ Type, }; +use self::forward_decl::{ForwardDecl, ForwardDecls}; +use self::includes::Includes; +use self::method::{Method, MethodDeclaration}; + // Special strings we insert as tokens, then search-and-replace later. // This is so that we can insert comments and whitespace into the generated code. // `TokenStream` ignores whitespace (including comments), but we can insert "quoted strings", @@ -21,6 +30,8 @@ const NORMAL_COMMENT_PREFIX_TOKEN: &str = "NORMAL_COMMENT_PREFIX_TOKEN"; const NORMAL_COMMENT_SUFFIX_TOKEN: &str = "NORMAL_COMMENT_SUFFIX_TOKEN"; const DOC_COMMENT_PREFIX_TOKEN: &str = "DOC_COMMENT_PREFIX_TOKEN"; const DOC_COMMENT_SUFFIX_TOKEN: &str = "DOC_COMMENT_SUFFIX_TOKEN"; +const SYS_INCLUDE_PATH_PREFIX_TOKEN: &str = "SYS_INCLUDE_PATH_PREFIX_TOKEN"; +const SYS_INCLUDE_PATH_SUFFIX_TOKEN: &str = "SYS_INCLUDE_PATH_SUFFIX_TOKEN"; const TODO_TOKEN: &str = "TODO_TOKEN"; fn comment(text: &str) -> TokenStream { @@ -47,6 +58,8 @@ fn string_from_token_stream(token_stream: &TokenStream, source_path: Option<&Utf .replace(&format!("\" {NORMAL_COMMENT_SUFFIX_TOKEN:?}"), "\n") .replace(&format!("{DOC_COMMENT_PREFIX_TOKEN:?} \""), "///") .replace(&format!("\" {DOC_COMMENT_SUFFIX_TOKEN:?}"), "\n") + .replace(&format!("{SYS_INCLUDE_PATH_PREFIX_TOKEN:?} \""), "<") + .replace(&format!("\" {SYS_INCLUDE_PATH_SUFFIX_TOKEN:?}"), ">") .replace( &format!("{TODO_TOKEN:?}"), "\n// TODO(#2647): code-gen for C++\n", @@ -167,10 +180,10 @@ fn write_file(filepath: &Utf8PathBuf, code: String) { fn generate_hpp_cpp( objects: &Objects, - _arrow_registry: &ArrowRegistry, + arrow_registry: &ArrowRegistry, obj: &crate::Object, ) -> (TokenStream, TokenStream) { - let QuotedObject { hpp, cpp } = QuotedObject::new(objects, obj); + let QuotedObject { hpp, cpp } = QuotedObject::new(arrow_registry, objects, obj); let snake_case_name = obj.snake_case_name(); let hash = quote! { # }; let pragma_once = pragma_once(); @@ -201,20 +214,27 @@ struct QuotedObject { } impl QuotedObject { - pub fn new(objects: &Objects, obj: &crate::Object) -> Self { + pub fn new(arrow_registry: &ArrowRegistry, objects: &Objects, obj: &crate::Object) -> Self { match obj.specifics { - crate::ObjectSpecifics::Struct => Self::from_struct(objects, obj), + crate::ObjectSpecifics::Struct => Self::from_struct(arrow_registry, objects, obj), crate::ObjectSpecifics::Union { .. } => Self::from_union(objects, obj), } } - fn from_struct(_objects: &Objects, obj: &crate::Object) -> QuotedObject { + fn from_struct( + arrow_registry: &ArrowRegistry, + _objects: &Objects, + obj: &crate::Object, + ) -> QuotedObject { let namespace_ident = format_ident!("{}", obj.kind.plural_snake_case()); // `datatypes`, `components`, or `archetypes` let pascal_case_name = &obj.name; let pascal_case_ident = format_ident!("{pascal_case_name}"); // The PascalCase name of the object type. let quoted_docs = quote_docstrings(&obj.docs); let mut hpp_includes = Includes::default(); + hpp_includes.system.insert("cstdint".to_owned()); // we use `uint32_t` etc everywhere. + let mut cpp_includes = Includes::default(); + let mut hpp_declarations = ForwardDecls::default(); let field_declarations = obj .fields @@ -232,43 +252,76 @@ impl QuotedObject { }) .collect_vec(); - let constructor = if obj.fields.len() == 1 { + let mut methods = Vec::new(); + + if obj.fields.len() == 1 { // Single-field struct - it is a newtype wrapper. // Create a implicit constructor from its own field-type. let obj_field = &obj.fields[0]; if let Type::Array { .. } = &obj_field.typ { // TODO(emilk): implicit constructor for arrays - quote! {} } else { hpp_includes.system.insert("utility".to_owned()); // std::move let field_ident = format_ident!("{}", obj_field.name); let parameter_declaration = quote_declaration(&mut hpp_includes, obj_field, &field_ident); - quote! { - #pascal_case_ident(#parameter_declaration) : #field_ident(std::move(#field_ident)) {} - } + + methods.push(Method { + declaration: MethodDeclaration::constructor(quote! { + #pascal_case_ident(#parameter_declaration) : #field_ident(std::move(#field_ident)) + }), + ..Method::default() + }); } - } else { - quote! {} }; + match obj.kind { + ObjectKind::Datatype | ObjectKind::Component => { + methods.push(arrow_data_type_method( + &arrow_registry.get(&obj.fqname), + &mut hpp_includes, + &mut cpp_includes, + &mut hpp_declarations, + )); + } + ObjectKind::Archetype => {} + }; + + let hpp_method_section = if methods.is_empty() { + quote! {} + } else { + let hpp_methods = methods.iter().map(|m| m.to_hpp_tokens()); + quote! { + public: + #(#hpp_methods)* + } + }; let hpp = quote! { #hpp_includes + #hpp_declarations namespace rr { namespace #namespace_ident { #quoted_docs struct #pascal_case_ident { #(#field_declarations;)* - - #constructor + #hpp_method_section }; } } }; - let cpp = quote! {}; // TODO(emilk): add Arrow serialization code here! + let cpp_methods = methods.iter().map(|m| m.to_cpp_tokens(&pascal_case_ident)); + let cpp = quote! { + #cpp_includes + + namespace rr { + namespace #namespace_ident { + #(#cpp_methods)* + } + } + }; Self { hpp, cpp } } @@ -321,7 +374,7 @@ impl QuotedObject { .collect_vec(); let mut hpp_includes = Includes::default(); - + hpp_includes.system.insert("cstdint".to_owned()); // we use `uint32_t` etc everywhere. hpp_includes.system.insert("utility".to_owned()); // std::move let enum_data_declarations = obj @@ -522,6 +575,30 @@ impl QuotedObject { } } +fn arrow_data_type_method( + datatype: &DataType, + hpp_includes: &mut Includes, + cpp_includes: &mut Includes, + hpp_declarations: &mut ForwardDecls, +) -> Method { + hpp_declarations.insert("arrow", ForwardDecl::Class("DataType".to_owned())); + cpp_includes.system.insert("arrow/api.h".to_owned()); + hpp_includes.system.insert("memory".to_owned()); // std::shared_ptr + + let quoted_datatype = ArrowDataTypeTokenizer(datatype); + + Method { + doc_string: "Returns the arrow data type this type corresponds to.".to_owned(), + declaration: MethodDeclaration { + is_static: true, + return_type: quote! { std::shared_ptr }, + name_and_parameters: quote! { to_arrow_datatype() }, + }, + definition_body: quote! { return #quoted_datatype; }, + inline: false, + } +} + /// e.g. `static Angle radians(float radians);` -> `auto angle = Angle::radians(radians);` fn quote_static_constructor_for_enum_type( objects: &Objects, @@ -569,7 +646,7 @@ fn quote_static_constructor_for_enum_type( } } } else if obj_field.typ.has_default_destructor(objects) { - // Generate simpoler code for simple types: + // Generate simpler code for simple types: quote! { #docstring static #pascal_case_ident #snake_case_ident(#param_declaration) @@ -604,50 +681,6 @@ fn are_types_disjoint(fields: &[ObjectField]) -> bool { type_set.len() == fields.len() } -/// Keep track of necessary includes for a file. -struct Includes { - /// `#include ` etc - system: BTreeSet, - - /// `#include datatypes.hpp"` etc - local: BTreeSet, -} - -impl Default for Includes { - fn default() -> Self { - let mut slf = Self { - system: BTreeSet::new(), - local: BTreeSet::new(), - }; - slf.system.insert("cstdint".to_owned()); // we use `uint32_t` etc everywhere. - slf - } -} - -impl quote::ToTokens for Includes { - fn to_tokens(&self, tokens: &mut TokenStream) { - let Self { system, local } = self; - - let hash = quote! { # }; - let system = system.iter().map(|name| { - let name = format_ident!("{}", name); - quote! { #hash include <#name> #NEWLINE_TOKEN } - }); - let local = local.iter().map(|name| { - quote! { #hash include #name #NEWLINE_TOKEN } - }); - - quote! { - #(#system)* - #NEWLINE_TOKEN - #(#local)* - #NEWLINE_TOKEN - #NEWLINE_TOKEN - } - .to_tokens(tokens); - } -} - fn quote_declaration_with_docstring( includes: &mut Includes, obj_field: &ObjectField, @@ -792,3 +825,103 @@ fn quote_docstrings(docs: &Docs) -> TokenStream { #(#quoted_lines)* } } + +fn quote_integer(t: T) -> TokenStream { + let t = syn::LitInt::new(&t.to_string(), proc_macro2::Span::call_site()); + quote!(#t) +} + +// --- Arrow registry code generators --- + +struct ArrowDataTypeTokenizer<'a>(&'a ::arrow2::datatypes::DataType); + +impl quote::ToTokens for ArrowDataTypeTokenizer<'_> { + fn to_tokens(&self, tokens: &mut TokenStream) { + use arrow2::datatypes::UnionMode; + match self.0.to_logical_type() { + DataType::Null => quote!(arrow::null()), + DataType::Boolean => quote!(arrow::boolean()), + DataType::Int8 => quote!(arrow::int8()), + DataType::Int16 => quote!(arrow::int16()), + DataType::Int32 => quote!(arrow::int32()), + DataType::Int64 => quote!(arrow::int64()), + DataType::UInt8 => quote!(arrow::uint8()), + DataType::UInt16 => quote!(arrow::uint16()), + DataType::UInt32 => quote!(arrow::uint32()), + DataType::UInt64 => quote!(arrow::uint64()), + DataType::Float16 => quote!(arrow::float16()), + DataType::Float32 => quote!(arrow::float32()), + DataType::Float64 => quote!(arrow::float64()), + DataType::Binary => quote!(arrow::binary()), + DataType::LargeBinary => quote!(arrow::large_binary()), + DataType::Utf8 => quote!(arrow::utf8()), + DataType::LargeUtf8 => quote!(arrow::large_utf8()), + + DataType::List(field) => { + let field = ArrowFieldTokenizer(field); + quote!(arrow::list(#field)) + } + + DataType::FixedSizeList(field, length) => { + let field = ArrowFieldTokenizer(field); + let length = quote_integer(length); + quote!(arrow::fixed_size_list(#field, #length)) + } + + DataType::Union(fields, _, mode) => { + let fields = fields.iter().map(ArrowFieldTokenizer); + match mode { + UnionMode::Dense => { + quote! { arrow::dense_union({ #(#fields,)* }) } + } + UnionMode::Sparse => { + quote! { arrow::sparse_union({ #(#fields,)* }) } + } + } + } + + DataType::Struct(fields) => { + let fields = fields.iter().map(ArrowFieldTokenizer); + quote! { arrow::struct_({ #(#fields,)* }) } + } + + DataType::Extension(_name, _datatype, _metadata) => { + // TODO(andreas): Need this eventually. + unimplemented!("Arrow extension types not yet implemented"); + } + + _ => unimplemented!("{:#?}", self.0), + } + .to_tokens(tokens); + } +} + +struct ArrowFieldTokenizer<'a>(&'a ::arrow2::datatypes::Field); + +impl quote::ToTokens for ArrowFieldTokenizer<'_> { + fn to_tokens(&self, tokens: &mut TokenStream) { + let arrow2::datatypes::Field { + name, + data_type, + is_nullable, + metadata, + } = &self.0; + + let datatype = ArrowDataTypeTokenizer(data_type); + + let metadata = if metadata.is_empty() { + quote!(nullptr) + } else { + let keys = metadata.keys(); + let values = metadata.values(); + quote! { + arrow::KeyValueMetadata::Make({ #(#keys,)* }, { #(#values,)* }) + } + }; + + quote! { + arrow::field(#name, #datatype, #is_nullable, #metadata) + } + .to_tokens(tokens); + } +} diff --git a/rerun_cpp/src/archetypes/affix_fuzzer1.cpp b/rerun_cpp/src/archetypes/affix_fuzzer1.cpp index 017b1d66432c..a4117d5bc89f 100644 --- a/rerun_cpp/src/archetypes/affix_fuzzer1.cpp +++ b/rerun_cpp/src/archetypes/affix_fuzzer1.cpp @@ -2,3 +2,7 @@ // Based on "crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs" #include "affix_fuzzer1.hpp" + +namespace rr { + namespace archetypes {} +} // namespace rr diff --git a/rerun_cpp/src/archetypes/points2d.cpp b/rerun_cpp/src/archetypes/points2d.cpp index fb85c273b960..adb742c229df 100644 --- a/rerun_cpp/src/archetypes/points2d.cpp +++ b/rerun_cpp/src/archetypes/points2d.cpp @@ -2,3 +2,7 @@ // Based on "crates/re_types/definitions/rerun/archetypes/points2d.fbs" #include "points2d.hpp" + +namespace rr { + namespace archetypes {} +} // namespace rr diff --git a/rerun_cpp/src/archetypes/transform3d.cpp b/rerun_cpp/src/archetypes/transform3d.cpp index 54f324e014b8..539fdead8e96 100644 --- a/rerun_cpp/src/archetypes/transform3d.cpp +++ b/rerun_cpp/src/archetypes/transform3d.cpp @@ -2,3 +2,7 @@ // Based on "crates/re_types/definitions/rerun/archetypes/transform3d.fbs" #include "transform3d.hpp" + +namespace rr { + namespace archetypes {} +} // namespace rr diff --git a/rerun_cpp/src/archetypes/transform3d.hpp b/rerun_cpp/src/archetypes/transform3d.hpp index 47dab30562df..60bd5c501ed2 100644 --- a/rerun_cpp/src/archetypes/transform3d.hpp +++ b/rerun_cpp/src/archetypes/transform3d.hpp @@ -15,6 +15,7 @@ namespace rr { /// The transform rr::components::Transform3D transform; + public: Transform3D(rr::components::Transform3D transform) : transform(std::move(transform)) {} }; } // namespace archetypes diff --git a/rerun_cpp/src/components/affix_fuzzer1.cpp b/rerun_cpp/src/components/affix_fuzzer1.cpp index 5df39188b34d..acd9d26614b0 100644 --- a/rerun_cpp/src/components/affix_fuzzer1.cpp +++ b/rerun_cpp/src/components/affix_fuzzer1.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer1.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer1::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer1.hpp b/rerun_cpp/src/components/affix_fuzzer1.hpp index 85b25be495c7..4d4d69a193f1 100644 --- a/rerun_cpp/src/components/affix_fuzzer1.hpp +++ b/rerun_cpp/src/components/affix_fuzzer1.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer1 { rr::datatypes::AffixFuzzer1 single_required; + public: AffixFuzzer1(rr::datatypes::AffixFuzzer1 single_required) : single_required(std::move(single_required)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer10.cpp b/rerun_cpp/src/components/affix_fuzzer10.cpp index 16a764562f0d..51524c1ce87e 100644 --- a/rerun_cpp/src/components/affix_fuzzer10.cpp +++ b/rerun_cpp/src/components/affix_fuzzer10.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer10.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer10::to_arrow_datatype() { + return arrow::utf8(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer10.hpp b/rerun_cpp/src/components/affix_fuzzer10.hpp index 65c2ccf443ee..5293a168d2b9 100644 --- a/rerun_cpp/src/components/affix_fuzzer10.hpp +++ b/rerun_cpp/src/components/affix_fuzzer10.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer10 { std::optional single_string_optional; + public: AffixFuzzer10(std::optional single_string_optional) : single_string_optional(std::move(single_string_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer11.cpp b/rerun_cpp/src/components/affix_fuzzer11.cpp index 201de2917cc4..afeecd1ad7b3 100644 --- a/rerun_cpp/src/components/affix_fuzzer11.cpp +++ b/rerun_cpp/src/components/affix_fuzzer11.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer11.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer11::to_arrow_datatype() { + return arrow::list(arrow::field("item", arrow::float32(), true, nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer11.hpp b/rerun_cpp/src/components/affix_fuzzer11.hpp index 18203fdf4cb0..d0cd2ae0858f 100644 --- a/rerun_cpp/src/components/affix_fuzzer11.hpp +++ b/rerun_cpp/src/components/affix_fuzzer11.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer11 { std::optional> many_floats_optional; + public: AffixFuzzer11(std::optional> many_floats_optional) : many_floats_optional(std::move(many_floats_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer12.cpp b/rerun_cpp/src/components/affix_fuzzer12.cpp index 98b67d4d442b..e5d3202beeee 100644 --- a/rerun_cpp/src/components/affix_fuzzer12.cpp +++ b/rerun_cpp/src/components/affix_fuzzer12.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer12.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer12::to_arrow_datatype() { + return arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer12.hpp b/rerun_cpp/src/components/affix_fuzzer12.hpp index 04c1d5086720..d553f5109506 100644 --- a/rerun_cpp/src/components/affix_fuzzer12.hpp +++ b/rerun_cpp/src/components/affix_fuzzer12.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer12 { std::vector many_strings_required; + public: AffixFuzzer12(std::vector many_strings_required) : many_strings_required(std::move(many_strings_required)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer13.cpp b/rerun_cpp/src/components/affix_fuzzer13.cpp index 75dec62ca615..d3a04f21f00a 100644 --- a/rerun_cpp/src/components/affix_fuzzer13.cpp +++ b/rerun_cpp/src/components/affix_fuzzer13.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer13.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer13::to_arrow_datatype() { + return arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer13.hpp b/rerun_cpp/src/components/affix_fuzzer13.hpp index 6c46213cf8a4..f6afa2733905 100644 --- a/rerun_cpp/src/components/affix_fuzzer13.hpp +++ b/rerun_cpp/src/components/affix_fuzzer13.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer13 { std::optional> many_strings_optional; + public: AffixFuzzer13(std::optional> many_strings_optional) : many_strings_optional(std::move(many_strings_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer14.cpp b/rerun_cpp/src/components/affix_fuzzer14.cpp index 7776e884249b..9276f9a33a3d 100644 --- a/rerun_cpp/src/components/affix_fuzzer14.cpp +++ b/rerun_cpp/src/components/affix_fuzzer14.cpp @@ -1,4 +1,60 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer14.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer14::to_arrow_datatype() { + return arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field( + "almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field("fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer14.hpp b/rerun_cpp/src/components/affix_fuzzer14.hpp index 95e7b960581d..9f0d441319de 100644 --- a/rerun_cpp/src/components/affix_fuzzer14.hpp +++ b/rerun_cpp/src/components/affix_fuzzer14.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/affix_fuzzer3.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer14 { rr::datatypes::AffixFuzzer3 single_required_union; + public: AffixFuzzer14(rr::datatypes::AffixFuzzer3 single_required_union) : single_required_union(std::move(single_required_union)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer15.cpp b/rerun_cpp/src/components/affix_fuzzer15.cpp index 58e23263ab86..744aa883ee29 100644 --- a/rerun_cpp/src/components/affix_fuzzer15.cpp +++ b/rerun_cpp/src/components/affix_fuzzer15.cpp @@ -1,4 +1,60 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer15.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer15::to_arrow_datatype() { + return arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field( + "almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field("fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer15.hpp b/rerun_cpp/src/components/affix_fuzzer15.hpp index 666f2bfa5fe1..815a830c204d 100644 --- a/rerun_cpp/src/components/affix_fuzzer15.hpp +++ b/rerun_cpp/src/components/affix_fuzzer15.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer3.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer15 { std::optional single_optional_union; + public: AffixFuzzer15(std::optional single_optional_union) : single_optional_union(std::move(single_optional_union)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer16.cpp b/rerun_cpp/src/components/affix_fuzzer16.cpp index bb0c92a4b0c6..4012674112d7 100644 --- a/rerun_cpp/src/components/affix_fuzzer16.cpp +++ b/rerun_cpp/src/components/affix_fuzzer16.cpp @@ -1,4 +1,67 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer16.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer16::to_arrow_datatype() { + return arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field( + "single_float_optional", arrow::float32(), true, nullptr), + arrow::field( + "single_string_required", arrow::utf8(), false, nullptr), + arrow::field( + "single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field( + "almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field("fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + false, + nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer16.hpp b/rerun_cpp/src/components/affix_fuzzer16.hpp index f35f1b6c5cec..971b9566ceea 100644 --- a/rerun_cpp/src/components/affix_fuzzer16.hpp +++ b/rerun_cpp/src/components/affix_fuzzer16.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer3.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer16 { std::vector many_required_unions; + public: AffixFuzzer16(std::vector many_required_unions) : many_required_unions(std::move(many_required_unions)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer17.cpp b/rerun_cpp/src/components/affix_fuzzer17.cpp index 0f938e0ed6b4..82d45b1a4480 100644 --- a/rerun_cpp/src/components/affix_fuzzer17.cpp +++ b/rerun_cpp/src/components/affix_fuzzer17.cpp @@ -1,4 +1,67 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer17.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer17::to_arrow_datatype() { + return arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field( + "single_float_optional", arrow::float32(), true, nullptr), + arrow::field( + "single_string_required", arrow::utf8(), false, nullptr), + arrow::field( + "single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field( + "almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field("fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + true, + nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer17.hpp b/rerun_cpp/src/components/affix_fuzzer17.hpp index 0e8a24f02958..4dc66c113932 100644 --- a/rerun_cpp/src/components/affix_fuzzer17.hpp +++ b/rerun_cpp/src/components/affix_fuzzer17.hpp @@ -4,20 +4,29 @@ #pragma once #include +#include #include #include #include #include "../datatypes/affix_fuzzer3.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer17 { std::optional> many_optional_unions; + public: AffixFuzzer17( std::optional> many_optional_unions) : many_optional_unions(std::move(many_optional_unions)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer18.cpp b/rerun_cpp/src/components/affix_fuzzer18.cpp index 93ea89e75f69..b6fce50f5a99 100644 --- a/rerun_cpp/src/components/affix_fuzzer18.cpp +++ b/rerun_cpp/src/components/affix_fuzzer18.cpp @@ -1,4 +1,231 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer18.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer18::to_arrow_datatype() { + return arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "single_required", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field( + "flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "many_required", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "many_optional", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + true, + nullptr)), + false, + nullptr), + }), + true, + nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer18.hpp b/rerun_cpp/src/components/affix_fuzzer18.hpp index f11c433aac72..97050a0dd5e2 100644 --- a/rerun_cpp/src/components/affix_fuzzer18.hpp +++ b/rerun_cpp/src/components/affix_fuzzer18.hpp @@ -4,20 +4,29 @@ #pragma once #include +#include #include #include #include #include "../datatypes/affix_fuzzer4.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer18 { std::optional> many_optional_unions; + public: AffixFuzzer18( std::optional> many_optional_unions) : many_optional_unions(std::move(many_optional_unions)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer19.cpp b/rerun_cpp/src/components/affix_fuzzer19.cpp index a2e425f13052..744daff2763f 100644 --- a/rerun_cpp/src/components/affix_fuzzer19.cpp +++ b/rerun_cpp/src/components/affix_fuzzer19.cpp @@ -1,4 +1,241 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer19.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer19::to_arrow_datatype() { + return arrow::struct_({ + arrow::field( + "single_optional_union", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "single_required", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "many_required", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), + 3), + false, + nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "many_optional", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), + 3), + false, + nullptr), + }), + true, + nullptr)), + false, + nullptr), + }), + true, + nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer19.hpp b/rerun_cpp/src/components/affix_fuzzer19.hpp index 732f2abe9494..baa408e04180 100644 --- a/rerun_cpp/src/components/affix_fuzzer19.hpp +++ b/rerun_cpp/src/components/affix_fuzzer19.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/affix_fuzzer5.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer19 { rr::datatypes::AffixFuzzer5 just_a_table_nothing_shady; + public: AffixFuzzer19(rr::datatypes::AffixFuzzer5 just_a_table_nothing_shady) : just_a_table_nothing_shady(std::move(just_a_table_nothing_shady)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer2.cpp b/rerun_cpp/src/components/affix_fuzzer2.cpp index 6ffcd44ded2a..68dd68c04d8c 100644 --- a/rerun_cpp/src/components/affix_fuzzer2.cpp +++ b/rerun_cpp/src/components/affix_fuzzer2.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer2.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer2::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer2.hpp b/rerun_cpp/src/components/affix_fuzzer2.hpp index fb321482adae..f703fe9d97ff 100644 --- a/rerun_cpp/src/components/affix_fuzzer2.hpp +++ b/rerun_cpp/src/components/affix_fuzzer2.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer2 { rr::datatypes::AffixFuzzer1 single_required; + public: AffixFuzzer2(rr::datatypes::AffixFuzzer1 single_required) : single_required(std::move(single_required)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer3.cpp b/rerun_cpp/src/components/affix_fuzzer3.cpp index 216ad7a1f063..bd23ffde1d8a 100644 --- a/rerun_cpp/src/components/affix_fuzzer3.cpp +++ b/rerun_cpp/src/components/affix_fuzzer3.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer3.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer3::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer3.hpp b/rerun_cpp/src/components/affix_fuzzer3.hpp index 9f11bccccada..9527e2976fb9 100644 --- a/rerun_cpp/src/components/affix_fuzzer3.hpp +++ b/rerun_cpp/src/components/affix_fuzzer3.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer3 { rr::datatypes::AffixFuzzer1 single_required; + public: AffixFuzzer3(rr::datatypes::AffixFuzzer1 single_required) : single_required(std::move(single_required)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer4.cpp b/rerun_cpp/src/components/affix_fuzzer4.cpp index 9fe09b31e368..49a65c69c65c 100644 --- a/rerun_cpp/src/components/affix_fuzzer4.cpp +++ b/rerun_cpp/src/components/affix_fuzzer4.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer4.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer4::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer4.hpp b/rerun_cpp/src/components/affix_fuzzer4.hpp index 0ec512f72ca9..df6ac181522f 100644 --- a/rerun_cpp/src/components/affix_fuzzer4.hpp +++ b/rerun_cpp/src/components/affix_fuzzer4.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer4 { std::optional single_optional; + public: AffixFuzzer4(std::optional single_optional) : single_optional(std::move(single_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer5.cpp b/rerun_cpp/src/components/affix_fuzzer5.cpp index 21b15e49aa15..8537430fc4a2 100644 --- a/rerun_cpp/src/components/affix_fuzzer5.cpp +++ b/rerun_cpp/src/components/affix_fuzzer5.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer5.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer5::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer5.hpp b/rerun_cpp/src/components/affix_fuzzer5.hpp index 72c4c1e91397..1e829b16c7d9 100644 --- a/rerun_cpp/src/components/affix_fuzzer5.hpp +++ b/rerun_cpp/src/components/affix_fuzzer5.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer5 { std::optional single_optional; + public: AffixFuzzer5(std::optional single_optional) : single_optional(std::move(single_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer6.cpp b/rerun_cpp/src/components/affix_fuzzer6.cpp index 9c250ef544fc..62f13dc33eda 100644 --- a/rerun_cpp/src/components/affix_fuzzer6.cpp +++ b/rerun_cpp/src/components/affix_fuzzer6.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer6.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer6::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer6.hpp b/rerun_cpp/src/components/affix_fuzzer6.hpp index ec647c89c153..960f54ff233b 100644 --- a/rerun_cpp/src/components/affix_fuzzer6.hpp +++ b/rerun_cpp/src/components/affix_fuzzer6.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer6 { std::optional single_optional; + public: AffixFuzzer6(std::optional single_optional) : single_optional(std::move(single_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer7.cpp b/rerun_cpp/src/components/affix_fuzzer7.cpp index 0c364933ccd8..d0875bcae85c 100644 --- a/rerun_cpp/src/components/affix_fuzzer7.cpp +++ b/rerun_cpp/src/components/affix_fuzzer7.cpp @@ -1,4 +1,42 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer7.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer7::to_arrow_datatype() { + return arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }), + true, + nullptr)); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer7.hpp b/rerun_cpp/src/components/affix_fuzzer7.hpp index ee6d95714846..41a711106fc5 100644 --- a/rerun_cpp/src/components/affix_fuzzer7.hpp +++ b/rerun_cpp/src/components/affix_fuzzer7.hpp @@ -4,19 +4,28 @@ #pragma once #include +#include #include #include #include #include "../datatypes/affix_fuzzer1.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer7 { std::optional> many_optional; + public: AffixFuzzer7(std::optional> many_optional) : many_optional(std::move(many_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer8.cpp b/rerun_cpp/src/components/affix_fuzzer8.cpp index 03bebe679b53..41abad0c5c02 100644 --- a/rerun_cpp/src/components/affix_fuzzer8.cpp +++ b/rerun_cpp/src/components/affix_fuzzer8.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer8.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer8::to_arrow_datatype() { + return arrow::float32(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer8.hpp b/rerun_cpp/src/components/affix_fuzzer8.hpp index 83aaa366f774..48defb1b7a94 100644 --- a/rerun_cpp/src/components/affix_fuzzer8.hpp +++ b/rerun_cpp/src/components/affix_fuzzer8.hpp @@ -4,16 +4,25 @@ #pragma once #include +#include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer8 { std::optional single_float_optional; + public: AffixFuzzer8(std::optional single_float_optional) : single_float_optional(std::move(single_float_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer9.cpp b/rerun_cpp/src/components/affix_fuzzer9.cpp index 50639e481a25..e8186e775d7a 100644 --- a/rerun_cpp/src/components/affix_fuzzer9.cpp +++ b/rerun_cpp/src/components/affix_fuzzer9.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/components/fuzzy.fbs" +#include + #include "affix_fuzzer9.hpp" + +namespace rr { + namespace components { + std::shared_ptr AffixFuzzer9::to_arrow_datatype() { + return arrow::utf8(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/affix_fuzzer9.hpp b/rerun_cpp/src/components/affix_fuzzer9.hpp index 2358a6194126..8a89f340411f 100644 --- a/rerun_cpp/src/components/affix_fuzzer9.hpp +++ b/rerun_cpp/src/components/affix_fuzzer9.hpp @@ -4,16 +4,25 @@ #pragma once #include +#include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { struct AffixFuzzer9 { std::string single_string_required; + public: AffixFuzzer9(std::string single_string_required) : single_string_required(std::move(single_string_required)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/class_id.cpp b/rerun_cpp/src/components/class_id.cpp index 0ad332fe9770..e4f320cc64c6 100644 --- a/rerun_cpp/src/components/class_id.cpp +++ b/rerun_cpp/src/components/class_id.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/class_id.fbs" +#include + #include "class_id.hpp" + +namespace rr { + namespace components { + std::shared_ptr ClassId::to_arrow_datatype() { + return arrow::uint16(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/class_id.hpp b/rerun_cpp/src/components/class_id.hpp index b3d6c0331f4c..e8663e0b93a7 100644 --- a/rerun_cpp/src/components/class_id.hpp +++ b/rerun_cpp/src/components/class_id.hpp @@ -4,15 +4,24 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A 16-bit ID representing a type of semantic class. struct ClassId { uint16_t id; + public: ClassId(uint16_t id) : id(std::move(id)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/color.cpp b/rerun_cpp/src/components/color.cpp index a2e868b9b8a6..f7f5af061d72 100644 --- a/rerun_cpp/src/components/color.cpp +++ b/rerun_cpp/src/components/color.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/color.fbs" +#include + #include "color.hpp" + +namespace rr { + namespace components { + std::shared_ptr Color::to_arrow_datatype() { + return arrow::uint32(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/color.hpp b/rerun_cpp/src/components/color.hpp index e2c7c0dbd11f..22c487e46286 100644 --- a/rerun_cpp/src/components/color.hpp +++ b/rerun_cpp/src/components/color.hpp @@ -4,8 +4,13 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// An RGBA color tuple with unmultiplied/separate alpha, in sRGB gamma space with linear @@ -13,7 +18,11 @@ namespace rr { struct Color { uint32_t rgba; + public: Color(uint32_t rgba) : rgba(std::move(rgba)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/draw_order.cpp b/rerun_cpp/src/components/draw_order.cpp index 79979a1c6f5e..85d5c7336ab2 100644 --- a/rerun_cpp/src/components/draw_order.cpp +++ b/rerun_cpp/src/components/draw_order.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/draw_order.fbs" +#include + #include "draw_order.hpp" + +namespace rr { + namespace components { + std::shared_ptr DrawOrder::to_arrow_datatype() { + return arrow::float32(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/draw_order.hpp b/rerun_cpp/src/components/draw_order.hpp index e50caa232be4..8da0c3efface 100644 --- a/rerun_cpp/src/components/draw_order.hpp +++ b/rerun_cpp/src/components/draw_order.hpp @@ -4,8 +4,13 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// Draw order used for the display order of 2D elements. @@ -18,7 +23,11 @@ namespace rr { struct DrawOrder { float value; + public: DrawOrder(float value) : value(std::move(value)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/instance_key.cpp b/rerun_cpp/src/components/instance_key.cpp index 49781b2cce18..8757cc45c992 100644 --- a/rerun_cpp/src/components/instance_key.cpp +++ b/rerun_cpp/src/components/instance_key.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/instance_key.fbs" +#include + #include "instance_key.hpp" + +namespace rr { + namespace components { + std::shared_ptr InstanceKey::to_arrow_datatype() { + return arrow::uint64(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/instance_key.hpp b/rerun_cpp/src/components/instance_key.hpp index 64e319b303d5..561b9d753acc 100644 --- a/rerun_cpp/src/components/instance_key.hpp +++ b/rerun_cpp/src/components/instance_key.hpp @@ -4,15 +4,24 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A unique numeric identifier for each individual instance within a batch. struct InstanceKey { uint64_t value; + public: InstanceKey(uint64_t value) : value(std::move(value)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/keypoint_id.cpp b/rerun_cpp/src/components/keypoint_id.cpp index d1021055e7e6..eb60b5cf7609 100644 --- a/rerun_cpp/src/components/keypoint_id.cpp +++ b/rerun_cpp/src/components/keypoint_id.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/keypoint_id.fbs" +#include + #include "keypoint_id.hpp" + +namespace rr { + namespace components { + std::shared_ptr KeypointId::to_arrow_datatype() { + return arrow::uint16(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/keypoint_id.hpp b/rerun_cpp/src/components/keypoint_id.hpp index 1194ea12f982..b2c8a985aeb6 100644 --- a/rerun_cpp/src/components/keypoint_id.hpp +++ b/rerun_cpp/src/components/keypoint_id.hpp @@ -4,15 +4,24 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A 16-bit ID representing a type of semantic keypoint within a class. struct KeypointId { uint16_t id; + public: KeypointId(uint16_t id) : id(std::move(id)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/label.cpp b/rerun_cpp/src/components/label.cpp index 24dba6056692..fcf593e54f7d 100644 --- a/rerun_cpp/src/components/label.cpp +++ b/rerun_cpp/src/components/label.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/label.fbs" +#include + #include "label.hpp" + +namespace rr { + namespace components { + std::shared_ptr Label::to_arrow_datatype() { + return arrow::utf8(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/label.hpp b/rerun_cpp/src/components/label.hpp index 00e5bdaab673..f2b51c7efb30 100644 --- a/rerun_cpp/src/components/label.hpp +++ b/rerun_cpp/src/components/label.hpp @@ -4,16 +4,25 @@ #pragma once #include +#include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A String label component. struct Label { std::string value; + public: Label(std::string value) : value(std::move(value)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/point2d.cpp b/rerun_cpp/src/components/point2d.cpp index ccb991111a6a..7a810c27cec2 100644 --- a/rerun_cpp/src/components/point2d.cpp +++ b/rerun_cpp/src/components/point2d.cpp @@ -1,4 +1,17 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/point2d.fbs" +#include + #include "point2d.hpp" + +namespace rr { + namespace components { + std::shared_ptr Point2D::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("x", arrow::float32(), false, nullptr), + arrow::field("y", arrow::float32(), false, nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/point2d.hpp b/rerun_cpp/src/components/point2d.hpp index ce28f099ea73..45b4a38eaf4d 100644 --- a/rerun_cpp/src/components/point2d.hpp +++ b/rerun_cpp/src/components/point2d.hpp @@ -4,17 +4,26 @@ #pragma once #include +#include #include #include "../datatypes/point2d.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A point in 2D space. struct Point2D { rr::datatypes::Point2D xy; + public: Point2D(rr::datatypes::Point2D xy) : xy(std::move(xy)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/radius.cpp b/rerun_cpp/src/components/radius.cpp index 5460fe50d242..822a04031f69 100644 --- a/rerun_cpp/src/components/radius.cpp +++ b/rerun_cpp/src/components/radius.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/radius.fbs" +#include + #include "radius.hpp" + +namespace rr { + namespace components { + std::shared_ptr Radius::to_arrow_datatype() { + return arrow::float32(); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/radius.hpp b/rerun_cpp/src/components/radius.hpp index 006bf732dbdd..9fc1aafde961 100644 --- a/rerun_cpp/src/components/radius.hpp +++ b/rerun_cpp/src/components/radius.hpp @@ -4,15 +4,24 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// A Radius component. struct Radius { float value; + public: Radius(float value) : value(std::move(value)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/components/transform3d.cpp b/rerun_cpp/src/components/transform3d.cpp index a9f2e44eeb09..6127dbba9e50 100644 --- a/rerun_cpp/src/components/transform3d.cpp +++ b/rerun_cpp/src/components/transform3d.cpp @@ -1,4 +1,98 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/components/transform3d.fbs" +#include + #include "transform3d.hpp" + +namespace rr { + namespace components { + std::shared_ptr Transform3D::to_arrow_datatype() { + return arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "TranslationAndMat3x3", + arrow::struct_({ + arrow::field("translation", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + true, + nullptr), + arrow::field("matrix", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 9), + true, + nullptr), + arrow::field("from_parent", arrow::boolean(), false, nullptr), + }), + false, + nullptr), + arrow::field( + "TranslationRotationScale", + arrow::struct_({ + arrow::field("translation", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + true, + nullptr), + arrow::field( + "rotation", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "Quaternion", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 4), + false, + nullptr), + arrow::field( + "AxisAngle", + arrow::struct_({ + arrow::field( + "axis", + arrow::fixed_size_list( + arrow::field( + "item", arrow::float32(), false, nullptr), + 3), + false, + nullptr), + arrow::field( + "angle", + arrow::dense_union({ + arrow::field( + "_null_markers", arrow::null(), true, nullptr), + arrow::field( + "Radians", arrow::float32(), false, nullptr), + arrow::field( + "Degrees", arrow::float32(), false, nullptr), + }), + false, + nullptr), + }), + false, + nullptr), + }), + true, + nullptr), + arrow::field( + "scale", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "ThreeD", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + arrow::field("Uniform", arrow::float32(), false, nullptr), + }), + true, + nullptr), + arrow::field("from_parent", arrow::boolean(), false, nullptr), + }), + false, + nullptr), + }); + } + } // namespace components +} // namespace rr diff --git a/rerun_cpp/src/components/transform3d.hpp b/rerun_cpp/src/components/transform3d.hpp index bc1f68752a62..d7c353d8762d 100644 --- a/rerun_cpp/src/components/transform3d.hpp +++ b/rerun_cpp/src/components/transform3d.hpp @@ -4,10 +4,15 @@ #pragma once #include +#include #include #include "../datatypes/transform3d.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace components { /// An affine transform between two 3D spaces, represented in a given direction. @@ -15,7 +20,11 @@ namespace rr { /// Representation of the transform. rr::datatypes::Transform3D repr; + public: Transform3D(rr::datatypes::Transform3D repr) : repr(std::move(repr)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace components } // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer1.cpp b/rerun_cpp/src/datatypes/affix_fuzzer1.cpp index b73ec29b0a7a..d3906895e234 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer1.cpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer1.cpp @@ -1,4 +1,38 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs" +#include + #include "affix_fuzzer1.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr AffixFuzzer1::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("single_float_optional", arrow::float32(), true, nullptr), + arrow::field("single_string_required", arrow::utf8(), false, nullptr), + arrow::field("single_string_optional", arrow::utf8(), true, nullptr), + arrow::field("many_floats_optional", + arrow::list(arrow::field("item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field("many_strings_required", + arrow::list(arrow::field("item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field("item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", arrow::float32(), false, nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }), + false, + nullptr), + arrow::field("from_parent", arrow::boolean(), true, nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer1.hpp b/rerun_cpp/src/datatypes/affix_fuzzer1.hpp index cb10bdd3e067..7ad7270872ff 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer1.hpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer1.hpp @@ -4,12 +4,17 @@ #pragma once #include +#include #include #include #include #include "../datatypes/flattened_scalar.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { struct AffixFuzzer1 { @@ -30,6 +35,10 @@ namespace rr { rr::datatypes::FlattenedScalar almost_flattened_scalar; std::optional from_parent; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer2.cpp b/rerun_cpp/src/datatypes/affix_fuzzer2.cpp index b2c3741712b5..ddfa295cc1e8 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer2.cpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer2.cpp @@ -1,4 +1,14 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs" +#include + #include "affix_fuzzer2.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr AffixFuzzer2::to_arrow_datatype() { + return arrow::float32(); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer2.hpp b/rerun_cpp/src/datatypes/affix_fuzzer2.hpp index d74eeb296f5b..3db3f9b54b7b 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer2.hpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer2.hpp @@ -4,16 +4,25 @@ #pragma once #include +#include #include #include +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { struct AffixFuzzer2 { std::optional single_float_optional; + public: AffixFuzzer2(std::optional single_float_optional) : single_float_optional(std::move(single_float_optional)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer5.cpp b/rerun_cpp/src/datatypes/affix_fuzzer5.cpp index bbf73e7f4f65..3f824c583f2b 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer5.cpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer5.cpp @@ -1,4 +1,241 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs" +#include + #include "affix_fuzzer5.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr AffixFuzzer5::to_arrow_datatype() { + return arrow::struct_({ + arrow::field( + "single_optional_union", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field( + "single_required", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field("many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "many_required", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), + 3), + false, + nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "many_optional", + arrow::list(arrow::field( + "item", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("degrees", arrow::float32(), false, nullptr), + arrow::field("radians", arrow::float32(), false, nullptr), + arrow::field( + "craziness", + arrow::list(arrow::field( + "item", + arrow::struct_({ + arrow::field("single_float_optional", + arrow::float32(), + true, + nullptr), + arrow::field("single_string_required", + arrow::utf8(), + false, + nullptr), + arrow::field("single_string_optional", + arrow::utf8(), + true, + nullptr), + arrow::field( + "many_floats_optional", + arrow::list(arrow::field( + "item", arrow::float32(), true, nullptr)), + true, + nullptr), + arrow::field( + "many_strings_required", + arrow::list(arrow::field( + "item", arrow::utf8(), false, nullptr)), + false, + nullptr), + arrow::field( + "many_strings_optional", + arrow::list(arrow::field( + "item", arrow::utf8(), true, nullptr)), + true, + nullptr), + arrow::field("flattened_scalar", + arrow::float32(), + false, + nullptr), + arrow::field("almost_flattened_scalar", + arrow::struct_({ + arrow::field("value", + arrow::float32(), + false, + nullptr), + }), + false, + nullptr), + arrow::field( + "from_parent", arrow::boolean(), true, nullptr), + }), + false, + nullptr)), + false, + nullptr), + arrow::field( + "fixed_size_shenanigans", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), + 3), + false, + nullptr), + }), + true, + nullptr)), + false, + nullptr), + }), + true, + nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/affix_fuzzer5.hpp b/rerun_cpp/src/datatypes/affix_fuzzer5.hpp index 894d50aa7ada..33d5fdde47b4 100644 --- a/rerun_cpp/src/datatypes/affix_fuzzer5.hpp +++ b/rerun_cpp/src/datatypes/affix_fuzzer5.hpp @@ -4,18 +4,27 @@ #pragma once #include +#include #include #include #include "../datatypes/affix_fuzzer4.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { struct AffixFuzzer5 { std::optional single_optional_union; + public: AffixFuzzer5(std::optional single_optional_union) : single_optional_union(std::move(single_optional_union)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/flattened_scalar.cpp b/rerun_cpp/src/datatypes/flattened_scalar.cpp index da777a65ac63..4b63235d3f5c 100644 --- a/rerun_cpp/src/datatypes/flattened_scalar.cpp +++ b/rerun_cpp/src/datatypes/flattened_scalar.cpp @@ -1,4 +1,16 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs" +#include + #include "flattened_scalar.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr FlattenedScalar::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("value", arrow::float32(), false, nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/flattened_scalar.hpp b/rerun_cpp/src/datatypes/flattened_scalar.hpp index dec5ff7d6c85..0e5ce80b7690 100644 --- a/rerun_cpp/src/datatypes/flattened_scalar.hpp +++ b/rerun_cpp/src/datatypes/flattened_scalar.hpp @@ -4,14 +4,23 @@ #pragma once #include +#include #include +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { struct FlattenedScalar { float value; + public: FlattenedScalar(float value) : value(std::move(value)) {} + + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/mat3x3.cpp b/rerun_cpp/src/datatypes/mat3x3.cpp index e18c178424a8..8f7f6c29e952 100644 --- a/rerun_cpp/src/datatypes/mat3x3.cpp +++ b/rerun_cpp/src/datatypes/mat3x3.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/mat3x3.fbs" +#include + #include "mat3x3.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Mat3x3::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 9); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/mat3x3.hpp b/rerun_cpp/src/datatypes/mat3x3.hpp index 6ba355d6362b..9e605c364223 100644 --- a/rerun_cpp/src/datatypes/mat3x3.hpp +++ b/rerun_cpp/src/datatypes/mat3x3.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A 3x3 column-major Matrix. struct Mat3x3 { float coeffs[9]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/mat4x4.cpp b/rerun_cpp/src/datatypes/mat4x4.cpp index b6959fb113d5..20849bb285ff 100644 --- a/rerun_cpp/src/datatypes/mat4x4.cpp +++ b/rerun_cpp/src/datatypes/mat4x4.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/mat4x4.fbs" +#include + #include "mat4x4.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Mat4x4::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 16); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/mat4x4.hpp b/rerun_cpp/src/datatypes/mat4x4.hpp index d017037a2aa2..2793f21f4be7 100644 --- a/rerun_cpp/src/datatypes/mat4x4.hpp +++ b/rerun_cpp/src/datatypes/mat4x4.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A 4x4 column-major Matrix. struct Mat4x4 { float coeffs[16]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/point2d.cpp b/rerun_cpp/src/datatypes/point2d.cpp index 491e9caf1a78..f14ebac81211 100644 --- a/rerun_cpp/src/datatypes/point2d.cpp +++ b/rerun_cpp/src/datatypes/point2d.cpp @@ -1,4 +1,17 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/point2d.fbs" +#include + #include "point2d.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Point2D::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("x", arrow::float32(), false, nullptr), + arrow::field("y", arrow::float32(), false, nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/point2d.hpp b/rerun_cpp/src/datatypes/point2d.hpp index 48a4aa7b90bf..9d1cb74e9d7b 100644 --- a/rerun_cpp/src/datatypes/point2d.hpp +++ b/rerun_cpp/src/datatypes/point2d.hpp @@ -4,6 +4,11 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { @@ -12,6 +17,10 @@ namespace rr { float x; float y; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/quaternion.cpp b/rerun_cpp/src/datatypes/quaternion.cpp index 4f53f73211b8..fe45f9b29060 100644 --- a/rerun_cpp/src/datatypes/quaternion.cpp +++ b/rerun_cpp/src/datatypes/quaternion.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/quaternion.fbs" +#include + #include "quaternion.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Quaternion::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 4); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/quaternion.hpp b/rerun_cpp/src/datatypes/quaternion.hpp index 45397bb64a2e..11abeed97f9a 100644 --- a/rerun_cpp/src/datatypes/quaternion.hpp +++ b/rerun_cpp/src/datatypes/quaternion.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A Quaternion represented by 4 real numbers. struct Quaternion { float xyzw[4]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/rotation_axis_angle.cpp b/rerun_cpp/src/datatypes/rotation_axis_angle.cpp index 0bd9c59c34d9..8efa7c970b65 100644 --- a/rerun_cpp/src/datatypes/rotation_axis_angle.cpp +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.cpp @@ -1,4 +1,28 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/rotation_axis_angle.fbs" +#include + #include "rotation_axis_angle.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr RotationAxisAngle::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("axis", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + arrow::field("angle", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("Radians", arrow::float32(), false, nullptr), + arrow::field("Degrees", arrow::float32(), false, nullptr), + }), + false, + nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/rotation_axis_angle.hpp b/rerun_cpp/src/datatypes/rotation_axis_angle.hpp index 8c3756ac4624..55ca25b2a8fc 100644 --- a/rerun_cpp/src/datatypes/rotation_axis_angle.hpp +++ b/rerun_cpp/src/datatypes/rotation_axis_angle.hpp @@ -4,10 +4,15 @@ #pragma once #include +#include #include "../datatypes/angle.hpp" #include "../datatypes/vec3d.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { /// 3D rotation represented by a rotation around a given axis. @@ -21,6 +26,10 @@ namespace rr { /// How much to rotate around the axis. rr::datatypes::Angle angle; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp b/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp index ad022e0e890e..ed8ddec2f813 100644 --- a/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.cpp @@ -1,4 +1,26 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/translation_and_mat3x3.fbs" +#include + #include "translation_and_mat3x3.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr TranslationAndMat3x3::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("translation", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + true, + nullptr), + arrow::field("matrix", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 9), + true, + nullptr), + arrow::field("from_parent", arrow::boolean(), false, nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp b/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp index 2395bf4aea83..7f472036de34 100644 --- a/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp +++ b/rerun_cpp/src/datatypes/translation_and_mat3x3.hpp @@ -4,11 +4,16 @@ #pragma once #include +#include #include #include "../datatypes/mat3x3.hpp" #include "../datatypes/vec3d.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { /// Representation of an affine transform via a 3x3 affine matrix paired with a translation. @@ -24,6 +29,10 @@ namespace rr { /// If true, the transform maps from the parent space to the space where the transform /// was logged. Otherwise, the transform maps from the space to its parent. bool from_parent; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp b/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp index aef7743ae545..b827d5e36730 100644 --- a/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.cpp @@ -1,4 +1,67 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/translation_rotation_scale3d.fbs" +#include + #include "translation_rotation_scale3d.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr TranslationRotationScale3D::to_arrow_datatype() { + return arrow::struct_({ + arrow::field("translation", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + true, + nullptr), + arrow::field( + "rotation", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("Quaternion", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 4), + false, + nullptr), + arrow::field( + "AxisAngle", + arrow::struct_({ + arrow::field( + "axis", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + arrow::field( + "angle", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("Radians", arrow::float32(), false, nullptr), + arrow::field("Degrees", arrow::float32(), false, nullptr), + }), + false, + nullptr), + }), + false, + nullptr), + }), + true, + nullptr), + arrow::field( + "scale", + arrow::dense_union({ + arrow::field("_null_markers", arrow::null(), true, nullptr), + arrow::field("ThreeD", + arrow::fixed_size_list( + arrow::field("item", arrow::float32(), false, nullptr), 3), + false, + nullptr), + arrow::field("Uniform", arrow::float32(), false, nullptr), + }), + true, + nullptr), + arrow::field("from_parent", arrow::boolean(), false, nullptr), + }); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp b/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp index c5c8947525c3..023dfbf89238 100644 --- a/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp +++ b/rerun_cpp/src/datatypes/translation_rotation_scale3d.hpp @@ -4,12 +4,17 @@ #pragma once #include +#include #include #include "../datatypes/rotation3d.hpp" #include "../datatypes/scale3d.hpp" #include "../datatypes/vec3d.hpp" +namespace arrow { + class DataType; +} + namespace rr { namespace datatypes { /// Representation of an affine transform via separate translation, rotation & scale. @@ -26,6 +31,10 @@ namespace rr { /// If true, the transform maps from the parent space to the space where the transform /// was logged. Otherwise, the transform maps from the space to its parent. bool from_parent; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/vec2d.cpp b/rerun_cpp/src/datatypes/vec2d.cpp index d2ef2788f2a1..bd54794668be 100644 --- a/rerun_cpp/src/datatypes/vec2d.cpp +++ b/rerun_cpp/src/datatypes/vec2d.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/vec2d.fbs" +#include + #include "vec2d.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Vec2D::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 2); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec2d.hpp b/rerun_cpp/src/datatypes/vec2d.hpp index 91bac0c252c5..50bea24f4e0a 100644 --- a/rerun_cpp/src/datatypes/vec2d.hpp +++ b/rerun_cpp/src/datatypes/vec2d.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A vector in 2D space. struct Vec2D { float xy[2]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/vec3d.cpp b/rerun_cpp/src/datatypes/vec3d.cpp index ae42f43a66de..75eb507d5baf 100644 --- a/rerun_cpp/src/datatypes/vec3d.cpp +++ b/rerun_cpp/src/datatypes/vec3d.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/vec3d.fbs" +#include + #include "vec3d.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Vec3D::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 3); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec3d.hpp b/rerun_cpp/src/datatypes/vec3d.hpp index c65bd08eea12..72fad69ea7a2 100644 --- a/rerun_cpp/src/datatypes/vec3d.hpp +++ b/rerun_cpp/src/datatypes/vec3d.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A vector in 3D space. struct Vec3D { float xyz[3]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/datatypes/vec4d.cpp b/rerun_cpp/src/datatypes/vec4d.cpp index df356cf75a83..819a4ff72902 100644 --- a/rerun_cpp/src/datatypes/vec4d.cpp +++ b/rerun_cpp/src/datatypes/vec4d.cpp @@ -1,4 +1,15 @@ // NOTE: This file was autogenerated by re_types_builder; DO NOT EDIT. // Based on "crates/re_types/definitions/rerun/datatypes/vec4d.fbs" +#include + #include "vec4d.hpp" + +namespace rr { + namespace datatypes { + std::shared_ptr Vec4D::to_arrow_datatype() { + return arrow::fixed_size_list(arrow::field("item", arrow::float32(), false, nullptr), + 4); + } + } // namespace datatypes +} // namespace rr diff --git a/rerun_cpp/src/datatypes/vec4d.hpp b/rerun_cpp/src/datatypes/vec4d.hpp index cebf2e4da04e..f9745ba3aaa2 100644 --- a/rerun_cpp/src/datatypes/vec4d.hpp +++ b/rerun_cpp/src/datatypes/vec4d.hpp @@ -4,12 +4,21 @@ #pragma once #include +#include + +namespace arrow { + class DataType; +} namespace rr { namespace datatypes { /// A vector in 4D space. struct Vec4D { float xyzw[4]; + + public: + /// Returns the arrow data type this type corresponds to. + static std::shared_ptr to_arrow_datatype(); }; } // namespace datatypes } // namespace rr diff --git a/rerun_cpp/src/recording_stream.hpp b/rerun_cpp/src/recording_stream.hpp index eb0883d01dff..dcd4648b9e16 100644 --- a/rerun_cpp/src/recording_stream.hpp +++ b/rerun_cpp/src/recording_stream.hpp @@ -28,6 +28,9 @@ namespace rr { /// Aborts if `init_global` has not yet been called. static RecordingStream global(); + /// Logs raw data row to the recording stream. + /// + /// I.e. logs a number of components arrays (each with a same number of instances) to a single entity path. void log_data_row(const char* entity_path, uint32_t num_instances, size_t num_data_cells, const DataCell* data_cells);