Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ codegen arrow serialize non-union components/datatypes without nested rerun types #2820

Merged
merged 20 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ BasedOnStyle: Google
# Make it slightly more similar to Rust.
# Based loosely on https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AllowAllArgumentsOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
Expand All @@ -19,9 +21,9 @@ InsertTrailingCommas: Wrapped
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: true
SeparateDefinitionBlocks: Always
SpacesBeforeTrailingComments: 1
ReflowComments: true

# Don't change include blocks, we want to control this manually.
# Sorting headers however is allowed as all our headers should be standalone.
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types_builder/src/codegen/cpp/forward_decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct ForwardDecls {
}

impl ForwardDecls {
#[allow(dead_code)]
pub fn insert(&mut self, namespace: impl Into<String>, decl: ForwardDecl) {
self.declarations_per_namespace
.entry(namespace.into())
Expand Down
6 changes: 4 additions & 2 deletions crates/re_types_builder/src/codegen/cpp/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use quote::quote;

use crate::Docs;

use super::{doc_comment, quote_docstrings, NEWLINE_TOKEN};
use super::{quote_doc_comment, quote_docstrings, NEWLINE_TOKEN};

#[derive(Default)]
pub struct MethodDeclaration {
Expand Down Expand Up @@ -82,7 +82,7 @@ impl quote::ToTokens for MethodDocumentation {
match self {
Self::None => {}
Self::String(s) => {
tokens.extend(doc_comment(s));
tokens.extend(quote_doc_comment(s));
}
Self::Docs(docs) => tokens.extend(quote_docstrings(docs)),
}
Expand Down Expand Up @@ -125,12 +125,14 @@ impl Method {
#declaration {
#definition_body
}
#NEWLINE_TOKEN
}
} else {
quote! {
#NEWLINE_TOKEN
#docs
#declaration;
#NEWLINE_TOKEN
}
}
}
Expand Down