Open alexxcons opened 2 years ago
The number of (enabled) AI/DI ports on the Digitizer on different occasions is counted by looping on all AI's / DI's. Here an example:
Instead, provide a method which returns the number
Your assessment is correct and std::accumulate is your friend, e.g.
auto nEnabled = std::accumulate(V.begin(), V.end(), 0, [](int a, int b){ return pred(b) ? a+b: a; });
The quoted code is pre-C++11 and C-like which we should start modernising ...
The number of (enabled) AI/DI ports on the Digitizer on different occasions is counted by looping on all AI's / DI's. Here an example:
https://github.com/fair-acc/gr-digitizers/blob/19061f72b1f07717a7ff8694df0d9eaacead3bf4/lib/digitizer_block_impl.cc#L615-L626
Instead, provide a method which returns the number