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

Add visit-like pattern for RecordComponent #1544

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Oct 20, 2023

Close #1372

TODO:

  • Once we agree on a design, add some further examples

This adds:

  1. std::variant<...> aliases for openPMD datatypes
  2. A RecordComponent::visit(...) call that instantiates the passed Functor Template Object with the current type of the RecordComponent
  3. Using 1. and 2., a RecordComponent::loadChunkVariant() call that returns a std::variant<...> of shared_ptr types

@franzpoeschel franzpoeschel added frontend: C++17 api: new additions to the API labels Oct 20, 2023
include/openPMD/RecordComponent.tpp Dismissed Show dismissed Hide dismissed
include/openPMD/RecordComponent.tpp Fixed Show fixed Hide fixed
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@ax3l ax3l merged commit b131cd2 into openPMD:dev Dec 22, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: new additions to the API frontend: C++17
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A Variant-Based LoadChunk
2 participants