evio
6.0
|
Make a common interface for different versions of the BlockHeader arising from different evio versions. More...
#include <IBlockHeader.h>
Public Member Functions | |
virtual uint32_t | getSize ()=0 |
Get the size of the block (record) in 32 bit words. More... | |
virtual uint32_t | getNumber ()=0 |
Get the block number for this block (record). More... | |
virtual uint32_t | getHeaderWords ()=0 |
Get the block (record) header length, in 32 bit words. More... | |
virtual uint32_t | getSourceId ()=0 |
Get the source ID number if in CODA online context and data is coming from ROC. More... | |
virtual bool | hasFirstEvent ()=0 |
Does this block/record contain the "first event" (first event to be written to each file split)? More... | |
virtual uint32_t | getEventType ()=0 |
Get the type of events in block/record (see values of DataType. More... | |
virtual uint32_t | getVersion ()=0 |
Get the evio version of the block (record) header. More... | |
virtual uint32_t | getMagicNumber ()=0 |
Get the magic number the block (record) header which should be 0xc0da0100. More... | |
virtual ByteOrder & | getByteOrder ()=0 |
Get the byte order of the data being read. More... | |
virtual size_t | getBufferEndingPosition ()=0 |
Get the position in the buffer (bytes) of this block's last data word. More... | |
virtual size_t | getBufferStartingPosition ()=0 |
Get the starting position in the buffer (bytes) from which this header was read–if that happened. More... | |
virtual void | setBufferStartingPosition (size_t pos)=0 |
Set the starting position in the buffer (bytes) from which this header was read–if that happened. More... | |
virtual size_t | nextBufferStartingPosition ()=0 |
Determines where the start of the next block (record) header in some buffer is located (bytes). More... | |
virtual size_t | firstEventStartingPosition ()=0 |
Determines where the start of the first event in this block (record) is located (bytes). More... | |
virtual size_t | bytesRemaining (size_t position)=0 |
Gives the bytes remaining in this block (record) given a buffer position. More... | |
virtual bool | hasDictionary ()=0 |
Does this block contain an evio dictionary? More... | |
virtual bool | isLastBlock ()=0 |
Is this the last block in the file or being sent over the network? More... | |
virtual bool | isCompressed ()=0 |
Is this the data in this block compressed? More... | |
virtual Compressor::CompressionType | getCompressionType ()=0 |
Get the type of data compression used. More... | |
virtual size_t | write (ByteBuffer &byteBuffer)=0 |
Write myself out into a byte buffer. More... | |
virtual std::string | toString ()=0 |
Get the string representation of the block (record) header. More... | |
Static Public Attributes | |
static const uint32_t | MAGIC_NUMBER = 0xc0da0100 |
The magic number, should be the value of magicNumber . More... | |
static const uint32_t | MAGIC_OFFSET = 28 |
Byte offset from beginning of header to the magic number. More... | |
static const uint32_t | BIT_INFO_OFFSET = 20 |
Byte offset from beginning of header to bit info word. More... | |
static const uint32_t | VERSION_MASK = 0xff |
Mask to get version number from bitinfo word in header. More... | |
Make a common interface for different versions of the BlockHeader arising from different evio versions.
In evio version 4 and later, blocks are called records.
|
pure virtual |
Gives the bytes remaining in this block (record) given a buffer position.
The position is an absolute position in a byte buffer. This assumes that the absolute position in bufferStartingPosition
is being maintained properly by the reader.
position | the absolute current position in a byte buffer. |
EvioException | if position out of bounds |
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Determines where the start of the first event in this block (record) is located (bytes).
This assumes the start position has been maintained by the object performing the buffer read.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the position in the buffer (bytes) of this block's last data word.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the starting position in the buffer (bytes) from which this header was read–if that happened.
This is not part of the block header proper. It is a position in a memory buffer of the start of the block (record). It is kept for convenience. It is up to the reader to set it.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the byte order of the data being read.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the type of data compression used.
Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Get the type of events in block/record (see values of DataType.
This is not supported by versions 1-3 which returns 0.
Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Get the block (record) header length, in 32 bit words.
Implemented in evio::RecordHeader, evio::BlockHeaderV2, and evio::BlockHeaderV4.
|
pure virtual |
Get the magic number the block (record) header which should be 0xc0da0100.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the block number for this block (record).
In a file, this is usually sequential, starting at 1.
Implemented in evio::RecordHeader, evio::BlockHeaderV2, and evio::BlockHeaderV4.
|
pure virtual |
Get the size of the block (record) in 32 bit words.
Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Get the source ID number if in CODA online context and data is coming from ROC.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the evio version of the block (record) header.
Implemented in evio::RecordHeader, evio::BlockHeaderV2, and evio::BlockHeaderV4.
|
pure virtual |
Does this block contain an evio dictionary?
true
if this block contains an evio dictionary, else false
. Always returns false for versions 1-3 (not implemented). Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Does this block/record contain the "first event" (first event to be written to each file split)?
true
if this record has the first event, else false
. Evio versions 1-3 always return false. Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Is this the data in this block compressed?
true
if the data in this block is compressed, else false
. Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Is this the last block in the file or being sent over the network?
true
if this is the last block in the file or being sent over the network, else false
. Always returns false for versions 1-3 (not implemented). Implemented in evio::RecordHeader, evio::BlockHeaderV4, and evio::BlockHeaderV2.
|
pure virtual |
Determines where the start of the next block (record) header in some buffer is located (bytes).
This assumes the start position has been maintained by the object performing the buffer read.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Set the starting position in the buffer (bytes) from which this header was read–if that happened.
This is not part of the block header proper. It is a position in a memory buffer of the start of the block (record). It is kept for convenience. It is up to the reader to set it.
pos | starting position in buffer from which this header was read–if that happened. |
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Get the string representation of the block (record) header.
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
pure virtual |
Write myself out into a byte buffer.
This write is relative–i.e., it uses the current position of the buffer.
byteBuffer | the byteBuffer to write to. |
overflow_error | if insufficient room to write header into buffer. |
Implemented in evio::BlockHeaderV4, evio::RecordHeader, and evio::BlockHeaderV2.
|
static |
Byte offset from beginning of header to bit info word.
Referenced by evio::Util::findEvioVersion().
|
static |
The magic number, should be the value of magicNumber
.
Referenced by evio::Util::findEvioVersion(), evio::EvioReaderV4::parseFirstHeader(), evio::BlockHeaderV2::setMagicNumber(), and evio::BlockHeaderV4::setMagicNumber().
|
static |
Byte offset from beginning of header to the magic number.
Referenced by evio::Util::findEvioVersion().
|
static |
Mask to get version number from bitinfo word in header.
Referenced by evio::Util::findEvioVersion().