11 #ifndef EVIO_6_0_EVIOREADER_H
12 #define EVIO_6_0_EVIOREADER_H
57 uint32_t evioVersion = 4;
63 std::shared_ptr<ByteBuffer> byteBuffer;
66 size_t initialPosition = 0;
69 std::shared_ptr<IEvioReader> reader;
74 explicit EvioReader(std::string
const & path,
bool checkRecNumSeq =
false,
bool synced =
false);
77 explicit EvioReader(std::shared_ptr<ByteBuffer> & bb,
bool checkRecNumSeq =
false,
bool synced =
false);
81 void setBuffer(std::shared_ptr<ByteBuffer> & buf)
override;
87 std::shared_ptr<EventParser> &
getParser()
override;
88 void setParser(std::shared_ptr<EventParser> & evParser)
override;
101 std::shared_ptr<EvioEvent>
getEvent(
size_t index)
override;
102 std::shared_ptr<EvioEvent>
parseEvent(
size_t index)
override;
103 std::shared_ptr<EvioEvent>
nextEvent()
override;
105 void parseEvent(std::shared_ptr<EvioEvent> evioEvent)
override;
108 static std::shared_ptr<EvioEvent>
getEvent(uint8_t * src,
size_t len,
ByteOrder const & order);
109 static std::shared_ptr<EvioEvent>
parseEvent(uint8_t * src,
size_t len,
ByteOrder const & order) ;
112 uint32_t
getEventArray(
size_t evNumber, std::vector<uint8_t> & vec)
override;
117 void close()
override;
128 #endif //EVIO_6_0_EVIOREADER_H
ssize_t position() override
This is equivalent to obtaining the current position in the file.What it actually does is return the ...
Definition: EvioReader.cpp:269
This class is copied from one of the same name in the Java programming language.
Definition: ByteBuffer.h:42
std::shared_ptr< EvioEvent > nextEvent() override
Get the next event in the file/buffer.As useful as this sounds, most applications will probably call ...
Definition: EvioReader.cpp:175
size_t fileSize() override
Get the size of the file being read, in bytes.the file size in bytes
Definition: EvioReader.cpp:161
std::shared_ptr< EvioEvent > parseNextEvent() override
This is a workhorse method.It retrieves the next event from the file/buffer, and then parses it SAX-l...
Definition: EvioReader.cpp:179
std::shared_ptr< EvioEvent > gotoEventNumber(size_t evNumber) override
Go to a specific event in the file.The events are numbered 1..N. This number is transient–it is not p...
Definition: EvioReader.cpp:278
void close() override
This is closes the file, but for buffers it only sets the position to 0.
Definition: EvioReader.cpp:272
void setBuffer(std::shared_ptr< ByteBuffer > &buf) override
This method can be used to avoid creating additional EvioReader objects by reusing this one with anot...
Definition: EvioReader.cpp:119
std::string getDictionaryXML() override
Get the XML format dictionary if there is one.XML format dictionary, else null.
Definition: EvioReader.cpp:143
Numerical values associated with endian byte order.
Definition: ByteOrder.h:53
std::shared_ptr< EventParser > & getParser() override
Get the file/buffer parser.file/buffer parser.
Definition: EvioReader.cpp:137
size_t getNumEventsRemaining() override
Get the number of events remaining in the file.Useful only if doing a sequential read.number of events remaining in the file if failed reading from file
Definition: EvioReader.cpp:155
void setParser(std::shared_ptr< EventParser > &evParser) override
Set the file/buffer parser.file/buffer parser.
Definition: EvioReader.cpp:140
size_t getBlockCount() override
This is the number of blocks/records in the file/buffer including the empty block, record or trailer at the end.if object closed. the number of records in the file/buffer (estimate for version 3 files).
Definition: EvioReader.cpp:286
This pure, virtual class is meant to encapsulate the operation of reading both 2 differently formatte...
Definition: IEvioReader.h:39
std::shared_ptr< IBlockHeader > getFirstBlockHeader() override
This returns the FIRST block (record) header.the first block (record) header.
Definition: EvioReader.cpp:164
ByteOrder & getByteOrder() override
Get the byte order of the file/buffer being read.byte order of the file/buffer being read...
Definition: EvioReader.cpp:128
bool checkBlockNumberSequence() override
Is this reader checking the block number sequence and throwing an exception if it's not sequential an...
Definition: EvioReader.cpp:125
uint32_t getEventBuffer(size_t evNumber, ByteBuffer &buf) override
Get an evio bank or event in ByteBuffer form.number of event of interest buffer to contain bank's/eve...
Definition: EvioReader.cpp:261
bool hasDictionaryXML() override
Does this evio file have an associated XML dictionary?true if this evio file has an associated XML di...
Definition: EvioReader.cpp:146
std::shared_ptr< EvioEvent > getEvent(size_t index) override
Get the event in the file/buffer at a given index (starting at 1).As useful as this sounds...
Definition: EvioReader.cpp:167
std::shared_ptr< IBlockHeader > getCurrentBlockHeader() override
This returns the current (active) block (physical record) header.Since most users have no interest in...
Definition: EvioReader.cpp:275
std::shared_ptr< ByteBuffer > getByteBuffer() override
Get the byte buffer being read.Not useful when reading files. the byte buffer being read (in certain ...
Definition: EvioReader.cpp:158
EvioReader(std::string const &path, bool checkRecNumSeq=false, bool synced=false)
Constructor for reading an event file.
Definition: EvioReader.cpp:38
void rewind() override
The equivalent of rewinding the file.What it actually does is set the position of the file/buffer bac...
Definition: EvioReader.cpp:266
uint32_t getEventArray(size_t evNumber, std::vector< uint8_t > &vec) override
Get an evio bank or event in vector-of-bytes form.number of event of interest (starting at 1)...
Definition: EvioReader.cpp:256
std::shared_ptr< EvioEvent > parseEvent(size_t index) override
This is a workhorse method.It retrieves the desired event from the file/buffer, and then parses it SA...
Definition: EvioReader.cpp:171
size_t getEventCount() override
This is the number of events in the file/buffer.Any dictionary or first event are not included in the...
Definition: EvioReader.cpp:283
uint32_t getEvioVersion() override
Get the evio version number.evio version number.
Definition: EvioReader.cpp:131
bool hasFirstEvent() override
Does this evio file have an associated first event? It's also called the Beginning-Of-Run event...
Definition: EvioReader.cpp:152
bool isClosed() override
Has close() been called (without reopening by calling setBuffer(std::shared_ptr<ByteBuffer> &))...
Definition: EvioReader.cpp:122
std::shared_ptr< EvioEvent > getFirstEvent() override
Get the "first" event if there is one.It's also called the Beginning-Of-Run event. This event is defined once but included in each of the related split files written out. the first event is it existed, else null.
Definition: EvioReader.cpp:149
std::string getPath() override
Get the path to the file.path to the file
Definition: EvioReader.cpp:134
static const ByteOrder ENDIAN_LOCAL
Local host's byte order.
Definition: ByteOrder.h:61
This is a class of interest to the user.
Definition: EvioReader.h:52