evio
6.0
|
This the header for an evio tagsegment structure (EvioTagSegment
).
More...
#include <TagSegmentHeader.h>
Public Member Functions | |
TagSegmentHeader ()=default | |
TagSegmentHeader (uint16_t tag, DataType const &dataType) | |
Constructor. More... | |
TagSegmentHeader (uint16_t tag, std::string const &format) | |
Constructor for a string data type holding the single string given. More... | |
uint32_t | getDataLength () override |
Get the length of the structure's data in 32 bit ints (not counting the header words). More... | |
uint32_t | getHeaderLength () override |
Get the length of the structure's header in ints. More... | |
std::string | toString () override |
Obtain a string representation of the tagsegment header. More... | |
size_t | write (std::shared_ptr< ByteBuffer > &dest) override |
Write myself out a byte buffer. More... | |
size_t | write (ByteBuffer &dest) override |
Write myself out a byte buffer. More... | |
size_t | write (uint8_t *dest, ByteOrder const &order) override |
Write myself out as evio format data into the given byte array in the specified byte order. 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... | |
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... | |
This the header for an evio tagsegment structure (EvioTagSegment
).
It does not contain the raw data, just the header. Copied from the java class of identical name.
|
default |
evio::TagSegmentHeader::TagSegmentHeader | ( | uint16_t | tag, |
DataType const & | dataType | ||
) |
Constructor.
tag | the tag for the tagsegment header. |
dataType | the data type for the content of the tagsegment. |
evio::TagSegmentHeader::TagSegmentHeader | ( | uint16_t | tag, |
std::string const & | str | ||
) |
Constructor for a string data type holding the single string given.
Used in CompositeData class.
tag | the tag for the tagsegment header. |
str | data type for the content of the tagsegment. |
References evio::BaseStructureHeader::length, and evio::Util::stringToRawSize().
|
protectedinherited |
Method to copy data from the fiven header to this one.
head | header to copy data from (source). |
References evio::BaseStructureHeader::dataType, evio::BaseStructureHeader::length, evio::BaseStructureHeader::number, evio::BaseStructureHeader::padding, and evio::BaseStructureHeader::tag.
|
overridevirtual |
Get the length of the structure's data in 32 bit ints (not counting the header words).
Reimplemented from evio::BaseStructureHeader.
References evio::BaseStructureHeader::length.
|
inherited |
Returns the data type for data stored in this structure as a DataType
enum.
DataType
enum. References evio::BaseStructureHeader::dataType.
|
inherited |
Returns the data type as a string.
References evio::BaseStructureHeader::dataType, and evio::DataType::getName().
Referenced by evio::SegmentHeader::toString(), evio::BankHeader::toString(), and toString().
|
inherited |
Get the data type for the structure.
References evio::BaseStructureHeader::dataType, and evio::DataType::getValue().
|
overridevirtual |
Get the length of the structure's header in ints.
This includes the first header word itself (which contains the length) and in the case of banks, it also includes the second header word.
Reimplemented from evio::BaseStructureHeader.
|
inherited |
Get the length of the structure in 32 bit ints, not counting the length word.
References evio::BaseStructureHeader::length.
|
inherited |
Get the number.
Only Banks have a number field in their header, so this is only relevant for Banks.
References evio::BaseStructureHeader::number.
|
inherited |
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 evio::BaseStructureHeader::padding.
|
inherited |
|
inherited |
Set the numeric data type for the structure.
type | the numeric data type for the structure. |
References evio::BaseStructureHeader::dataType, and evio::DataType::getDataType().
|
inherited |
Set the numeric data type for the structure.
type | the numeric data type for the structure. |
References evio::BaseStructureHeader::dataType.
|
inherited |
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 evio::BaseStructureHeader::length.
|
inherited |
Set the number.
Only Banks have a number field in their header, so this is only relevant for Banks.
num | the number. |
References evio::BaseStructureHeader::number.
|
protectedinherited |
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 evio::BaseStructureHeader::padding.
|
inherited |
|
overridevirtual |
Obtain a string representation of the tagsegment header.
Reimplemented from evio::BaseStructureHeader.
References evio::BaseStructureHeader::getDataTypeName(), evio::BaseStructureHeader::length, and evio::BaseStructureHeader::tag.
|
overridevirtual |
Write myself out a byte buffer.
This write is relative - i.e., it uses the current position of the buffer.
byteBuffer | the byteBuffer to write to. |
Reimplemented from evio::BaseStructureHeader.
|
overridevirtual |
Write myself out a byte buffer.
This write is relative - i.e., it uses the current position of the buffer.
byteBuffer | the byteBuffer to write to. |
Reimplemented from evio::BaseStructureHeader.
References evio::BaseStructureHeader::dataType, evio::DataType::getValue(), evio::BaseStructureHeader::length, evio::ByteBuffer::putInt(), and evio::BaseStructureHeader::tag.
|
overridevirtual |
Write myself out as evio format data into the given byte array in the specified byte order.
dest | array into which evio data is written (destination). |
order | byte order in which to write the data. |
EvioException | if destination array too small to hold data. |
Reimplemented from evio::BaseStructureHeader.
References evio::BaseStructureHeader::dataType, evio::DataType::getValue(), evio::BaseStructureHeader::length, evio::BaseStructureHeader::tag, and evio::Util::toBytes().
|
protectedinherited |
The data type of the structure.
Referenced by evio::BaseStructureHeader::BaseStructureHeader(), evio::BaseStructureHeader::copy(), evio::BaseStructureHeader::getDataType(), evio::BaseStructureHeader::getDataTypeName(), evio::BaseStructureHeader::getDataTypeValue(), evio::BaseStructureHeader::setDataType(), evio::SegmentHeader::write(), evio::BankHeader::write(), and write().
|
protectedinherited |
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(), evio::BaseStructureHeader::copy(), evio::SegmentHeader::getDataLength(), evio::BankHeader::getDataLength(), getDataLength(), evio::BaseStructureHeader::getLength(), evio::BaseStructureHeader::setLength(), TagSegmentHeader(), evio::SegmentHeader::toString(), toString(), evio::BankHeader::toString(), evio::SegmentHeader::write(), evio::BankHeader::write(), and write().
|
protectedinherited |
The number represents an unsigned byte.
Only Banks have a number field in their header, so this is only relevant for Banks.
Referenced by evio::BaseStructureHeader::BaseStructureHeader(), evio::BaseStructureHeader::copy(), evio::BaseStructureHeader::getNumber(), evio::BaseStructureHeader::setNumber(), evio::BankHeader::toString(), and evio::BankHeader::write().
|
protectedinherited |
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 evio::BaseStructureHeader::copy(), evio::BaseStructureHeader::getPadding(), evio::BaseStructureHeader::setPadding(), evio::SegmentHeader::toString(), evio::BankHeader::toString(), evio::SegmentHeader::write(), and evio::BankHeader::write().
|
protectedinherited |
The structure tag.
Referenced by evio::BaseStructureHeader::BaseStructureHeader(), evio::BaseStructureHeader::copy(), evio::BaseStructureHeader::getTag(), evio::BaseStructureHeader::setTag(), evio::SegmentHeader::toString(), evio::BankHeader::toString(), toString(), evio::SegmentHeader::write(), write(), and evio::BankHeader::write().