evio
6.0
|
This the header for the base structure (BaseStructure
).
More...
#include <BaseStructureHeader.h>
Public Member Functions | |
BaseStructureHeader ()=default | |
BaseStructureHeader (uint16_t tag, DataType const &dataType, uint8_t num=0) | |
Constructor. More... | |
uint8_t | getNumber () const |
Get the number. More... | |
void | setNumber (uint8_t number) |
Set the number. More... | |
uint32_t | getDataTypeValue () const |
Get the data type for the structure. More... | |
void | setDataType (uint32_t type) |
Set the numeric data type for the structure. More... | |
void | setDataType (DataType const &type) |
Set the numeric data type for the structure. More... | |
DataType | getDataType () const |
Returns the data type for data stored in this structure as a DataType enum. More... | |
std::string | getDataTypeName () const |
Returns the data type as a string. More... | |
uint8_t | getPadding () const |
Get the amount of padding bytes when storing short or byte data. More... | |
uint32_t | getLength () const |
Get the length of the structure in 32 bit ints, not counting the length word. More... | |
void | setLength (uint32_t len) |
Set the length of the structure in 32 bit ints, not counting the length word. More... | |
uint16_t | getTag () const |
Get the structure tag. More... | |
void | setTag (uint16_t tag) |
Set the structure tag. More... | |
virtual uint32_t | getDataLength () |
virtual uint32_t | getHeaderLength () |
virtual std::string | toString () |
virtual size_t | write (std::shared_ptr< ByteBuffer > &dest) |
virtual size_t | write (ByteBuffer &dest) |
virtual size_t | write (uint8_t *dest, ByteOrder const &order) |
Protected Member Functions | |
void | setPadding (uint8_t pad) |
Set the amount of padding bytes when storing short or byte data. More... | |
void | copy (std::shared_ptr< BaseStructureHeader > const &head) |
Method to copy data from the fiven header to this one. More... | |
Protected Attributes | |
uint32_t | length = 0 |
The length of the structure in 32-bit words. More... | |
uint32_t | tag = 0 |
The structure tag. More... | |
DataType | dataType {DataType::UNKNOWN32} |
The data type of the structure. More... | |
uint8_t | padding = 0 |
The amount of padding bytes when storing short or byte data. More... | |
uint8_t | number = 0 |
The number represents an unsigned byte. More... | |
Friends | |
class | BaseStructure |
class | CompositeData |
class | EvioReader |
class | EvioReaderV4 |
class | EventHeaderParser |
class | StructureTransformer |
This the header for the base structure (BaseStructure
).
It does not contain the raw data, just the header. The three headers for the actual structures found in evio (BANK, SEGMENT, and TAGSEMENT) all extend this.
|
default |
evio::BaseStructureHeader::BaseStructureHeader | ( | uint16_t | tag, |
DataType const & | dataType, | ||
uint8_t | num = 0 |
||
) |
|
protected |
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
DataType evio::BaseStructureHeader::getDataType | ( | ) | const |
std::string evio::BaseStructureHeader::getDataTypeName | ( | ) | const |
Returns the data type as a string.
References dataType, and evio::DataType::getName().
Referenced by evio::SegmentHeader::toString(), evio::BankHeader::toString(), and evio::TagSegmentHeader::toString().
uint32_t evio::BaseStructureHeader::getDataTypeValue | ( | ) | const |
Get the data type for the structure.
References dataType, and evio::DataType::getValue().
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
uint32_t evio::BaseStructureHeader::getLength | ( | ) | const |
Get the length of the structure in 32 bit ints, not counting the length word.
References length.
uint8_t evio::BaseStructureHeader::getNumber | ( | ) | const |
Get the number.
Only Banks have a number field in their header, so this is only relevant for Banks.
References number.
uint8_t evio::BaseStructureHeader::getPadding | ( | ) | const |
Get the amount of padding bytes when storing short or byte data.
Value is 0, 1, 2, or 3 for bytes and 0 or 2 for shorts.
References padding.
uint16_t evio::BaseStructureHeader::getTag | ( | ) | const |
void evio::BaseStructureHeader::setDataType | ( | uint32_t | type | ) |
Set the numeric data type for the structure.
type | the numeric data type for the structure. |
References dataType, and evio::DataType::getDataType().
void evio::BaseStructureHeader::setDataType | ( | DataType const & | type | ) |
Set the numeric data type for the structure.
type | the numeric data type for the structure. |
References dataType.
void evio::BaseStructureHeader::setLength | ( | uint32_t | len | ) |
Set the length of the structure in 32 bit ints, not counting the length word.
len | the length of the structure in 32 bit ints, not counting the length word. |
References length.
void evio::BaseStructureHeader::setNumber | ( | uint8_t | num | ) |
Set the number.
Only Banks have a number field in their header, so this is only relevant for Banks.
num | the number. |
References number.
|
protected |
Set the amount of padding bytes when storing short or byte data.
Allowed value is 0, 1, 2, or 3 for bytes and 0 or 2 for shorts.
pad | amount of padding bytes when storing short or byte data (0-3). |
References padding.
void evio::BaseStructureHeader::setTag | ( | uint16_t | t | ) |
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
|
inlinevirtual |
Reimplemented in evio::BankHeader, evio::TagSegmentHeader, and evio::SegmentHeader.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
The data type of the structure.
Referenced by BaseStructureHeader(), copy(), getDataType(), getDataTypeName(), getDataTypeValue(), setDataType(), evio::SegmentHeader::write(), evio::BankHeader::write(), and evio::TagSegmentHeader::write().
|
protected |
The length of the structure in 32-bit words.
This never includes the first header word itself (which contains the length).
Referenced by evio::BankHeader::BankHeader(), copy(), evio::SegmentHeader::getDataLength(), evio::BankHeader::getDataLength(), evio::TagSegmentHeader::getDataLength(), getLength(), setLength(), evio::TagSegmentHeader::TagSegmentHeader(), evio::SegmentHeader::toString(), evio::TagSegmentHeader::toString(), evio::BankHeader::toString(), evio::SegmentHeader::write(), evio::BankHeader::write(), and evio::TagSegmentHeader::write().
|
protected |
The number represents an unsigned byte.
Only Banks have a number field in their header, so this is only relevant for Banks.
Referenced by BaseStructureHeader(), copy(), getNumber(), setNumber(), evio::BankHeader::toString(), and evio::BankHeader::write().
|
protected |
The amount of padding bytes when storing short or byte data.
Allowed value is 0, 1, 2, or 3 (0,2 for shorts and 0-3 for bytes) and is stored in the upper 2 bits of the dataType when written out.
Referenced by copy(), getPadding(), setPadding(), evio::SegmentHeader::toString(), evio::BankHeader::toString(), evio::SegmentHeader::write(), and evio::BankHeader::write().
|
protected |
The structure tag.
Referenced by BaseStructureHeader(), copy(), getTag(), setTag(), evio::SegmentHeader::toString(), evio::BankHeader::toString(), evio::TagSegmentHeader::toString(), evio::SegmentHeader::write(), evio::TagSegmentHeader::write(), and evio::BankHeader::write().