11 #ifndef EVIO_6_0_EVIOCOMPACTREADER_H
12 #define EVIO_6_0_EVIOCOMPACTREADER_H
46 uint32_t evioVersion = 4;
52 std::shared_ptr<ByteBuffer> byteBuffer;
55 size_t initialPosition = 0UL;
61 std::recursive_mutex mtx;
66 std::shared_ptr<IEvioCompactReader> reader;
79 void setBuffer(std::shared_ptr<ByteBuffer> & buf)
override;
96 std::shared_ptr<EvioNode>
getEvent(
size_t eventNumber)
override;
100 void searchEvent(
size_t eventNumber, uint16_t tag, uint8_t num, std::vector<std::shared_ptr<EvioNode>> & vec)
override ;
101 void searchEvent(
size_t eventNumber, std::string
const & dictName,
102 std::shared_ptr<EvioXMLDictionary> & dictionary,
103 std::vector<std::shared_ptr<EvioNode>> & vec)
override ;
105 std::shared_ptr<ByteBuffer>
removeEvent(
size_t eventNumber)
override;
106 std::shared_ptr<ByteBuffer>
removeStructure(std::shared_ptr<EvioNode> & removeNode)
override;
109 std::shared_ptr<ByteBuffer>
getData(std::shared_ptr<EvioNode> & node)
override;
110 std::shared_ptr<ByteBuffer>
getData(std::shared_ptr<EvioNode> & node,
bool copy)
override;
112 std::shared_ptr<ByteBuffer>
getData(std::shared_ptr<EvioNode> & node,
113 std::shared_ptr<ByteBuffer> & buf)
override;
114 std::shared_ptr<ByteBuffer>
getData(std::shared_ptr<EvioNode> & node,
115 std::shared_ptr<ByteBuffer> & buf,
bool copy)
override;
117 std::shared_ptr<ByteBuffer>
getEventBuffer(
size_t eventNumber)
override;
118 std::shared_ptr<ByteBuffer>
getEventBuffer(
size_t eventNumber,
bool copy)
override;
120 std::shared_ptr<ByteBuffer>
getStructureBuffer(std::shared_ptr<EvioNode> & node)
override;
121 std::shared_ptr<ByteBuffer>
getStructureBuffer(std::shared_ptr<EvioNode> & node,
bool copy)
override;
123 void close()
override;
128 void toFile(std::string
const & fileName)
override;
135 #endif //EVIO_6_0_EVIOCOMPACTREADER_H
This class is copied from one of the same name in the Java programming language.
Definition: ByteBuffer.h:42
This class is used to read an evio formatted file or buffer and extract specific evio containers (ban...
Definition: EvioCompactReader.h:41
std::string getDictionaryXML() override
Get the XML format dictionary is there is one.if object closed and dictionary still unread XML format...
Definition: EvioCompactReader.cpp:143
std::shared_ptr< EvioNode > getEvent(size_t eventNumber) override
Get the EvioNode object associated with a particular event number.number of event (place in file/buff...
Definition: EvioCompactReader.cpp:175
bool hasDictionary() override
Does this evio file have an associated XML dictionary?true if this evio file has an associated XML di...
Definition: EvioCompactReader.cpp:163
bool isCompressed() override
Is the data in the file/buffer compressed?true if data is compressed.
Definition: EvioCompactReader.cpp:109
uint32_t getEventCount() override
This is the number of events in the file/buffer.Any dictionary event is not included in the count...
Definition: EvioCompactReader.cpp:340
bool isFile() override
Is this reader reading a file?true if reading file, false if reading buffer
Definition: EvioCompactReader.cpp:105
size_t fileSize() override
Get the size of the file being read, in bytes.For small files, obtain the file size using the memory ...
Definition: EvioCompactReader.cpp:171
void close() override
This sets the position to its initial value and marks reader as closed.
Definition: EvioCompactReader.cpp:330
void toFile(std::string const &fileName) override
Save the internal byte buffer to the given file (overwrites existing file).name of file to write if e...
Definition: EvioCompactReader.cpp:348
Numerical values associated with endian byte order.
Definition: ByteOrder.h:53
void searchEvent(size_t eventNumber, uint16_t tag, uint8_t num, std::vector< std::shared_ptr< EvioNode >> &vec) override
This method searches the specified event in a file/buffer and returns a vector of objects each of whi...
Definition: EvioCompactReader.cpp:193
std::shared_ptr< EvioNode > getScannedEvent(size_t eventNumber) override
Get the EvioNode object associated with a particular event number which has been scanned so all subst...
Definition: EvioCompactReader.cpp:181
std::shared_ptr< IBlockHeader > getFirstBlockHeader() override
This returns the FIRST block (or record) header.(Not the file header of evio version 6+ files)...
Definition: EvioCompactReader.cpp:187
void setBuffer(std::shared_ptr< ByteBuffer > &buf) override
This method can be used to avoid creating additional EvioCompactReader objects by reusing this one wi...
Definition: EvioCompactReader.cpp:113
std::shared_ptr< ByteBuffer > removeEvent(size_t eventNumber) override
This method removes the data of the given event from the buffer.It also marks any existing EvioNodes ...
Definition: EvioCompactReader.cpp:216
std::string getPath() override
Get the path to the file.path to the file
Definition: EvioCompactReader.cpp:135
std::shared_ptr< ByteBuffer > getByteBuffer() override
Get the byte buffer being read directly or corresponding to the event file.the byte buffer being read...
Definition: EvioCompactReader.cpp:167
std::shared_ptr< ByteBuffer > getStructureBuffer(std::shared_ptr< EvioNode > &node) override
Get an evio structure (bank, seg, or tagseg) in ByteBuffer form.The returned buffer is a view into th...
Definition: EvioCompactReader.cpp:310
uint32_t getBlockCount() override
This is the number of blocks in the file/buffer including the empty block at the end.the number of blocks in the file/buffer (estimate for version 3 files)
Definition: EvioCompactReader.cpp:344
std::shared_ptr< ByteBuffer > addStructure(size_t eventNumber, ByteBuffer &addBuffer) override
This method adds an evio container (bank, segment, or tag segment) as the last structure contained in...
Definition: EvioCompactReader.cpp:236
std::shared_ptr< ByteBuffer > getData(std::shared_ptr< EvioNode > &node) override
Get the data associated with an evio structure in ByteBuffer form.The returned buffer is a view into ...
Definition: EvioCompactReader.cpp:246
ByteOrder getFileByteOrder() override
When reading a file, this method's return value is the byte order of the evio data in the file...
Definition: EvioCompactReader.cpp:139
std::shared_ptr< EvioXMLDictionary > getDictionary() override
Get the evio dictionary if is there is one.if object closed and dictionary still unread evio dictiona...
Definition: EvioCompactReader.cpp:153
This is an interface for a compact reader of evio format files and buffers.
Definition: IEvioCompactReader.h:41
ByteOrder getByteOrder() override
Get the byte order of the file/buffer being read.byte order of the file/buffer being read...
Definition: EvioCompactReader.cpp:127
uint32_t getEvioVersion() override
Get the evio version number.evio version number.
Definition: EvioCompactReader.cpp:131
std::shared_ptr< ByteBuffer > removeStructure(std::shared_ptr< EvioNode > &removeNode) override
This method removes the data, represented by the given node, from the buffer.It also marks the node a...
Definition: EvioCompactReader.cpp:226
std::shared_ptr< ByteBuffer > getEventBuffer(size_t eventNumber) override
Get an evio bank or event in ByteBuffer form.The returned buffer is a view into the data of this read...
Definition: EvioCompactReader.cpp:290
EvioCompactReader(std::string const &path, bool sync=false)
Constructor for reading an event file.
Definition: EvioCompactReader.cpp:27
static const ByteOrder ENDIAN_LOCAL
Local host's byte order.
Definition: ByteOrder.h:61
bool isClosed() override
Has close() been called (without reopening by calling setBuffer(std::shared_ptr<ByteBuffer> &))...
Definition: EvioCompactReader.cpp:117