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

Introduce range wrapper for OneToManyRelations and VectorMembers #107

Merged
merged 2 commits into from
Aug 3, 2020

Conversation

tmadlener
Copy link
Collaborator

@tmadlener tmadlener commented Jun 24, 2020

BEGINRELEASENOTES

  • Introduce range wrapper for OneToManyRelations and VectorMembers to allow range-based for loops

ENDRELEASENOTES

Requires #106
Fixes #61

Currently to loop over related objects one has to do something like this

ExampleMC mcp;
// fill with some daughters
for (auto it = mcp.daughters_begin(); it != mcp.daughters_end(); ++it) {
  // ...
}

A podio::RelationRange is introduced here. It provides begin and end and allows for range-based for loops:

ExampleMC mcp;
// fill with some daughters
for (const auto& p : mcp.daughters()) {
  // ...
}

The tests that come with this break, because #105 needs to be fixed first (by #106)

@tmadlener
Copy link
Collaborator Author

Fixes #61

@tmadlener tmadlener mentioned this pull request Jun 29, 2020
7 tasks
@gaede gaede merged commit 1e1777a into AIDASoft:master Aug 3, 2020
@tmadlener tmadlener deleted the podio-range branch August 5, 2020 08:18
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.

Add possibility to use range based for loops on relations and vector members
2 participants