HIPO4 C++ Library 4.4.1
Columnar I/O library for CLAS12 physics data
Loading...
Searching...
No Matches
hipo::readerIndex Class Reference

READER index class is used to construct entire events sequence from all records, and provides ability to canAdvance through events where record number is automatically calculated and triggers reading of the next record when events in the current record are exhausted. More...

#include <reader.h>

Public Member Functions

 readerIndex ()=default
 
 ~readerIndex ()=default
 
bool canAdvance ()
 Checks to determine if there are events left in the index buffer.
 
bool advance ()
 Advances the event pointer to next.
 
bool canAdvanceInRecord ()
 Checks to verify if the next event is in the same record as current one.
 
bool loadRecord (int irec)
 Implemented by Derek for clas12tool purposes (I think - therefore I am)
 
bool gotoEvent (int eventNumber)
 Moves the event pointer to give event number.
 
bool gotoRecord (int irec)
 Sets the event pointer to the first even of provided record.
 
int getEventNumber ()
 
int getRecordNumber ()
 
int getRecordEventNumber ()
 
int getMaxEvents ()
 Returns maximum number of events available to read.
 
void addSize (int size)
 Adds record size (number of events) to the list of records.
 
void addPosition (long position)
 
long getPosition (int index)
 
int getNRecords () const
 
void show ()
 
void rewind ()
 
void clear ()
 
void reset ()
 

Detailed Description

READER index class is used to construct entire events sequence from all records, and provides ability to canAdvance through events where record number is automatically calculated and triggers reading of the next record when events in the current record are exhausted.

Constructor & Destructor Documentation

◆ readerIndex()

hipo::readerIndex::readerIndex ( )
default

◆ ~readerIndex()

hipo::readerIndex::~readerIndex ( )
default

Member Function Documentation

◆ canAdvance()

bool hipo::readerIndex::canAdvance ( )

Checks to determine if there are events left in the index buffer.

Returns
true - if there are available events, false - otherwise

◆ advance()

bool hipo::readerIndex::advance ( )

Advances the event pointer to next.

If the next event is in a different record the record number is updated and events number in the record is updated.

Returns
true - if the the next event is available, false - otherwise

◆ canAdvanceInRecord()

bool hipo::readerIndex::canAdvanceInRecord ( )

Checks to verify if the next event is in the same record as current one.

Not sure why Derek needed it ;-), but may be it's useful

Returns
true - if the next event is in the same record, false - otherwise

◆ loadRecord()

bool hipo::readerIndex::loadRecord ( int  irec)

Implemented by Derek for clas12tool purposes (I think - therefore I am)

◆ gotoEvent()

bool hipo::readerIndex::gotoEvent ( int  eventNumber)

Moves the event pointer to give event number.

The record number and relative event number in the record are recalculated.

Parameters
eventnumber to jump to
Returns
true - if event number is valid event, false - otherwise

◆ gotoRecord()

bool hipo::readerIndex::gotoRecord ( int  irec)

Sets the event pointer to the first even of provided record.

Originally implemenet by Derek as loadRecord(), I changed the name to keep naming consistent, but left the old one not to break clas12root code.

Parameters
irec- the record number to jump to
Returns
true - if the provided record is valid, false - otherwise

◆ getEventNumber()

int hipo::readerIndex::getEventNumber ( )
inline

◆ getRecordNumber()

int hipo::readerIndex::getRecordNumber ( )
inline

◆ getRecordEventNumber()

int hipo::readerIndex::getRecordEventNumber ( )
inline

◆ getMaxEvents()

int hipo::readerIndex::getMaxEvents ( )

Returns maximum number of events available to read.

Returns
maximum number of events.

◆ addSize()

void hipo::readerIndex::addSize ( int  size)

Adds record size (number of events) to the list of records.

◆ addPosition()

void hipo::readerIndex::addPosition ( long  position)
inline

◆ getPosition()

long hipo::readerIndex::getPosition ( int  index)
inline

◆ getNRecords()

int hipo::readerIndex::getNRecords ( ) const
inline

◆ show()

void hipo::readerIndex::show ( )

◆ rewind()

void hipo::readerIndex::rewind ( )
inline

◆ clear()

void hipo::readerIndex::clear ( )
inline

◆ reset()

void hipo::readerIndex::reset ( )
inline

The documentation for this class was generated from the following files: