gavalian / hipo

High Performance Output Data format for experimental Physics
2 stars 9 forks source link

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

Closed c-dilks closed 3 weeks ago

c-dilks commented 1 month ago

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.