evio
6.0
|
This class contains methods to transform structures from one type to another, for example, changing an EvioSegment into an EvioBank. More...
#include <StructureTransformer.h>
Static Public Member Functions | |
static std::shared_ptr< EvioBank > | transform (std::shared_ptr< EvioSegment > const &segment, uint8_t num) |
Create an EvioBank object from an EvioSegment. More... | |
static void | copy (std::shared_ptr< EvioBank > const &bank, std::shared_ptr< EvioSegment > const &segment, uint8_t num) |
Copy the data in an EvioSegment object into an existing EvioBank. More... | |
static std::shared_ptr< EvioBank > | transform (std::shared_ptr< EvioTagSegment > const &tagsegment, uint8_t num) |
Create an EvioBank object from an EvioTagSegment. More... | |
static void | copy (std::shared_ptr< EvioBank > const &bank, std::shared_ptr< EvioTagSegment > const &tagsegment, uint8_t num) |
Copy the data in an EvioTagSegment object into an existing EvioBank. More... | |
static std::shared_ptr < EvioTagSegment > | transform (std::shared_ptr< EvioSegment > const &segment) |
Create an EvioTagSegment object from an EvioSegment. More... | |
static void | copy (std::shared_ptr< EvioTagSegment > const &tagsegment, std::shared_ptr< EvioSegment > const &segment) |
Copy the data in an EvioSegment object into an existing EvioTagSegment. More... | |
static std::shared_ptr < EvioSegment > | transform (std::shared_ptr< EvioTagSegment > const &tagsegment) |
Create an EvioSegment object from an EvioTagSegment. More... | |
static void | copy (std::shared_ptr< EvioSegment > const &segment, std::shared_ptr< EvioSegment > const &tagsegment) |
Copy the data in an EvioTagSegment object into an existing EvioSegment. More... | |
static std::shared_ptr < EvioSegment > | transform (std::shared_ptr< EvioBank > const &bank) |
Create an EvioSegment object from an EvioBank. More... | |
static void | copy (std::shared_ptr< EvioSegment > const &segment, std::shared_ptr< EvioBank > const &bank) |
Copy the data in an EvioBank object into an existing EvioSegment. More... | |
static std::shared_ptr < EvioTagSegment > | transform (std::shared_ptr< EvioBank > const &bank, int dummy) |
Create an EvioTagSegment object from an EvioBank. More... | |
static void | copy (std::shared_ptr< EvioTagSegment > const &tagsegment, std::shared_ptr< EvioBank > const &bank) |
Copy the data in an EvioBank object into an existing EvioTagSegment. More... | |
This class contains methods to transform structures from one type to another, for example, changing an EvioSegment into an EvioBank.
|
inlinestatic |
Copy the data in an EvioSegment object into an existing EvioBank.
Note, however, that the segment's children were are added (not deep cloned) to the bank. Because a segment has no num, the user supplies that as an arg.
bank | EvioBank object to copy into. |
segment | EvioSegment object to copy. |
num | num of the EvioBank. |
|
inlinestatic |
Copy the data in an EvioTagSegment object into an existing EvioBank.
Note, however, that the tagsegment's children were are added (not deep cloned) to the bank. Because a tagsegment has no num, the user supplies that as an arg.
NOTE: A tagsegment has no associated padding data. However, the bank.transform() method will calculate it and set it in the bank header.
bank | EvioBank object to copy into. |
tagsegment | EvioTagSegment object to copy. |
num | num of the EvioBank. |
|
inlinestatic |
Copy the data in an EvioSegment object into an existing EvioTagSegment.
Note, however, that the segment's children were are added (not deep cloned) to the tagsegment.
NOTE: No data should be lost in this transformaton since even though the segment serializes 6 bits of data type when being written out while the tag segment serializes 4, only 4 bits are needed to contain the equivalent type data. And, the segment's tag is serialized into 8 bits while the tagsegment's tag uses 12 bits so no problem there.
tagsegment | EvioTagSegment object to copy into. |
segment | EvioSegment object to copy. |
References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::DataType::getDataType(), and evio::DataType::SEGMENT.
|
inlinestatic |
Copy the data in an EvioTagSegment object into an existing EvioSegment.
Note, however, that the tagsegment's children were are added (not deep cloned) to the segment.
NOTE: A tagsegment has no associated padding data. However, the transform() method will calculate it and set it in the segment header. Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a tagsegment's tag is serialized as 12 bits.
segment | EvioSegment object to copy into. |
tagsegment | EvioTagSegment object to copy. |
|
inlinestatic |
Copy the data in an EvioBank object into an existing EvioSegment.
Note, however, that the banks's children were are added (not deep cloned) to the segment.
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A segment has no num data and so the bank's num is lost. The bank's num is actually copied into segment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is possible that the length of the bank (32 bits) is too big for the segment (16 bits). This condition will cause an exception.
segment | EvioSegment object to copy into. |
bank | EvioBank object to copy. |
EvioException | if the bank is too long to change into a segment |
|
inlinestatic |
Copy the data in an EvioBank object into an existing EvioTagSegment.
Note, however, that the banks's children were are added (not deep cloned) to the tagsegment.
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a tagsegment's tag is written out or serialized into 12 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A segment has no num data and so the bank's num is lost. The bank's num is actually copied into segment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is possible that the length of the bank (32 bits) is too big for the segment (16 bits). This condition will cause an exception.
tagsegment | EvioTagSegment object to copy into. |
bank | EvioBank object to copy. |
EvioException | if the bank is too long to change into a segment |
References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::DataType::getDataType(), and evio::DataType::SEGMENT.
|
inlinestatic |
Create an EvioBank object from an EvioSegment.
The new object has all data copied over, except that the segment's children were are added (not deep cloned) to the bank. Because a segment has no num, the user supplies that as an arg.
segment | EvioSegment object to transform. |
num | num of the created EvioBank. |
References evio::EvioBank::getInstance().
|
inlinestatic |
Create an EvioBank object from an EvioTagSegment.
The new object has all data copied over, except that the tagsegment's children were are added (not deep cloned) to the bank. Because a tagsegment has no num, the user supplies that as an arg.
NOTE: A tagsegment has no associated padding data. However, the bank.transform() method will calculate it and set it in the bank header.
tagsegment | EvioTagSegment object to transform. |
num | num of the created EvioBank. |
References evio::EvioBank::getInstance().
|
inlinestatic |
Create an EvioTagSegment object from an EvioSegment.
The new object has all data copied over, except that the segment's children were are added (not deep cloned) to the tagsegment.
NOTE: No data should be lost in this transformaton since even though the segment serializes 6 bits of data type when being written out while the tag segment serializes 4, only 4 bits are needed to contain the equivalent type data. And, the segment's tag is serialized into 8 bits while the tagsegment's tag uses 12 bits so no problem there.
segment | EvioSegment object to transform. |
References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::DataType::getDataType(), evio::EvioTagSegment::getInstance(), and evio::DataType::SEGMENT.
|
inlinestatic |
Create an EvioSegment object from an EvioTagSegment.
The new object has all data copied over, except that the tagsegment's children were are added (not deep cloned) to the segment.
NOTE: A tagsegment has no associated padding data. However, the transform() method will calculate it and set it in the segment header. Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a tagsegment's tag is serialized as 12 bits.
tagsegment | EvioTagSegment object to transform. |
References evio::EvioSegment::getInstance().
|
inlinestatic |
Create an EvioSegment object from an EvioBank.
The new object has all data copied over, except that the bank's children were are added (not deep cloned) to the segment.
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A segment has no num data and so the bank's num is lost. The bank's num is actually copied into segment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is possible that the length of the bank (32 bits) is too big for the segment (16 bits). This condition will cause an exception.
bank | EvioBank object to transform. |
EvioException | if the bank is too long to change into a segment |
References evio::EvioSegment::getInstance().
|
inlinestatic |
Create an EvioTagSegment object from an EvioBank.
The new object has all data copied over, except that the bank's children were are added (not deep cloned) to the tagsegment.
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a tagsegment's tag is written out or serialized into 12 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A tagsegment has no num data and so the bank's num is lost. The bank's num is actually copied into tagsegment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is possible that the length of the bank (32 bits) is too big for the tagsegment (16 bits). This condition will cause an exception.
TYPE: No data should be lost in this transformaton since even though the bank serializes 6 bits of data type when being written out while the tagsegment serializes 4, only 4 bits are needed to contain the equivalent type data.
bank | EvioBank object to transform. |
dummy | only used to distinguish this method from transform(std::shared_ptr<EvioBank> const &). |
EvioException | if the bank is too long to change into a tagsegment |
References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::DataType::getDataType(), evio::EvioTagSegment::getInstance(), and evio::DataType::SEGMENT.