evio
6.0
|
Class to hold static methods used to swap evio data. More...
#include <EvioSwap.h>
Static Public Member Functions | |
static void | swapEvent (uint32_t *buf, int tolocal, uint32_t *dest) |
Method to swap the endianness of an evio event (bank). More... | |
static void | swapBank (uint32_t *buf, bool toLocal, uint32_t *dest) |
Routine to swap the endianness of an evio bank. More... | |
static void | swapSegment (uint32_t *buf, bool toLocal, uint32_t *dest) |
Routine to swap the endianness of an evio segment. More... | |
static void | swapTagsegment (uint32_t *buf, bool toLocal, uint32_t *dest) |
Routine to swap the endianness of an evio tagsegment. More... | |
static void | swapLeafData (DataType const &type, std::shared_ptr< ByteBuffer > &srcBuf, std::shared_ptr< ByteBuffer > &destBuf, size_t srcPos, size_t destPos, size_t len) |
This method swaps the data of an evio leaf structure. More... | |
static void | swapLeafData (DataType const &type, ByteBuffer &srcBuf, ByteBuffer &destBuf, size_t srcPos, size_t destPos, size_t len) |
This method swaps the data of an evio leaf structure. More... | |
static void | swapData (uint32_t *src, uint32_t type, uint32_t length, bool toLocal, uint32_t *dst) |
Routine to swap any type of evio data. More... | |
static void | swapData (std::shared_ptr< BaseStructure > strc) |
Routine to swap the endianness of an evio structure's (bank, seg, tagseg) data in place, including descendants' data. More... | |
Class to hold static methods used to swap evio data.
|
inlinestatic |
Routine to swap the endianness of an evio bank.
Null buf argument does nothing.
buf | buffer of evio bank data to be swapped. |
toLocal | if false buf contains data of same endian as local host, else buf has data of opposite endian. |
dest | buffer to place swapped data into. If this is null, then dest = buf. |
References evio::ByteOrder::byteSwap32(), and swapData().
Referenced by swapData(), and swapEvent().
|
inlinestatic |
Routine to swap any type of evio data.
This only swaps data associated with an evio structure; i.e. it completely ignores the header associated with it. If this data consists of structures like banks & segments, it will swap them completely. Null src argument does nothing.
src | source of evio data to be swapped (after evio header). |
type | type of evio data. |
length | length of evio data in 32 bit words |
toLocal | if false data is of same endian as local host, else data is of opposite endian. |
dst | destination of swapped data. If this is null, then dst = src. |
References evio::ByteOrder::byteNoSwap32(), evio::ByteOrder::byteSwap16(), evio::ByteOrder::byteSwap32(), evio::ByteOrder::byteSwap64(), evio::CompositeData::swapAll(), swapBank(), swapSegment(), and swapTagsegment().
Referenced by swapBank(), swapData(), swapSegment(), and swapTagsegment().
|
inlinestatic |
Routine to swap the endianness of an evio structure's (bank, seg, tagseg) data in place, including descendants' data.
The endianness of the given structure, obtained through BaseStructure#getByteOrder(), does NOT change. The caller must explicitly call BaseStructure#setByteOrder() to do that.
If this structure contains Composite data, and since it is stored as a vector of shared pointers to CompositeData objects, it is only serialized into bytes when written out. Thus the only way to switch it's endianness is for the user to call BaseStructure#setByteOrder() before writing it out as bytes. In other words, this method does NOT swap Composite data.
strc | evio structure in which to swap all data. |
References evio::ByteOrder::byteSwap16(), evio::ByteOrder::byteSwap32(), evio::ByteOrder::byteSwap64(), evio::DataType::DOUBLE64, evio::DataType::FLOAT32, evio::DataType::INT32, evio::DataType::LONG64, evio::DataType::SHORT16, swapData(), evio::DataType::UINT32, evio::DataType::ULONG64, and evio::DataType::USHORT16.
|
inlinestatic |
Method to swap the endianness of an evio event (bank).
buf | buffer of evio event data to be swapped |
tolocal | if 0 buf contains data of same endian as local host, else buf has data of opposite endian. |
dest | buffer to place swapped data into. If this is null, then dest = buf. |
References swapBank().
|
inlinestatic |
This method swaps the data of an evio leaf structure.
In other words the structure being swapped does not contain evio structures. It does nothing for container types.
type | type of data being swapped |
srcBuf | buffer containing data to be swapped |
destBuf | buffer in which to place swapped data |
srcPos | position in srcBuffer to start reading data |
destPos | position in destBuffer to start writing swapped data |
len | length of data in 32 bit words |
EvioException | if srcBuffer not in evio format; if destBuffer too small; if bad values for srcPos and/or destPos; |
|
inlinestatic |
This method swaps the data of an evio leaf structure.
In other words the structure being swapped does not contain evio structures. It does nothing for container types.
type | type of data being swapped |
srcBuf | buffer containing data to be swapped |
destBuf | buffer in which to place swapped data |
srcPos | position in srcBuffer to start reading data |
destPos | position in destBuffer to start writing swapped data |
len | length of data in 32 bit words |
EvioException | if srcBuffer not in evio format; if destBuffer too small; if bad values for srcPos and/or destPos; |
References evio::DataType::CHAR8, evio::DataType::CHARSTAR8, evio::DataType::COMPOSITE, evio::DataType::DOUBLE64, evio::DataType::FLOAT32, evio::ByteBuffer::getByte(), evio::ByteBuffer::getInt(), evio::ByteBuffer::getLong(), evio::ByteBuffer::getShort(), evio::DataType::INT32, evio::DataType::LONG64, evio::ByteBuffer::put(), evio::ByteBuffer::putInt(), evio::ByteBuffer::putLong(), evio::ByteBuffer::putShort(), evio::DataType::SHORT16, evio::CompositeData::swapAll(), evio::DataType::UCHAR8, evio::DataType::UINT32, evio::DataType::ULONG64, evio::DataType::UNKNOWN32, and evio::DataType::USHORT16.
|
inlinestatic |
Routine to swap the endianness of an evio segment.
Null buf argument does nothing.
buf | buffer of evio segment data to be swapped |
toLocal | if false buf contains data of same endian as local host, else buf has data of opposite endian |
dest | buffer to place swapped data into. If this is NULL, then dest = buf. |
References evio::ByteOrder::byteSwap32(), and swapData().
Referenced by swapData().
|
inlinestatic |
Routine to swap the endianness of an evio tagsegment.
Null buf argument does nothing.
buf | buffer of evio tagsegment data to be swapped |
toLocal | if false buf contains data of same endian as local host, else buf has data of opposite endian |
dest | buffer to place swapped data into. If this is NULL, then dest = buf. |
References evio::ByteOrder::byteSwap32(), and swapData().
Referenced by swapData().