Skip to content

Implement Reader iterator for data files

Jolie Roiseux requested to merge feature/reader-iterator into develop

Context

Allow the user to iterate through each Waveform, returning an Event for each iteration. The code to iterate through the Waveform is in DataFile's child classes, and not directly accessed by the RunManager. Different devices only need to implement a getNextWaveform() method in order to make use of the same ReaderIterator.

Summary

A ReaderIterator is created by the specific Reader (eg. V1730Reader) using the createIterator() method. This reader inherits from the new Reader class. The Reader loops through each Channel and returns a vector of Channels to the ReaderIterator. Each Event is then returned by using the getCurrent() and next() methods on the ReaderIterator while checking if isDone(). For each iteration, an Event is returned with a vector of Channels (depending on the number of Channels in the configuration), and each Channel contains a Waveform and an empty vector of Pulses.

How was this tested?

The WaveformProcessor has been modified to use the iterator in the readNextWaveform() function. When running the compiled code, everything should work as usual.

Edited by Andrei Muresan

Merge request reports

Loading