Skip to content

Add rfl::AddNamespacedTagsToVariants for rfl::Generic and same-name-different-namespace structs#494

Merged
liuzicheng1987 merged 5 commits into
getml:mainfrom
DynonAvionics:fix_467_w_shared_code_paths
Sep 11, 2025
Merged

Add rfl::AddNamespacedTagsToVariants for rfl::Generic and same-name-different-namespace structs#494
liuzicheng1987 merged 5 commits into
getml:mainfrom
DynonAvionics:fix_467_w_shared_code_paths

Conversation

@bryceschober
Copy link
Copy Markdown
Contributor

@bryceschober bryceschober commented Sep 9, 2025

As an alternative to #467, I offer this draft proposal.

Details:

  • Add a separate rfl::AddNamespacedTagsToVariants processor to support the usage of rfl::Generic directly in auto-tagged variants.
  • Reuse code paths for rfl::AddTagsToVariants by adding a defaulted non-type template parameter to rfl::VariantAlternativeWrapper
  • Build a set of robust and parallel test suites for all 4 combinations of variant auto-tagging
  • Rename the previously-existing variant-tagging test files to better match the processor name.

Outstanding items:

  • Update documentation to cover the new functionality and use-cases.
  • Is adding the parallel processor's functionalty to the existing AddTagsToVariants.hpp and is_add_tags_to_variants_v.hpp acceptable? Those files were named specifically matching the old processor, and now I've added to them.

to support use-cases with multiple `rfl::Generic` types in a single variant or where the same typename exists in multiple namespaces.
Comment thread include/rfl/Processors.hpp
@liuzicheng1987
Copy link
Copy Markdown
Contributor

@bryceschober , other than the one comment I made, which you can basically just copy + paste, I like this very much. This is basically ready to be merged.

Added test utility helpers for detailed CBOR encoding expectations,
using the annotated hex format from https://cbor.me and other tools
@bryceschober
Copy link
Copy Markdown
Contributor Author

@liuzicheng1987 I've implemented your requested static_assert().

I also added CBOR test coverage representative of our use-case, and using a new method of detailed CBOR test expectations that I think will be more practical going forward. It kinda sucks to depend on outside tooling like https://cbor.me, but it's also relatively easy to use and help connect the dots with the test failure formatter I implemented.

@liuzicheng1987
Copy link
Copy Markdown
Contributor

@bryceschober thank you!

@liuzicheng1987 liuzicheng1987 merged commit d33a4f5 into getml:main Sep 11, 2025
146 checks passed
@bryceschober bryceschober deleted the fix_467_w_shared_code_paths branch September 11, 2025 21:01
@jmcken8
Copy link
Copy Markdown
Contributor

jmcken8 commented Sep 22, 2025

Looks good to me, thanks for doing this work @bryceschober

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants