evio
6.0
|
The createXXX methods exist is in the EventParser class in the original Java, but must be moved in C++ to avoid a circular reference to BaseStructure. More...
#include <EventHeaderParser.h>
Static Public Member Functions | |
static std::shared_ptr < BankHeader > | createBankHeader (uint8_t *bytes, ByteOrder const &byteOrder) |
Create a bank header from the first eight bytes of the data array. More... | |
static std::shared_ptr < SegmentHeader > | createSegmentHeader (uint8_t *bytes, ByteOrder const &byteOrder) |
Create a segment header from the first four bytes of the data array. More... | |
static std::shared_ptr < TagSegmentHeader > | createTagSegmentHeader (uint8_t *bytes, ByteOrder const &byteOrder) |
Create a tag segment header from the first four bytes of the data array. More... | |
static void | swapBankHeader (std::shared_ptr< EvioNode > &node, std::shared_ptr< ByteBuffer > &srcBuffer, std::shared_ptr< ByteBuffer > &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio bank header. More... | |
static void | swapBankHeader (EvioNode &node, ByteBuffer &srcBuffer, ByteBuffer &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio bank header. More... | |
static void | swapSegmentHeader (std::shared_ptr< EvioNode > &node, std::shared_ptr< ByteBuffer > &srcBuffer, std::shared_ptr< ByteBuffer > &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio segment header. More... | |
static void | swapSegmentHeader (EvioNode &node, ByteBuffer &srcBuffer, ByteBuffer &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio segment header. More... | |
static void | swapTagSegmentHeader (std::shared_ptr< EvioNode > &node, std::shared_ptr< ByteBuffer > &srcBuffer, std::shared_ptr< ByteBuffer > &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio tagsegment header. More... | |
static void | swapTagSegmentHeader (EvioNode &node, ByteBuffer &srcBuffer, ByteBuffer &destBuffer, uint32_t srcPos, uint32_t destPos) |
This method reads and swaps an evio tagsegment header. More... | |
The createXXX methods exist is in the EventParser class in the original Java, but must be moved in C++ to avoid a circular reference to BaseStructure.
Also methods for swapping headers was moved here from Java's ByteDataTransformer class. Although they would fit in the Util class, it seems more appropriate to put them here.
|
inlinestatic |
Create a bank header from the first eight bytes of the data array.
bytes | the byte array, probably from a bank that encloses this new bank. |
byteOrder | byte order of array, ByteOrder#ENDIAN_BIG or ByteOrder#ENDIAN_LITTLE. |
EvioException | if data not in evio format. |
References evio::Util::toIntArray().
Referenced by evio::CompositeData::parse(), and evio::CompositeData::swapAll().
|
inlinestatic |
Create a segment header from the first four bytes of the data array.
bytes | the byte array, probably from a bank that encloses this new segment. |
byteOrder | byte order of array, ByteOrder#ENDIAN_BIG or ByteOrder#ENDIAN_LITTLE. |
EvioException | if data not in evio format. |
References evio::Util::toIntArray().
|
inlinestatic |
Create a tag segment header from the first four bytes of the data array.
bytes | the byte array, probably from a bank that encloses this new tag segment. |
byteOrder | byte order of array, ByteOrder#ENDIAN_BIG or ByteOrder#ENDIAN_LITTLE. |
EvioException | if data not in evio format. |
References evio::Util::toIntArray().
Referenced by evio::CompositeData::parse(), and evio::CompositeData::swapAll().
|
inlinestatic |
This method reads and swaps an evio bank header.
It can also return information about the bank. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the bank in destBuffer after swap. |
srcBuffer | buffer containing bank header to be swapped. |
destBuffer | buffer in which to place swapped bank header. |
srcPos | position in srcBuffer to start reading bank header. |
destPos | position in destBuffer to start writing swapped bank header. |
EvioException | if srcBuffer data underflow; if destBuffer is too small to contain swapped data; srcBuffer and destBuffer have same byte order. |
Referenced by evio::CompositeData::swapAll().
|
inlinestatic |
This method reads and swaps an evio bank header.
It can also return information about the bank. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the bank in destBuffer after swap. |
srcBuffer | buffer containing bank header to be swapped. |
destBuffer | buffer in which to place swapped bank header. |
srcPos | position in srcBuffer to start reading bank header. |
destPos | position in destBuffer to start writing swapped bank header. |
EvioException | if srcBuffer data underflow; if destBuffer is too small to contain swapped data; srcBuffer and destBuffer have same byte order. |
References evio::ByteBuffer::getInt(), evio::ByteBuffer::order(), and evio::ByteBuffer::putInt().
|
inlinestatic |
This method reads and swaps an evio segment header.
It can also return information about the segment. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the segment in destBuffer after swap; may be null |
srcBuffer | buffer containing segment header to be swapped |
destBuffer | buffer in which to place swapped segment header |
srcPos | position in srcBuffer to start reading segment header |
destPos | position in destBuffer to start writing swapped segment header |
EvioException | if srcBuffer data underflow; if destBuffer is too small to contain swapped data; srcBuffer and destBuffer have same byte order. |
|
inlinestatic |
This method reads and swaps an evio segment header.
It can also return information about the segment. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the segment in destBuffer after swap; may be null |
srcBuffer | buffer containing segment header to be swapped |
destBuffer | buffer in which to place swapped segment header |
srcPos | position in srcBuffer to start reading segment header |
destPos | position in destBuffer to start writing swapped segment header |
EvioException | if srcBuffer data underflow; if destBuffer is too small to contain swapped data; srcBuffer and destBuffer have same byte order. |
References evio::ByteBuffer::getInt(), evio::ByteBuffer::order(), and evio::ByteBuffer::putInt().
|
inlinestatic |
This method reads and swaps an evio tagsegment header.
It can also return information about the tagsegment. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the tagsegment in destBuffer after swap; may be null |
srcBuffer | buffer containing tagsegment header to be swapped |
destBuffer | buffer in which to place swapped tagsegment header |
srcPos | position in srcBuffer to start reading tagsegment header |
destPos | position in destBuffer to start writing swapped tagsegment header |
EvioException | if srcBuffer is not properly formatted; if destBuffer is too small to contain swapped data |
Referenced by evio::CompositeData::swapAll().
|
inlinestatic |
This method reads and swaps an evio tagsegment header.
It can also return information about the tagsegment. Position and limit of neither buffer argument is changed.
This only swaps data if buffer arguments have opposite byte order!
node | object in which to store data about the tagsegment in destBuffer after swap; may be null |
srcBuffer | buffer containing tagsegment header to be swapped |
destBuffer | buffer in which to place swapped tagsegment header |
srcPos | position in srcBuffer to start reading tagsegment header |
destPos | position in destBuffer to start writing swapped tagsegment header |
EvioException | if srcBuffer is not properly formatted; if destBuffer is too small to contain swapped data |
References evio::ByteBuffer::getInt(), evio::ByteBuffer::order(), and evio::ByteBuffer::putInt().