evio
6.0
|
This holds a CODA Segment structure. More...
#include <EvioSegment.h>
Public Types | |
typedef size_t | size_type |
typedef std::ptrdiff_t | difference_type |
typedef std::input_iterator_tag | iterator_category |
typedef std::shared_ptr < BaseStructure > | value_type |
typedef std::shared_ptr < BaseStructure > | reference |
typedef std::shared_ptr < BaseStructure > | pointer |
typedef nodeIterator < std::shared_ptr < BaseStructure > > | iterator |
typedef nodeBreadthIterator < std::shared_ptr < BaseStructure > > | breadth_iterator |
Public Member Functions | |
StructureType | getStructureType () const override |
This implements the virtual method from BaseStructure . More... | |
iterator | begin () |
Get the beginning depth-first iterator. More... | |
iterator | end () |
Get the end depth-first iterator. More... | |
breadth_iterator | bbegin () |
Get the beginning breadth-first iterator. More... | |
breadth_iterator | bend () |
Get the end breadth-first iterator. More... | |
std::shared_ptr< BaseStructure > | getThis () |
std::shared_ptr< const BaseStructure > | getThisConst () const |
void | insert (const std::shared_ptr< BaseStructure > newChild, size_t childIndex) |
Removes newChild from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child to this node's child array at index childIndex . More... | |
void | remove (size_t childIndex) |
Removes the child at the specified index from this node's children and sets that node's parent to null. More... | |
void | remove (const std::shared_ptr< BaseStructure > aChild) |
Removes aChild from this node's child vector, giving it a null parent. More... | |
std::shared_ptr< BaseStructure > | getParent () const |
Returns this node's parent or null if this node has no parent. More... | |
std::vector< std::shared_ptr < BaseStructure > > | getChildren () const |
Get the children of this structure. More... | |
std::shared_ptr< BaseStructure > | getChildAt (size_t index) const |
Returns the child at the specified index in this node's child vector. More... | |
size_t | getChildCount () const |
Returns the number of children of this node. More... | |
ssize_t | getIndex (const std::shared_ptr< BaseStructure > aChild) |
Returns the index of the specified child in this node's child vector. More... | |
std::vector< std::shared_ptr < BaseStructure > >::iterator | childrenBegin () |
Creates and returns a forward-order begin iterator of this node's children. More... | |
std::vector< std::shared_ptr < BaseStructure > >::iterator | childrenEnd () |
Creates and returns a forward-order end iterator of this node's children. More... | |
void | setAllowsChildren (bool allows) |
Determines whether or not this node is allowed to have children. More... | |
bool | getAllowsChildren () const |
Returns true if this node is allowed to have children. More... | |
void | removeFromParent () |
Removes the subtree rooted at this node from the tree, giving this node a null parent. More... | |
void | removeAllChildren () |
Removes all of this node's children, setting their parents to null. More... | |
void | add (std::shared_ptr< BaseStructure > newChild) |
Removes newChild from its parent and makes it a child of this node by adding it to the end of this node's child array. More... | |
bool | isNodeAncestor (const std::shared_ptr< BaseStructure > anotherNode) const |
Returns true if anotherNode is an ancestor of this node – if it is this node, this node's parent, or an ancestor of this node's parent. More... | |
bool | isNodeDescendant (std::shared_ptr< BaseStructure > anotherNode) |
Returns true if anotherNode is a descendant of this node – if it is this node, one of this node's children, or a descendant of one of this node's children. More... | |
std::shared_ptr< BaseStructure > | getSharedAncestor (std::shared_ptr< BaseStructure > aNode) |
Returns the nearest common ancestor to this node and aNode . More... | |
bool | isNodeRelated (std::shared_ptr< BaseStructure > aNode) |
Returns true if and only if aNode is in the same tree as this node. More... | |
uint32_t | getDepth () |
Returns the depth of the tree rooted at this node – the longest distance from this node to a leaf. More... | |
uint32_t | getLevel () const |
Returns the number of levels above this node – the distance from the root to this node. More... | |
std::vector< std::shared_ptr < BaseStructure > > | getPath () |
Returns the path from the root, to get to this node. More... | |
std::shared_ptr< BaseStructure > | getRoot () |
Returns the root of the tree that contains this node. More... | |
bool | isRoot () const |
Returns true if this node is the root of the tree. More... | |
std::shared_ptr< BaseStructure > | getNextNode () |
Returns the node that follows this node in a preorder traversal of this node's tree (return left nodes all the way down before coming back and doing siblings from bottom up). More... | |
std::shared_ptr< BaseStructure > | getPreviousNode () |
Returns the node that precedes this node in a preorder traversal of this node's tree (return left nodes all the way down before coming back and doing siblings from bottom up). More... | |
bool | isNodeChild (const std::shared_ptr< BaseStructure > aNode) const |
Returns true if aNode is a child of this node. More... | |
std::shared_ptr< BaseStructure > | getFirstChild () const |
Returns this node's first child. More... | |
std::shared_ptr< BaseStructure > | getLastChild () const |
Returns this node's last child. More... | |
std::shared_ptr< BaseStructure > | getChildAfter (const std::shared_ptr< BaseStructure > aChild) |
Returns the child in this node's child vector that immediately follows aChild , which must be a child of this node. More... | |
std::shared_ptr< BaseStructure > | getChildBefore (const std::shared_ptr< BaseStructure > aChild) |
Returns the child in this node's child vector that immediately precedes aChild , which must be a child of this node. More... | |
bool | isNodeSibling (const std::shared_ptr< BaseStructure > anotherNode) const |
Returns true if anotherNode is a sibling of (has the same parent as) this node. More... | |
size_t | getSiblingCount () const |
Returns the number of siblings of this node. More... | |
std::shared_ptr< BaseStructure > | getNextSibling () |
Returns the next sibling of this node in the parent's children vector. More... | |
std::shared_ptr< BaseStructure > | getPreviousSibling () |
Returns the previous sibling of this node in the parent's children vector. More... | |
bool | isLeaf () const |
Returns true if this node has no children. More... | |
std::shared_ptr< BaseStructure > | getFirstLeaf () |
Finds and returns the first leaf that is a descendant of this node – either this node or its first child's first leaf. More... | |
std::shared_ptr< BaseStructure > | getLastLeaf () |
Finds and returns the last leaf that is a descendant of this node – either this node or its last child's last leaf. More... | |
std::shared_ptr< BaseStructure > | getNextLeaf () |
Returns the leaf after this node or null if this node is the last leaf in the tree. More... | |
std::shared_ptr< BaseStructure > | getPreviousLeaf () |
Returns the leaf before this node or null if this node is the first leaf in the tree. More... | |
ssize_t | getLeafCount () |
Returns the total number of leaves that are descendants of this node. More... | |
void | visitAllStructures (std::shared_ptr< IEvioListener > listener) |
Visit all the structures in this structure (including the structure itself – which is considered its own descendant). More... | |
void | visitAllStructures (std::shared_ptr< IEvioListener > listener, std::shared_ptr< IEvioFilter > filter) |
Visit all the structures in this structure (including the structure itself – which is considered its own descendant) in a depth first manner. More... | |
void | getMatchingStructures (std::shared_ptr< IEvioFilter > filter, std::vector< std::shared_ptr< BaseStructure >> &vec) |
Visit all the descendant structures, and collect those that pass a filter. More... | |
void | transform (std::shared_ptr< BaseStructure > const &structure) |
This method does a partial copy and is designed to help convert between banks, segments,and tagsegments in the StructureTransformer class (hence the name "transform"). More... | |
ByteOrder | getByteOrder () |
What is the byte order of this data? More... | |
void | setByteOrder (ByteOrder const &order) |
Set the byte order of this data. More... | |
bool | needSwap () const |
Is a byte swap required (i.e. More... | |
virtual std::string | toString () const |
Obtain a string representation of the structure. More... | |
std::string | treeToString (std::string const &indent) const |
Recursive method to obtain a string representation of the entire tree structure rooted at this structure. More... | |
std::shared_ptr < BaseStructureHeader > | getHeader () const |
Return the header for this structure. More... | |
size_t | write (ByteBuffer &dest) |
Write myself out into a byte buffer with fastest algorithm I could find. More... | |
size_t | write (uint8_t *dest, ByteOrder const &order) |
Write myself out to a pointer. More... | |
size_t | writeQuick (uint8_t *dest) |
Write myself out as evio format data in the data's current byte order given by getByteOrder() at the given pointer. More... | |
size_t | writeQuick (ByteBuffer &dest) |
Write myself into a ByteBuffer as evio format data in the data's current byte order given by getByteOrder(). More... | |
uint32_t | getNumberDataItems () |
Get the number of stored data items like number of banks, ints, floats, etc. More... | |
uint32_t | setAllHeaderLengths () |
Compute and set length of all header fields for this structure and all its descendants. More... | |
bool | isContainer () const |
Checks whether this structure is a container, i.e. More... | |
uint32_t | getTotalBytes () const |
Get the length of this structure in bytes, including the header. More... | |
std::vector< uint8_t > & | getRawBytes () |
Get the raw data of the structure. More... | |
std::vector< int16_t > & | getShortData () |
Gets the raw data as an int16_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< uint16_t > & | getUShortData () |
Gets the raw data as an uint16_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< int32_t > & | getIntData () |
Gets the raw data as an int32_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< uint32_t > & | getUIntData () |
Gets the raw data as an uint32_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< int64_t > & | getLongData () |
Gets the raw data as an int64_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< uint64_t > & | getULongData () |
Gets the raw data as an uint64_t vector if the content type as indicated by the header is appropriate. More... | |
std::vector< float > & | getFloatData () |
Gets the raw data as a float vector if the content type as indicated by the header is appropriate. More... | |
std::vector< double > & | getDoubleData () |
Gets the raw data as a double vector if the content type as indicated by the header is appropriate. More... | |
std::vector< signed char > & | getCharData () |
Gets the raw data as an signed char vector, if the contents type as indicated by the header is appropriate. More... | |
std::vector< unsigned char > & | getUCharData () |
Gets the raw data as an unsigned char vector, if the contents type as indicated by the header is appropriate. More... | |
std::vector< std::shared_ptr < CompositeData > > & | getCompositeData () |
Gets the composite data as an vector of CompositeData objects, if the content type as indicated by the header is appropriate. More... | |
std::vector< std::string > & | getStringData () |
Gets the raw data (ascii) as an vector of string objects, if the contents type as indicated by the header is appropriate. More... | |
uint32_t | unpackRawBytesToStrings () |
Extract string data from rawBytes array. More... | |
void | updateIntData () |
If data in this structure was changed by modifying the vector returned from getIntData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateUIntData () |
If data in this structure was changed by modifying the vector returned from getUIntData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateShortData () |
If data in this structure was changed by modifying the vector returned from getShortData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateUShortData () |
If data in this structure was changed by modifying the vector returned from getUShortData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateLongData () |
If data in this structure was changed by modifying the vector returned from getLongData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateULongData () |
If data in this structure was changed by modifying the vector returned from getULongData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateCharData () |
If data in this structure was changed by modifying the vector returned from getCharData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateUCharData () |
If data in this structure was changed by modifying the vector returned from getUCharData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateFloatData () |
If data in this structure was changed by modifying the vector returned from getFloatData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateDoubleData () |
If data in this structure was changed by modifying the vector returned from getDoubleData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateStringData () |
If data in this structure was changed by modifying the vector returned from getStringData(), then this method needs to be called in order to make this object internally consistent. More... | |
void | updateCompositeData () |
If data in this structure was changed by modifying the vector returned from getCompositeData(), then this method needs to be called in order to make this object internally consistent. More... | |
Static Public Member Functions | |
static std::shared_ptr < EvioSegment > | getInstance (std::shared_ptr< SegmentHeader > const &head) |
Method to return a shared pointer to a constructed object of this class. More... | |
static std::shared_ptr < EvioSegment > | getInstance (uint16_t tag, DataType const &typ) |
Method to return a shared pointer to a constructed object of this class. More... | |
static void | stringsToRawBytes (std::vector< std::string > &strings, std::vector< uint8_t > &bytes) |
This method transforms a vector of strings into raw evio format data, not including header. More... | |
static void | unpackRawBytesToStrings (std::vector< uint8_t > &bytes, size_t offset, std::vector< std::string > &strData) |
This method extracts a vector of strings from bytes of raw evio string data. More... | |
static void | unpackRawBytesToStrings (std::vector< uint8_t > &bytes, size_t offset, size_t maxLength, std::vector< std::string > &strData) |
This method extracts a vector of strings from bytes of raw evio string data. More... | |
static void | unpackRawBytesToStrings (uint8_t *bytes, size_t length, std::vector< std::string > &strData) |
This method extracts a vector of strings from bytes of raw evio string data. More... | |
static void | unpackRawBytesToStrings (ByteBuffer &buffer, size_t pos, size_t length, std::vector< std::string > &strData) |
This method extracts a vector of strings from buffer containing raw evio string data. More... | |
static uint32_t | stringToRawSize (const std::string &str) |
This method returns the number of bytes in a raw evio format of the given string vector, not including header. More... | |
static uint32_t | stringsToRawSize (std::vector< std::string > const &strings) |
This method returns the number of bytes in a raw evio format of the given string vector, not including header. More... | |
Protected Member Functions | |
void | setParent (const std::shared_ptr< BaseStructure > &newParent) |
Sets this node's parent to newParent but does not change the parent's child array. More... | |
std::vector< std::shared_ptr < BaseStructure > > | getPathToRoot (const std::shared_ptr< BaseStructure > &aNode, int depth) const |
Builds the parents of node up to and including the root node, where the original node is the last element in the returned vector. More... | |
bool | getLengthsUpToDate () const |
Get whether the lengths of all header fields for this structure and all it descendants are up to date or not. More... | |
void | setLengthsUpToDate (bool lengthsUpToDate) |
Set whether the lengths of all header fields for this structure and all it descendants are up to date or not. More... | |
uint32_t | dataLength () |
Compute the dataLength in 32-bit words. More... | |
void | stringsToRawBytes () |
This method transforms the internal vector of strings into internal rawBytes vector of evio format data not including header. More... | |
void | setRawBytes (uint8_t *bytes, uint32_t len) |
Set the data for the structure. More... | |
void | setRawBytes (std::vector< uint8_t > &bytes) |
Set the data for the structure. More... | |
Protected Attributes | |
std::shared_ptr< BaseStructure > | parent = nullptr |
This node's parent, or null if this node has no parent. More... | |
std::vector< std::shared_ptr < BaseStructure > > | children |
Array of children, may be null if this node has no children. More... | |
bool | allowsChildren = true |
True if the node is able to have children. More... | |
std::shared_ptr < BaseStructureHeader > | header |
Holds the header of the bank as a shared pointer. More... | |
std::vector< uint8_t > | rawBytes |
The raw data of the structure. More... | |
std::vector< int16_t > | shortData |
Used if raw data should be interpreted as shorts. More... | |
std::vector< uint16_t > | ushortData |
Used if raw data should be interpreted as unsigned shorts. More... | |
std::vector< int32_t > | intData |
Used if raw data should be interpreted as ints. More... | |
std::vector< uint32_t > | uintData |
Used if raw data should be interpreted as unsigned ints. More... | |
std::vector< int64_t > | longData |
Used if raw data should be interpreted as longs. More... | |
std::vector< uint64_t > | ulongData |
Used if raw data should be interpreted as unsigned longs. More... | |
std::vector< double > | doubleData |
Used if raw data should be interpreted as doubles. More... | |
std::vector< float > | floatData |
Used if raw data should be interpreted as floats. More... | |
std::vector< std::shared_ptr < CompositeData > > | compositeData |
Used if raw data should be interpreted as composite type. More... | |
std::vector< signed char > | charData |
Used if raw data should be interpreted as signed chars. More... | |
std::vector< unsigned char > | ucharData |
Used if raw data should be interpreted as unsigned chars. More... | |
std::vector< std::string > | stringList |
Used if raw data should be interpreted as a string. More... | |
int | stringEnd = 0 |
Keep track of end of the last string added to stringData (including null but not padding). More... | |
bool | badStringFormat = false |
True if char data has non-ascii or non-printable characters, or has too little data to be in proper format. More... | |
size_t | numberDataItems = 0 |
The number of stored data items like number of banks, ints, floats, etc. More... | |
ByteOrder | byteOrder {ByteOrder::ENDIAN_LOCAL} |
Endianness of the raw data if appropriate. More... | |
bool | lengthsUpToDate = false |
Keep track of whether header length data is up-to-date or not. More... | |
This holds a CODA Segment structure.
Mostly it has a header (a SegementHeader
) and the raw data stored as a vector.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Removes newChild
from its parent and makes it a child of this node by adding it to the end of this node's child array.
Originally part of java's DefaultMutableTreeNode.
newChild | node to add as a child of this node. |
EvioException | if newChild is null, or this node does not allow children. |
References evio::BaseStructure::getChildCount(), evio::BaseStructure::getThis(), and evio::BaseStructure::insert().
|
inlineinherited |
Get the beginning breadth-first iterator.
References evio::BaseStructure::getThis().
Referenced by evio::BaseStructure::getDepth(), and evio::BaseStructure::getLeafCount().
|
inlineinherited |
Get the beginning depth-first iterator.
References evio::BaseStructure::getThis().
|
inlineinherited |
Get the end breadth-first iterator.
References evio::BaseStructure::getThis().
Referenced by evio::BaseStructure::getDepth(), and evio::BaseStructure::getLeafCount().
|
inherited |
Creates and returns a forward-order begin iterator of this node's children.
Modifying this node's child array invalidates any child iterators created before the modification. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::children.
|
inherited |
Creates and returns a forward-order end iterator of this node's children.
Modifying this node's child array invalidates any child iterators created before the modification. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::children.
|
protectedinherited |
Compute the dataLength in 32-bit words.
This is the amount of data needed by a leaf of primitives. For non-leafs (structures of structures) this returns 0. For data types smaller than an int, e.g. a short, it computes assuming padding to an integer number of ints. For example, if we are writing a byte array of length 3 or 4, the it would return 1. If the byte array is 5,6,7 or 8 it would return 2;
References evio::DataType::CHAR8, evio::DataType::CHARSTAR8, evio::DataType::COMPOSITE, evio::DataType::getBytes(), evio::BaseStructure::getNumberDataItems(), evio::BaseStructure::header, evio::BaseStructure::isLeaf(), evio::BaseStructure::rawBytes, evio::DataType::UCHAR8, and evio::DataType::UNKNOWN32.
Referenced by evio::BaseStructure::setAllHeaderLengths().
|
inlineinherited |
Get the end depth-first iterator.
References evio::BaseStructure::getThis().
Referenced by evio::BaseStructure::getIndex(), and evio::BaseStructure::remove().
|
inherited |
Returns true if this node is allowed to have children.
Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::allowsChildren.
|
inherited |
What is the byte order of this data?
References evio::BaseStructure::byteOrder.
Referenced by evio::BaseStructure::writeQuick().
|
inherited |
Gets the raw data as an signed char vector, if the contents type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateCharData MUST be called!
null
if this makes no sense for the given contents type. References evio::DataType::CHAR8, evio::BaseStructure::charData, evio::BaseStructure::header, and evio::BaseStructure::rawBytes.
|
inherited |
Returns the child in this node's child vector that immediately follows aChild
, which must be a child of this node.
If aChild
is the last child, returns null. This method performs a linear search of this node's children for aChild
and is O(n) where n is the number of children; to traverse the entire vector of children, use an iterator instead. Originally part of java's DefaultMutableTreeNode.
aChild | child of this node which immediately precedes the returned child structure. |
EvioException | if aChild is null or is not a child of this node. |
aChild
. References evio::BaseStructure::getChildAt(), evio::BaseStructure::getChildCount(), and evio::BaseStructure::getIndex().
|
inherited |
Returns the child at the specified index in this node's child vector.
Originally part of java's DefaultMutableTreeNode.
index | an index into this node's child array. |
std::out_of_range | if index is out of bounds. |
References evio::BaseStructure::children.
Referenced by evio::BaseStructure::getChildAfter(), evio::BaseStructure::getChildBefore(), evio::BaseStructure::getFirstChild(), evio::BaseStructure::getLastChild(), evio::BaseStructure::getNextNode(), and evio::BaseStructure::remove().
|
inherited |
Returns the child in this node's child vector that immediately precedes aChild
, which must be a child of this node.
If aChild
is the first child, returns null. This method performs a linear search of this node's children for aChild
and is O(n) where n is the number of children. Originally part of java's DefaultMutableTreeNode.
aChild | child of this node which comes immediately after the returned child structure. |
EvioException | if aChild is null or is not a child of this node. |
aChild
. References evio::BaseStructure::getChildAt(), and evio::BaseStructure::getIndex().
|
inherited |
Returns the number of children of this node.
Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::children.
Referenced by evio::BaseStructure::add(), evio::BaseStructure::getChildAfter(), evio::BaseStructure::getFirstChild(), evio::BaseStructure::getLastChild(), evio::BaseStructure::getNextNode(), evio::BaseStructure::isLeaf(), evio::BaseStructure::isNodeChild(), evio::BaseStructure::removeAllChildren(), and evio::BaseStructure::treeToString().
|
inherited |
Get the children of this structure.
References evio::BaseStructure::children.
|
inherited |
Gets the composite data as an vector of CompositeData objects, if the content type as indicated by the header is appropriate.
null
if this makes no sense for the given content type. EvioException | if the data is internally inconsistent. |
References evio::BaseStructure::byteOrder, evio::DataType::COMPOSITE, evio::BaseStructure::compositeData, evio::BaseStructure::header, evio::CompositeData::parse(), and evio::BaseStructure::rawBytes.
|
inherited |
Returns the depth of the tree rooted at this node – the longest distance from this node to a leaf.
If this node has no children, returns 0. This operation is much more expensive than getLevel()
because it must effectively traverse the entire tree rooted at this node. Originally part of java's DefaultMutableTreeNode.
EvioException | if internal logic error. |
References evio::BaseStructure::bbegin(), evio::BaseStructure::bend(), and evio::BaseStructure::getLevel().
|
inherited |
Gets the raw data as a double vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateDoubleData MUST be called!
EvioException | if contained data type is not double. |
References evio::DataType::DOUBLE64, evio::BaseStructure::doubleData, evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, and SWAP_64.
|
inherited |
Returns this node's first child.
If this node has no children, throws EvioException. Originally part of java's DefaultMutableTreeNode.
EvioException | if this node has no children. |
References evio::BaseStructure::getChildAt(), and evio::BaseStructure::getChildCount().
|
inherited |
Finds and returns the first leaf that is a descendant of this node – either this node or its first child's first leaf.
Returns this node if it is a leaf. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getThis().
|
inherited |
Gets the raw data as a float vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateFloatData MUST be called!
EvioException | if contained data type is not float. |
References evio::DataType::FLOAT32, evio::BaseStructure::floatData, evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, and SWAP_32.
|
inherited |
Return the header for this structure.
References evio::BaseStructure::header.
|
inherited |
Returns the index of the specified child in this node's child vector.
If the specified node is not a child of this node, returns -1
. This method performs a linear search and is O(n) where n is the number of children. Originally part of java's DefaultMutableTreeNode.
aChild | the BaseStructure to search for among this node's children. |
EvioException | if aChild is null. |
-1
if the specified node is a not a child of this node. References evio::BaseStructure::children, evio::BaseStructure::end(), and evio::BaseStructure::isNodeChild().
Referenced by evio::BaseStructure::getChildAfter(), evio::BaseStructure::getChildBefore(), and evio::BaseStructure::remove().
|
inlinestatic |
Method to return a shared pointer to a constructed object of this class.
head | segment header. |
Referenced by evio::EventBuilder::main(), and evio::StructureTransformer::transform().
|
inlinestatic |
Method to return a shared pointer to a constructed object of this class.
tag | segment tag. |
typ | segment data type. |
|
inherited |
Gets the raw data as an int32_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateIntData MUST be called!
EvioException | if contained data type is not int32_t. |
References evio::BaseStructure::header, evio::DataType::INT32, evio::BaseStructure::intData, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, and SWAP_32.
|
inherited |
Returns this node's last child.
If this node has no children, throws EvioException. Originally part of java's DefaultMutableTreeNode.
EvioException | if this node has no children. |
References evio::BaseStructure::getChildAt(), and evio::BaseStructure::getChildCount().
|
inherited |
Finds and returns the last leaf that is a descendant of this node – either this node or its last child's last leaf.
Returns this node if it is a leaf. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getThis().
|
inherited |
Returns the total number of leaves that are descendants of this node.
If this node is a leaf, returns 1
. This method is O(n) where n is the number of descendants of this node. Originally part of java's DefaultMutableTreeNode.
EvioException | if tree has zero leaves. |
References evio::BaseStructure::bbegin(), and evio::BaseStructure::bend().
|
protectedinherited |
Get whether the lengths of all header fields for this structure and all it descendants are up to date or not.
References evio::BaseStructure::lengthsUpToDate.
|
inherited |
Returns the number of levels above this node – the distance from the root to this node.
If this node is the root, returns 0. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getThisConst().
Referenced by evio::BaseStructure::getDepth(), and evio::BaseStructure::getSharedAncestor().
|
inherited |
Gets the raw data as an int64_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateLongData MUST be called!
EvioException | if contained data type is not int64_t. |
References evio::BaseStructure::header, evio::DataType::LONG64, evio::BaseStructure::longData, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, and SWAP_64.
|
inherited |
Visit all the descendant structures, and collect those that pass a filter.
filter | the filter that must be passed. If null , this will return all the structures. |
vec | vector provided to contain all structures that are accepted by the filter. |
References evio::BaseStructure::visitAllStructures().
|
inherited |
Returns the leaf after this node or null if this node is the last leaf in the tree.
This operation is very inefficient. In order to determine the next node, this method first performs a linear search in the parent's child-list in order to find the current node.
This implementation makes the operation suitable for short traversals from a known position. But to traverse all of the leaves in the tree, you should use A depth-first iterator of the nodes in the tree and use isLeaf
on each node to determine which are leaves. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getNextSibling(), and evio::BaseStructure::getParent().
|
inherited |
Returns the node that follows this node in a preorder traversal of this node's tree (return left nodes all the way down before coming back and doing siblings from bottom up).
Returns null if this node is the last node of the traversal. This is an inefficient way to traverse the entire tree; use an iterator instead. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getChildAt(), evio::BaseStructure::getChildCount(), evio::BaseStructure::getNextSibling(), and evio::BaseStructure::getParent().
|
inherited |
Returns the next sibling of this node in the parent's children vector.
Returns null if this node has no parent or is the parent's last child. This method performs a linear search that is O(n) where n is the number of children; to traverse the entire array, use the parent's child iterator instead. Originally part of java's DefaultMutableTreeNode.
EvioException | if child of parent is not a sibling. |
References evio::BaseStructure::getParent(), evio::BaseStructure::getThis(), and evio::BaseStructure::isNodeSibling().
Referenced by evio::BaseStructure::getNextLeaf(), and evio::BaseStructure::getNextNode().
|
inherited |
Get the number of stored data items like number of banks, ints, floats, etc.
(not the size in ints or bytes). Some items may be padded such as shorts and bytes. This will tell the meaningful number of such data items. In the case of containers, returns number of 32-bit words not in header.
References evio::DataType::CHARSTAR8, evio::DataType::COMPOSITE, evio::BaseStructure::compositeData, evio::DataType::getBytes(), evio::BaseStructure::getStringData(), evio::BaseStructure::header, evio::BaseStructure::isContainer(), evio::BaseStructure::numberDataItems, and evio::BaseStructure::rawBytes.
Referenced by evio::BaseStructure::dataLength().
|
inherited |
Returns this node's parent or null if this node has no parent.
Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::parent.
Referenced by evio::BaseStructure::getNextLeaf(), evio::BaseStructure::getNextNode(), evio::BaseStructure::getNextSibling(), evio::BaseStructure::getPreviousLeaf(), evio::BaseStructure::getPreviousNode(), evio::BaseStructure::getPreviousSibling(), evio::BaseStructure::getSiblingCount(), evio::BaseStructure::isNodeSibling(), evio::BaseStructure::isRoot(), and evio::BaseStructure::removeFromParent().
|
inherited |
Returns the path from the root, to get to this node.
The last element in the path is this node. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getPathToRoot(), and evio::BaseStructure::getThis().
|
protectedinherited |
Builds the parents of node up to and including the root node, where the original node is the last element in the returned vector.
The length of the returned array gives the node's depth in the tree. Originally part of java's DefaultMutableTreeNode.
aNode | the BaseStructure to get the path for. |
depth | an int giving the number of steps already taken towards the root (on recursive calls), used to size the returned vector. |
Referenced by evio::BaseStructure::getPath().
|
inherited |
Returns the leaf before this node or null if this node is the first leaf in the tree.
This operation is very inefficient. In order to determine the previous node, this method first performs a linear search in the parent's child-list in order to find the current node.
This implementation makes the operation suitable for short traversals from a known position. But to traverse all of the leaves in the tree, you should use A depth-first iterator of the nodes in the tree and use isLeaf
on each node to determine which are leaves. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getParent(), and evio::BaseStructure::getPreviousSibling().
|
inherited |
Returns the node that precedes this node in a preorder traversal of this node's tree (return left nodes all the way down before coming back and doing siblings from bottom up).
Returns null
if this node is the first node of the traversal – the root of the tree. This is an inefficient way to traverse the entire tree; use an iterator instead. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getParent(), and evio::BaseStructure::getPreviousSibling().
|
inherited |
Returns the previous sibling of this node in the parent's children vector.
Returns null if this node has no parent or is the parent's first child. This method performs a linear search that is O(n) where n is the number of children. Originally part of java's DefaultMutableTreeNode.
EvioException | if child of parent is not a sibling. |
References evio::BaseStructure::getParent(), evio::BaseStructure::getThis(), and evio::BaseStructure::isNodeSibling().
Referenced by evio::BaseStructure::getPreviousLeaf(), and evio::BaseStructure::getPreviousNode().
|
inherited |
Get the raw data of the structure.
References evio::BaseStructure::rawBytes.
|
inherited |
Returns the root of the tree that contains this node.
The root is the ancestor with a null parent. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getThis().
Referenced by evio::BaseStructure::isNodeRelated().
|
inherited |
Returns the nearest common ancestor to this node and aNode
.
Returns null if no such ancestor exists – if this node and aNode
are in different trees or if aNode
is null. A node is considered an ancestor of itself. Originally part of java's DefaultMutableTreeNode.
aNode | node to find common ancestor with. |
EvioException | if internal logic error. |
aNode
, or null if none. References evio::BaseStructure::getLevel(), and evio::BaseStructure::getThis().
|
inherited |
Gets the raw data as an int16_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateShortData MUST be called!
EvioException | if contained data type is not int16_t. |
References evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, evio::DataType::SHORT16, evio::BaseStructure::shortData, and SWAP_16.
|
inherited |
Returns the number of siblings of this node.
A node is its own sibling (if it has no parent or no siblings, this method returns 1
). Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getParent().
|
inherited |
Gets the raw data (ascii) as an vector of string objects, if the contents type as indicated by the header is appropriate.
For any other behavior, the user should retrieve the data as a bytes and manipulate it in the exact manner desired. If there are non ascii or non-printing ascii chars or the bytes or not in evio format, a single string containing everything is returned.
Originally, in evio versions 1, 2 and 3, only one string was stored. Subsequent changes allowed a vector of strings to be stored and retrieved. The changes are backwards compatible.
The following is true about the string raw data format:
null
if this makes no sense for the given type. References evio::DataType::CHARSTAR8, evio::BaseStructure::header, evio::BaseStructure::rawBytes, evio::BaseStructure::stringList, and evio::BaseStructure::unpackRawBytesToStrings().
Referenced by evio::BaseStructure::getNumberDataItems().
|
inlineoverridevirtual |
This implements the virtual method from BaseStructure
.
This returns the type of this structure, not the type of data this structure holds.
StructureType
of this structure, which is a StructureType::STRUCT_SEGMENT. Reimplemented from evio::BaseStructure.
References evio::StructureType::STRUCT_SEGMENT.
|
inlineinherited |
Referenced by evio::BaseStructure::add(), evio::BaseStructure::bbegin(), evio::BaseStructure::begin(), evio::BaseStructure::bend(), evio::BaseStructure::end(), evio::BaseStructure::getFirstLeaf(), evio::BaseStructure::getLastLeaf(), evio::BaseStructure::getNextSibling(), evio::BaseStructure::getPath(), evio::BaseStructure::getPreviousSibling(), evio::BaseStructure::getRoot(), evio::BaseStructure::getSharedAncestor(), evio::BaseStructure::insert(), evio::BaseStructure::isNodeDescendant(), evio::BaseStructure::removeFromParent(), and evio::BaseStructure::visitAllStructures().
|
inlineinherited |
|
inherited |
Get the length of this structure in bytes, including the header.
References evio::BaseStructure::header.
Referenced by evio::BaseStructure::write().
|
inherited |
Gets the raw data as an unsigned char vector, if the contents type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateCharData MUST be called!
null
if this makes no sense for the given contents type. References evio::BaseStructure::header, evio::BaseStructure::rawBytes, evio::DataType::UCHAR8, and evio::BaseStructure::ucharData.
|
inherited |
Gets the raw data as an uint32_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateUIntData MUST be called!
EvioException | if contained data type is not uint32_t. |
References evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, SWAP_32, evio::DataType::UINT32, and evio::BaseStructure::uintData.
|
inherited |
Gets the raw data as an uint64_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateULongData MUST be called!
EvioException | if contained data type is not uint64_t. |
References evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, SWAP_64, evio::DataType::ULONG64, and evio::BaseStructure::ulongData.
|
inherited |
Gets the raw data as an uint16_t vector if the content type as indicated by the header is appropriate.
If the returned vector's data is modified, then updateUShortData MUST be called!
EvioException | if contained data type is not uint16_t. |
References evio::BaseStructure::header, evio::BaseStructure::needSwap(), evio::BaseStructure::rawBytes, SWAP_16, evio::DataType::USHORT16, and evio::BaseStructure::ushortData.
|
inherited |
Removes newChild
from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child to this node's child array at index childIndex
.
newChild
must not be null and must not be an ancestor of this node. Originally part of java's DefaultMutableBaseStructure.
newChild | the BaseStructure to insert under this node. |
childIndex | the index in this node's child array. where this node is to be inserted. |
std::out_of_range | if childIndex is out of bounds. |
EvioException | if newChild is null, is an ancestor of this node, or this node does not allow children. |
References evio::BaseStructure::allowsChildren, evio::BaseStructure::children, evio::BaseStructure::getThis(), evio::BaseStructure::isNodeAncestor(), and evio::BaseStructure::setLengthsUpToDate().
Referenced by evio::BaseStructure::add().
|
inherited |
Checks whether this structure is a container, i.e.
a structure of structures.
true
if this structure is a container. This is the same check as getAllowsChildren. References evio::BaseStructure::header.
Referenced by evio::BaseStructure::getNumberDataItems().
|
inherited |
Returns true if this node has no children.
To distinguish between nodes that have no children and nodes that cannot have children (e.g. to distinguish files from empty directories), use this method in conjunction with getAllowsChildren
. Originally part of java's DefaultMutableBaseStructure.
References evio::BaseStructure::getChildCount().
Referenced by evio::BaseStructure::dataLength(), evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::treeToString(), and evio::BaseStructure::write().
|
inherited |
Returns true if anotherNode
is an ancestor of this node – if it is this node, this node's parent, or an ancestor of this node's parent.
(Note that a node is considered an ancestor of itself.) If anotherNode
is null, this method returns false. This operation is at worst O(h) where h is the distance from the root to this node. Originally part of java's DefaultMutableTreeNode.
anotherNode | node to test as an ancestor of this node |
anotherNode
References evio::BaseStructure::getThisConst().
Referenced by evio::BaseStructure::insert().
|
inherited |
Returns true if aNode
is a child of this node.
If aNode
is null, this method returns false. Originally part of java's DefaultMutableTreeNode.
aNode | structure to test if it's a child of this one. |
aNode
is a child of this node; false if aNode
is null. References evio::BaseStructure::getChildCount(), and evio::BaseStructure::getThisConst().
Referenced by evio::BaseStructure::getIndex(), and evio::BaseStructure::remove().
|
inherited |
Returns true if anotherNode
is a descendant of this node – if it is this node, one of this node's children, or a descendant of one of this node's children.
Note that a node is considered a descendant of itself. If anotherNode
is null, returns false. This operation is at worst O(h) where h is the distance from the root to anotherNode
. Originally part of java's DefaultMutableTreeNode.
anotherNode | node to test as descendant of this node |
anotherNode
References evio::BaseStructure::getThis().
|
inherited |
Returns true if and only if aNode
is in the same tree as this node.
Returns false if aNode
is null. Originally part of java's DefaultMutableTreeNode.
aNode | structure to test if it's in the same tree as this one. |
aNode
is in the same tree as this node; false if aNode
is null References evio::BaseStructure::getRoot().
|
inherited |
Returns true if anotherNode
is a sibling of (has the same parent as) this node.
A node is its own sibling. If anotherNode
is null, returns false. Originally part of java's DefaultMutableTreeNode.
anotherNode | node to test as sibling of this node. |
EvioException | if sibling has different parent. |
anotherNode
is a sibling of this node. References evio::BaseStructure::getParent(), and evio::BaseStructure::getThisConst().
Referenced by evio::BaseStructure::getNextSibling(), and evio::BaseStructure::getPreviousSibling().
|
inherited |
Returns true if this node is the root of the tree.
The root is the only node in the tree with a null parent; every tree has exactly one root. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getParent().
|
inherited |
Is a byte swap required (i.e.
is the data endian opposite of local endian)?
true
if byte swapping is required. References evio::BaseStructure::byteOrder, and evio::ByteOrder::ENDIAN_LOCAL.
Referenced by evio::BaseStructure::getDoubleData(), evio::BaseStructure::getFloatData(), evio::BaseStructure::getIntData(), evio::BaseStructure::getLongData(), evio::BaseStructure::getShortData(), evio::BaseStructure::getUIntData(), evio::BaseStructure::getULongData(), and evio::BaseStructure::getUShortData().
|
inherited |
Removes the child at the specified index from this node's children and sets that node's parent to null.
The child node to remove must be a BaseStructure
. Originally part of java's DefaultMutableTreeNode.
childIndex | the index of the child to remove |
std::out_of_range | if childIndex is out of bounds |
References evio::BaseStructure::children, evio::BaseStructure::end(), evio::BaseStructure::getChildAt(), and evio::BaseStructure::setLengthsUpToDate().
|
inherited |
Removes aChild
from this node's child vector, giving it a null parent.
Originally part of java's DefaultMutableTreeNode.
aChild | a child of this node to remove |
EvioException | if aChild is not a child of this node |
References evio::BaseStructure::getIndex(), and evio::BaseStructure::isNodeChild().
|
inherited |
Removes all of this node's children, setting their parents to null.
If this node has no children, this method does nothing. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getChildCount().
Referenced by evio::BaseStructure::setAllowsChildren().
|
inherited |
Removes the subtree rooted at this node from the tree, giving this node a null parent.
Does nothing if this node is the root of its tree. Originally part of java's DefaultMutableTreeNode.
References evio::BaseStructure::getParent(), and evio::BaseStructure::getThis().
|
inherited |
Compute and set length of all header fields for this structure and all its descendants.
For writing events, this will be crucial for setting the values in the headers.
EvioException | if the length is too large. |
References evio::BaseStructure::children, evio::BaseStructure::dataLength(), evio::BaseStructure::header, evio::BaseStructure::isLeaf(), evio::BaseStructure::lengthsUpToDate, and evio::BaseStructure::setLengthsUpToDate().
Referenced by evio::BaseStructure::updateCharData(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateStringData(), evio::BaseStructure::updateUCharData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), and evio::BaseStructure::updateUShortData().
|
inherited |
Determines whether or not this node is allowed to have children.
If allows
is false, all of this node's children are removed. Originally part of java's DefaultMutableTreeNode.
Note: By default, a node allows children.
allows | true if this node is allowed to have children. |
References evio::BaseStructure::allowsChildren, and evio::BaseStructure::removeAllChildren().
|
inherited |
Set the byte order of this data.
This method cannot be used to swap data. It is only used to describe the endianness of the rawdata contained.
order | ByteOrder#ENDIAN_BIG or ByteOrder#ENDIAN_LITTLE. |
References evio::BaseStructure::byteOrder.
|
protectedinherited |
Set whether the lengths of all header fields for this structure and all it descendants are up to date or not.
lenUpToDate | are the lengths of all header fields for this structure and all it descendants up to date or not. |
References evio::BaseStructure::lengthsUpToDate, and evio::BaseStructure::parent.
Referenced by evio::BaseStructure::insert(), evio::BaseStructure::remove(), evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::updateCharData(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateStringData(), evio::BaseStructure::updateUCharData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), and evio::BaseStructure::updateUShortData().
|
protectedinherited |
Sets this node's parent to newParent
but does not change the parent's child array.
This method is called from insert and remove to reassign a child's parent, it should not be messaged from anywhere else. Originally part of java's DefaultMutableBaseStructure.
newParent | this node's new parent. |
References evio::BaseStructure::parent.
|
protectedinherited |
Set the data for the structure.
bytes | pointer to the data to be copied. |
len | number of bytes to be copied. |
References evio::BaseStructure::rawBytes.
|
protectedinherited |
Set the data for the structure.
bytes | vector of data to be copied. |
References evio::BaseStructure::rawBytes.
|
protectedinherited |
This method transforms the internal vector of strings into internal rawBytes vector of evio format data not including header.
References evio::BaseStructure::header, evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::stringList, and evio::Util::stringsToRawSize().
Referenced by evio::BaseStructure::updateStringData().
|
staticinherited |
This method transforms a vector of strings into raw evio format data, not including header.
strings | vector of strings to transform. |
bytes | vector of bytes to contain evio formatted strings. |
References evio::BaseStructure::stringsToRawSize().
|
staticinherited |
This method returns the number of bytes in a raw evio format of the given string vector, not including header.
strings | vector of strings to size. |
Referenced by evio::BaseStructure::stringsToRawBytes().
|
staticinherited |
This method returns the number of bytes in a raw evio format of the given string vector, not including header.
str | vector of strings to size. |
|
virtualinherited |
Obtain a string representation of the structure.
Reimplemented in evio::EvioEvent.
References evio::BaseStructure::children, evio::BaseStructure::getStructureType(), evio::BaseStructure::header, evio::BaseStructure::rawBytes, evio::StructureType::STRUCT_BANK, evio::StructureType::toString(), and evio::DataType::toString().
Referenced by evio::BaseStructure::treeToString().
|
inherited |
This method does a partial copy and is designed to help convert between banks, segments,and tagsegments in the StructureTransformer class (hence the name "transform").
It copies all the data from another BaseStructure object. Children are not copied in the deep clone way, but their references are added to this structure. It does not copy header data or the parent either.
structure | BaseStructure from which to copy data. |
References evio::BaseStructure::children, evio::DataType::getDataType(), evio::DataType::isStructure(), and evio::BaseStructure::lengthsUpToDate.
|
inherited |
Recursive method to obtain a string representation of the entire tree structure rooted at this structure.
indent | string containing indentation for this structure. Generally called with "". |
References evio::BaseStructure::children, evio::BaseStructure::getChildCount(), evio::BaseStructure::isLeaf(), and evio::BaseStructure::toString().
|
inherited |
Extract string data from rawBytes array.
References evio::BaseStructure::badStringFormat, evio::BaseStructure::rawBytes, evio::BaseStructure::stringEnd, and evio::BaseStructure::stringList.
Referenced by evio::BaseStructure::getStringData(), and evio::BaseStructure::unpackRawBytesToStrings().
|
staticinherited |
This method extracts a vector of strings from bytes of raw evio string data.
bytes | raw evio string data. |
offset | offset into raw data array. |
strData | vector in which to place extracted strings. |
References evio::BaseStructure::unpackRawBytesToStrings().
|
staticinherited |
This method extracts a vector of strings from bytes of raw evio string data.
Don't go beyond the specified max character limit and stop at the first non-character value.
bytes | raw evio string data. |
offset | offset into raw data vector. |
maxLength | max length in bytes of valid data in bytes vector. |
strData | vector in which to place extracted strings. |
|
staticinherited |
This method extracts a vector of strings from bytes of raw evio string data.
Don't go beyond the specified max character limit and stop at the first non-character value.
bytes | raw evio string data. |
length | length in bytes of valid data at bytes pointer. |
strData | vector in which to place extracted strings. |
|
staticinherited |
This method extracts a vector of strings from buffer containing raw evio string data.
buffer | buffer containing evio string data. |
pos | position of string data in buffer. |
length | length of string data in buffer in bytes. |
strData | vector in which to place extracted strings. |
References evio::ByteBuffer::array(), and evio::ByteBuffer::arrayOffset().
|
inherited |
If data in this structure was changed by modifying the vector returned from getCharData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::DataType::CHAR8, evio::BaseStructure::charData, evio::BaseStructure::header, evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getCompositeData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::DataType::COMPOSITE, evio::BaseStructure::compositeData, evio::CompositeData::generateRawBytes(), evio::BaseStructure::header, evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getDoubleData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap64(), evio::DataType::DOUBLE64, evio::BaseStructure::doubleData, evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getFloatData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap32(), evio::DataType::FLOAT32, evio::BaseStructure::floatData, evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getIntData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap32(), evio::BaseStructure::header, evio::DataType::INT32, evio::BaseStructure::intData, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getLongData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap64(), evio::BaseStructure::header, evio::DataType::LONG64, evio::BaseStructure::longData, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getShortData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap16(), evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::DataType::SHORT16, evio::BaseStructure::shortData, and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getStringData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::DataType::CHARSTAR8, evio::BaseStructure::header, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::BaseStructure::stringsToRawBytes(), and evio::DataType::toString().
|
inherited |
If data in this structure was changed by modifying the vector returned from getUCharData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::header, evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::DataType::toString(), evio::DataType::UCHAR8, and evio::BaseStructure::ucharData.
|
inherited |
If data in this structure was changed by modifying the vector returned from getUIntData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap32(), evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::DataType::toString(), evio::DataType::UINT32, and evio::BaseStructure::uintData.
|
inherited |
If data in this structure was changed by modifying the vector returned from getULongData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap64(), evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::DataType::toString(), evio::DataType::ULONG64, and evio::BaseStructure::ulongData.
|
inherited |
If data in this structure was changed by modifying the vector returned from getUShortData(), then this method needs to be called in order to make this object internally consistent.
EvioException | if this object corresponds to a different data type. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap16(), evio::BaseStructure::header, evio::ByteOrder::needToSwap(), evio::BaseStructure::numberDataItems, evio::BaseStructure::rawBytes, evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), evio::DataType::toString(), evio::DataType::USHORT16, and evio::BaseStructure::ushortData.
|
inherited |
Visit all the structures in this structure (including the structure itself – which is considered its own descendant).
This is similar to listening to the event as it is being parsed, but is done to a complete (already) parsed event.
listener | a listener to notify as each structure is visited. |
References evio::BaseStructure::getThis().
Referenced by evio::BaseStructure::getMatchingStructures().
|
inherited |
Visit all the structures in this structure (including the structure itself – which is considered its own descendant) in a depth first manner.
listener | a listener to notify as each structure is visited. |
filter | an optional filter that must "accept" structures before they are passed to the listener. If null , all structures are passed. In this way, specific types of structures can be captured. |
References evio::BaseStructure::getThis().
|
inherited |
Write myself out into a byte buffer with fastest algorithm I could find.
byteBuffer | the byteBuffer to write to. |
overflow_error | if too little space in byteBuffer. |
References evio::ByteBuffer::array(), evio::ByteBuffer::arrayOffset(), evio::BaseStructure::getTotalBytes(), evio::ByteBuffer::order(), evio::ByteBuffer::position(), and evio::ByteBuffer::remaining().
|
inherited |
Write myself out to a pointer.
dest | pointer at which to write evio format data of this bank. |
order | byte order in which to write. |
References evio::BaseStructure::byteOrder, evio::ByteOrder::byteSwap16(), evio::ByteOrder::byteSwap32(), evio::ByteOrder::byteSwap64(), evio::DataType::CHAR8, evio::BaseStructure::charData, evio::DataType::CHARSTAR8, evio::BaseStructure::children, evio::DataType::COMPOSITE, evio::DataType::DOUBLE64, evio::BaseStructure::doubleData, evio::DataType::FLOAT32, evio::BaseStructure::floatData, evio::BaseStructure::header, evio::DataType::INT32, evio::BaseStructure::intData, evio::BaseStructure::isLeaf(), evio::ByteOrder::isLocalEndian(), evio::DataType::LONG64, evio::BaseStructure::longData, evio::BaseStructure::rawBytes, evio::DataType::SHORT16, evio::BaseStructure::shortData, evio::CompositeData::swapAll(), evio::DataType::UCHAR8, evio::DataType::UINT32, evio::DataType::ULONG64, evio::DataType::UNKNOWN32, and evio::DataType::USHORT16.
|
inherited |
Write myself out as evio format data in the data's current byte order given by getByteOrder() at the given pointer.
This method is much more efficient than using write(uint8_t *, ByteOrder const &).
However, be warned that this method is only useful when this structure has just been read from a file or buffer. Once the user adds data (and does not call the appropriate update method) or children to this structure, this method does NOT produce correct results.
dest | pointer at which to write evio format data of this bank in currently set byte order. |
References evio::BaseStructure::byteOrder, evio::BaseStructure::header, and evio::BaseStructure::rawBytes.
|
inherited |
Write myself into a ByteBuffer as evio format data in the data's current byte order given by getByteOrder().
This method is much more efficient than using write(ByteBuffer &).
However, be warned that this method is only useful when this structure has just been read from a file or buffer. Once the user adds data (and does not call the appropriate update method) or children to this structure, this method does NOT produce correct results.
dest | destination ByteBuffer to contain evio format data of this bank in currently set byte order. |
References evio::BaseStructure::getByteOrder(), evio::BaseStructure::header, evio::ByteBuffer::order(), evio::ByteBuffer::put(), and evio::BaseStructure::rawBytes.
|
protectedinherited |
True if the node is able to have children.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getAllowsChildren(), evio::BaseStructure::insert(), evio::BaseStructure::operator=(), and evio::BaseStructure::setAllowsChildren().
|
protectedinherited |
True if char data has non-ascii or non-printable characters, or has too little data to be in proper format.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::operator=(), and evio::BaseStructure::unpackRawBytesToStrings().
|
protectedinherited |
Endianness of the raw data if appropriate.
Initialize to local endian.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getByteOrder(), evio::BaseStructure::getCompositeData(), evio::BaseStructure::needSwap(), evio::BaseStructure::operator=(), evio::BaseStructure::setByteOrder(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), evio::BaseStructure::updateUShortData(), evio::BaseStructure::write(), and evio::BaseStructure::writeQuick().
|
protectedinherited |
Used if raw data should be interpreted as signed chars.
The reason rawBytes is not used directly is because it may be padded and it may not, depending on whether this object was created by EvioReader or by EventBuilder, etc., etc. We don't want to return rawBytes when a user calls getCharData() if there are padding bytes in it.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getCharData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateCharData(), and evio::BaseStructure::write().
|
protectedinherited |
Array of children, may be null if this node has no children.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::childrenBegin(), evio::BaseStructure::childrenEnd(), evio::BaseStructure::getChildAt(), evio::BaseStructure::getChildCount(), evio::BaseStructure::getChildren(), evio::BaseStructure::getIndex(), evio::BaseStructure::insert(), evio::BaseStructure::operator=(), evio::BaseStructure::remove(), evio::BaseStructure::setAllHeaderLengths(), evio::EvioEvent::toString(), evio::BaseStructure::toString(), evio::BaseStructure::transform(), evio::BaseStructure::treeToString(), and evio::BaseStructure::write().
|
protectedinherited |
Used if raw data should be interpreted as composite type.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getCompositeData(), evio::BaseStructure::getNumberDataItems(), evio::BaseStructure::operator=(), and evio::BaseStructure::updateCompositeData().
|
protectedinherited |
Used if raw data should be interpreted as doubles.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getDoubleData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateDoubleData(), and evio::BaseStructure::write().
|
protectedinherited |
Used if raw data should be interpreted as floats.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getFloatData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateFloatData(), and evio::BaseStructure::write().
|
protectedinherited |
Holds the header of the bank as a shared pointer.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::dataLength(), evio::BaseStructure::getCharData(), evio::BaseStructure::getCompositeData(), evio::BaseStructure::getDoubleData(), evio::BaseStructure::getFloatData(), evio::BaseStructure::getHeader(), evio::BaseStructure::getIntData(), evio::BaseStructure::getLongData(), evio::BaseStructure::getNumberDataItems(), evio::BaseStructure::getShortData(), evio::BaseStructure::getStringData(), evio::BaseStructure::getTotalBytes(), evio::BaseStructure::getUCharData(), evio::BaseStructure::getUIntData(), evio::BaseStructure::getULongData(), evio::BaseStructure::getUShortData(), evio::BaseStructure::isContainer(), evio::BaseStructure::operator=(), evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::stringsToRawBytes(), evio::EvioEvent::toString(), evio::BaseStructure::toString(), evio::BaseStructure::updateCharData(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateStringData(), evio::BaseStructure::updateUCharData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), evio::BaseStructure::updateUShortData(), evio::BaseStructure::write(), and evio::BaseStructure::writeQuick().
|
protectedinherited |
Used if raw data should be interpreted as ints.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getIntData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateIntData(), and evio::BaseStructure::write().
|
protectedinherited |
Keep track of whether header length data is up-to-date or not.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getLengthsUpToDate(), evio::BaseStructure::operator=(), evio::BaseStructure::setAllHeaderLengths(), evio::BaseStructure::setLengthsUpToDate(), and evio::BaseStructure::transform().
|
protectedinherited |
Used if raw data should be interpreted as longs.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getLongData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateLongData(), and evio::BaseStructure::write().
|
protectedinherited |
The number of stored data items like number of banks, ints, floats, etc.
(not the size in ints or bytes). Some items may be padded such as shorts and bytes. This will tell the meaningful number of such data items. In other words, no padding is included. In the case of containers, returns number of bytes not in header.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getNumberDataItems(), evio::BaseStructure::operator=(), evio::BaseStructure::stringsToRawBytes(), evio::BaseStructure::updateCharData(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateUCharData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), and evio::BaseStructure::updateUShortData().
|
protectedinherited |
This node's parent, or null if this node has no parent.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getParent(), evio::BaseStructure::operator=(), evio::BaseStructure::setLengthsUpToDate(), and evio::BaseStructure::setParent().
|
protectedinherited |
The raw data of the structure.
May contain padding.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::dataLength(), evio::BaseStructure::getCharData(), evio::BaseStructure::getCompositeData(), evio::BaseStructure::getDoubleData(), evio::BaseStructure::getFloatData(), evio::BaseStructure::getIntData(), evio::BaseStructure::getLongData(), evio::BaseStructure::getNumberDataItems(), evio::BaseStructure::getRawBytes(), evio::BaseStructure::getShortData(), evio::BaseStructure::getStringData(), evio::BaseStructure::getUCharData(), evio::BaseStructure::getUIntData(), evio::BaseStructure::getULongData(), evio::BaseStructure::getUShortData(), evio::BaseStructure::operator=(), evio::BaseStructure::setRawBytes(), evio::BaseStructure::stringsToRawBytes(), evio::EvioEvent::toString(), evio::BaseStructure::toString(), evio::BaseStructure::unpackRawBytesToStrings(), evio::BaseStructure::updateCharData(), evio::BaseStructure::updateCompositeData(), evio::BaseStructure::updateDoubleData(), evio::BaseStructure::updateFloatData(), evio::BaseStructure::updateIntData(), evio::BaseStructure::updateLongData(), evio::BaseStructure::updateShortData(), evio::BaseStructure::updateUCharData(), evio::BaseStructure::updateUIntData(), evio::BaseStructure::updateULongData(), evio::BaseStructure::updateUShortData(), evio::BaseStructure::write(), and evio::BaseStructure::writeQuick().
|
protectedinherited |
Used if raw data should be interpreted as shorts.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getShortData(), evio::BaseStructure::operator=(), evio::BaseStructure::updateShortData(), and evio::BaseStructure::write().
|
protectedinherited |
Keep track of end of the last string added to stringData (including null but not padding).
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::operator=(), and evio::BaseStructure::unpackRawBytesToStrings().
|
protectedinherited |
Used if raw data should be interpreted as a string.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getStringData(), evio::BaseStructure::operator=(), evio::BaseStructure::stringsToRawBytes(), and evio::BaseStructure::unpackRawBytesToStrings().
|
protectedinherited |
Used if raw data should be interpreted as unsigned chars.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getUCharData(), evio::BaseStructure::operator=(), and evio::BaseStructure::updateUCharData().
|
protectedinherited |
Used if raw data should be interpreted as unsigned ints.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getUIntData(), evio::BaseStructure::operator=(), and evio::BaseStructure::updateUIntData().
|
protectedinherited |
Used if raw data should be interpreted as unsigned longs.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getULongData(), evio::BaseStructure::operator=(), and evio::BaseStructure::updateULongData().
|
protectedinherited |
Used if raw data should be interpreted as unsigned shorts.
Referenced by evio::BaseStructure::BaseStructure(), evio::BaseStructure::getUShortData(), evio::BaseStructure::operator=(), and evio::BaseStructure::updateUShortData().