11 #ifndef EVIO_6_0_FILEEVENTINDEX_H
12 #define EVIO_6_0_FILEEVENTINDEX_H
38 uint32_t currentEvent = 0;
42 uint32_t currentRecord = 0;
45 uint32_t currentRecordEvent = 0;
55 std::vector<uint32_t> recordIndex;
80 int main(
int argc,
char **argv);
88 #endif //EVIO_6_0_FILEEVENTINDEX_H
void resetIndex()
Resets the current index to 0.
Definition: FileEventIndex.cpp:28
uint32_t getMaxEvents() const
Gets the total number of events in file.
Definition: FileEventIndex.cpp:82
bool advance()
Advances the current event number by one.
Definition: FileEventIndex.cpp:105
bool retreat()
Reduces current event number by one.
Definition: FileEventIndex.cpp:145
void addEventSize(uint32_t size)
Adds the number of events in the next record to the index of records.
Definition: FileEventIndex.cpp:40
uint32_t getRecordNumber() const
Gets the current record number which is set by setEvent(uint32_t), or by using advance() or retreat()...
Definition: FileEventIndex.cpp:67
void clear()
Clear the entire object.
Definition: FileEventIndex.cpp:18
std::string toString()
Get a string representation of this object.
Definition: FileEventIndex.cpp:221
Class used to handle event indexes in the context of a file (or buffer) and having to change records...
Definition: FileEventIndex.h:33
bool setEvent(uint32_t event)
Set the current event to the desired position.
Definition: FileEventIndex.cpp:184
uint32_t getEventNumber() const
Gets the current event number which is set by advance(), retreat() or setEvent(uint32_t) (which also ...
Definition: FileEventIndex.cpp:58
void show()
Prints the content of the event index array on the screen.
Definition: FileEventIndex.cpp:164
bool canAdvance() const
Checks to see if the event counter reached the end.
Definition: FileEventIndex.cpp:91
FileEventIndex()=default
Constructor.
bool canRetreat() const
Checks if the event index can retreat (decrease).
Definition: FileEventIndex.cpp:136
uint32_t getRecordEventNumber() const
Gets the event number inside the record that corresponds to the current global event number from the ...
Definition: FileEventIndex.cpp:75
int main(int argc, char **argv)
Definition: FileEventIndex.cpp:234