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

feat: get the index of a bank in hipo::banklist, given its name #65

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

c-dilks
Copy link
Contributor

@c-dilks c-dilks commented Oct 25, 2024

This is for convenience, for users that have a large banklist. Usage example:

hipo::reader reader("data.hipo");
hipo::banklist banks = reader.getBanks({
  "bank::zero",
  "bank::one",
  "bank::two",
  "bank::three",
  "bank::four",
  "bank::five"});
auto i_three = hipo::getBanklistIndex(banks, "bank::three"); // returns 3

Don't use this in an event loop, rather use it beforehand.

This is for convenience, for users how have a large banklist. Usage
example:
```cpp
hipo::reader reader("data.hipo");
hipo::banklist banks = reader.getBanks({
  "bank::zero",
  "bank::one",
  "bank::two",
  "bank::three",
  "bank::four",
  "bank::five"});
auto i_three = hipo::getBanklistIndex(banks, "bank::three"); // returns 3
```
Don't use this in an event loop, rather use it beforehand.
c-dilks added a commit to JeffersonLab/iguana that referenced this pull request Oct 25, 2024
@gavalian gavalian self-requested a review November 5, 2024 21:37
@gavalian gavalian merged commit 5add7c5 into gavalian:master Nov 5, 2024
5 checks passed
c-dilks added a commit to JeffersonLab/iguana that referenced this pull request Nov 19, 2024
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.

2 participants