evio  6.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::EvioNode Class Reference

#include <EvioNode.h>

Public Member Functions

 EvioNode (const EvioNode &)=delete
 
 ~EvioNode ()=default
 
EvioNodeoperator= (const EvioNode &other)=delete
 
bool operator== (const EvioNode &src) const
 Comparison operator. More...
 
bool operator== (std::shared_ptr< const EvioNode > &src) const
 Comparison operator. More...
 
void shift (int deltaPos)
 Shift the positions (pos, dataPos, and recordPos) of this node and its children by a fixed amount. More...
 
std::string toString () const
 Get a string representation of this object. More...
 
void clearLists ()
 Clear childNodes. More...
 
void clear ()
 Clear all data in this object. More...
 
void clearObjects ()
 Empty all lists and remove all other objects from this object. More...
 
void clearIntArray ()
 Only clear the data vector. More...
 
void setBuffer (std::shared_ptr< ByteBuffer > &buf)
 Set the buffer. More...
 
void setData (size_t position, uint32_t plc, std::shared_ptr< ByteBuffer > &buf, RecordNode &recNode)
 Once this node is cleared, it may be reused and then re-initialized with this method. More...
 
void setData (size_t position, uint32_t plc, size_t recPos, std::shared_ptr< ByteBuffer > &buf)
 Once this node is cleared, it may be reused and then re-initialized with this method. More...
 
bool isObsolete () const
 Has the data this node represents in the buffer been removed? More...
 
void setObsolete (bool ob)
 Set whether this node & descendants are now obsolete because the data they represent in the buffer has been removed. More...
 
std::vector< std::shared_ptr< EvioNode > > & getAllNodes ()
 Get the vector of all nodes that this node contains, always including itself. More...
 
std::vector< std::shared_ptr< EvioNode > > & getChildNodes ()
 Get the vector of all child nodes that this node contains. More...
 
void getAllDescendants (std::vector< std::shared_ptr< EvioNode >> &descendants)
 Get the list of all descendant nodes that this node contains - not only the immediate children. More...
 
std::shared_ptr< EvioNodegetChildAt (uint32_t index)
 Get the child node at the given index (starts at 0). More...
 
uint32_t getChildCount () const
 Get the number all children that this node contains. More...
 
uint32_t getChildCount (int level)
 Get the number of children that this node contains at a single level of the evio tree. More...
 
std::shared_ptr< ByteBuffer > & getBuffer ()
 Get the buffer containing this node. More...
 
uint32_t getLength () const
 Get the length of this evio structure (not including length word itself) in 32-bit words. More...
 
uint32_t getTotalBytes () const
 Get the length of this evio structure including entire header in bytes. More...
 
uint16_t getTag () const
 Get the tag of this evio structure. More...
 
uint8_t getNum () const
 Get the num of this evio structure. More...
 
uint32_t getPad () const
 Get the padding of this evio structure. More...
 
size_t getPosition () const
 Get the file/buffer byte position of this evio structure. More...
 
uint32_t getType () const
 Get the evio type of this evio structure, not what it contains. More...
 
DataType getTypeObj () const
 Get the evio type of this evio structure as an object. More...
 
uint32_t getDataLength () const
 Get the length of this evio structure's data only (no header words) in 32-bit words. More...
 
size_t getDataPosition () const
 Get the file/buffer byte position of this evio structure's data. More...
 
uint32_t getDataType () const
 Get the evio type of the data this evio structure contains. More...
 
DataType getDataTypeObj () const
 Get the evio type of the data this evio structure contains as an object. More...
 
size_t getRecordPosition () const
 Get the file/buffer byte position of the record containing this node. More...
 
uint32_t getPlace () const
 Get the place of containing event in file/buffer. More...
 
std::shared_ptr< EvioNodegetParentNode ()
 Get this node's parent node. More...
 
uint32_t getEventNumber () const
 If this object represents an event (top-level, evio bank), then returns its number (place in file or buffer) starting with 1. More...
 
bool isEvent () const
 Does this object represent an event? More...
 
bool getScanned () const
 Has this object been scanned (i.e. More...
 
void updateLengths (int32_t deltaLen)
 Update the length of this node in the buffer and all its parent nodes as well. More...
 
void updateTag (uint16_t newTag)
 Update, in the buffer, the tag of the structure header this object represents. More...
 
void updateNum (uint8_t newNum)
 Update, in the buffer, the num of the bank header this object represents. More...
 
ByteBuffergetByteData (ByteBuffer &dest, bool copy)
 Get the data associated with this node in ByteBuffer form. More...
 
std::shared_ptr< ByteBuffer > & getByteData (std::shared_ptr< ByteBuffer > &dest, bool copy)
 Get the data associated with this node in ByteBuffer form. More...
 
std::shared_ptr< ByteBuffergetByteData (bool copy)
 Get the data associated with this node in ByteBuffer form. More...
 
std::vector< uint32_t > & getIntData ()
 Get the data associated with this node as an 32-bit integer vector. More...
 
void getIntData (std::vector< uint32_t > &intData)
 Get the data associated with this node as an 32-bit integer vector. More...
 
void getLongData (std::vector< uint64_t > &longData)
 Get the data associated with this node as an 64-bit integer vector. More...
 
void getShortData (std::vector< uint16_t > &shortData)
 Get the data associated with this node as an 16-bit integer vector. More...
 
ByteBuffergetStructureBuffer (ByteBuffer &dest, bool copy)
 Get this node's entire evio structure in ByteBuffer form. More...
 
std::shared_ptr< ByteBuffer > & getStructureBuffer (std::shared_ptr< ByteBuffer > &dest, bool copy)
 Get this node's entire evio structure in ByteBuffer form. More...
 

Static Public Member Functions

template<class ... Args>
static std::shared_ptr< EvioNodecreateEvioNode (Args &&...args)
 Create an instance of an EvioNode as a shared_ptr<EvioNode>. More...
 
static void scanStructure (std::shared_ptr< EvioNode > &node)
 This recursive method stores, in the given EvioNode, all the information about an evio structure and its children found in that node (representing all or part of an underlying ByteBuffer). More...
 
static std::shared_ptr< EvioNode > & extractNode (std::shared_ptr< EvioNode > &bankNode, size_t position)
 This method populates an EvioNode object that will represent an evio bank from that same node containing a reference to the backing buffer and given a position in that buffer. More...
 
static std::shared_ptr< EvioNode > & extractEventNode (std::shared_ptr< ByteBuffer > &buffer, RecordNode &recNode, size_t position, uint32_t place)
 This method extracts an EvioNode object representing an evio event (top level evio bank) from a given buffer, a location in the buffer, and a few other things. More...
 
static std::shared_ptr< EvioNode > & extractEventNode (std::shared_ptr< ByteBuffer > &buffer, size_t recPosition, size_t position, uint32_t place)
 This method extracts an EvioNode object representing an evio event (top level evio bank) from a given buffer, a location in the buffer, and a few other things. More...
 

Public Attributes

uint32_t id = 0
 Local id for testing. More...
 

Static Public Attributes

static uint32_t staticId = 0
 Static id for testing. More...
 

Protected Member Functions

 EvioNode (std::shared_ptr< EvioNode > &firstNode, int dummy)
 Constructor used when swapping data. More...
 
std::shared_ptr< EvioNodegetThis ()
 This methods calls shared_from_this() to obtain a new std::shared_ptr that shares ownership of the current object (this). More...
 

Friends

class Util
 
class EventHeaderParser
 
class EvioCompactReaderV4
 
class EvioCompactReaderV6
 
class EvioCompactStructureHandler
 
class EvioSwap
 

Detailed Description

This class is used to store relevant info about an evio container (bank, segment, or tag segment), without having to de-serialize it into many objects and arrays. It is not thread-safe and is designed for speed.

It designed to allow the user to obtain only shared_ptrs to EvioNode objects. The reason for this (and for extending std::enable_shared_from_this<EvioNode>) is that the allNodes vector must (as in Java) contain a reference to itself. This is only possible thru shared pointers and jumping through some other hoops.

Author
timmer
Date
07/22/2019

Constructor & Destructor Documentation

◆ EvioNode() [1/2]

evio::EvioNode::EvioNode ( std::shared_ptr< EvioNode > &  containingEvent,
int  dummy 
)
explicitprotected

Constructor used when swapping data.

Parameters
containingEventevent containing this node.
dummythis arg is only here to differentiate it from the other constructor taking a shared pointer of EvioNode. Use any value.

◆ EvioNode() [2/2]

evio::EvioNode::EvioNode ( const EvioNode )
delete

◆ ~EvioNode()

evio::EvioNode::~EvioNode ( )
default

Member Function Documentation

◆ clear()

void evio::EvioNode::clear ( )

Clear all data in this object.

References clearObjects().

◆ clearIntArray()

void evio::EvioNode::clearIntArray ( )

Only clear the data vector.

◆ clearLists()

void evio::EvioNode::clearLists ( )

Clear childNodes.

Place only this or eventNode object into the allNodes.

References getThis().

◆ clearObjects()

void evio::EvioNode::clearObjects ( )

Empty all lists and remove all other objects from this object.

Referenced by clear().

◆ createEvioNode()

template<class ... Args>
static std::shared_ptr<EvioNode> evio::EvioNode::createEvioNode ( Args &&...  args)
inlinestatic

Create an instance of an EvioNode as a shared_ptr<EvioNode>.

This variadic template allows createEvioNode to handle all args normally given to EvioNode constructor.

Template Parameters
Args
Parameters
argsargs to pass through to private EvioNode constructors.
Returns
shared pointer of created object.

Referenced by evio::EvioCompactReaderV4::addStructure(), extractEventNode(), evio::CompactEventBuilder::openBank(), evio::CompactEventBuilder::openSegment(), evio::CompactEventBuilder::openTagSegment(), scanStructure(), evio::EvioSwap::swapEvent(), and evio::EvioSwap::swapStructure().

◆ extractEventNode() [1/2]

std::shared_ptr< EvioNode > & evio::EvioNode::extractEventNode ( std::shared_ptr< ByteBuffer > &  buffer,
RecordNode recNode,
size_t  position,
uint32_t  place 
)
static

This method extracts an EvioNode object representing an evio event (top level evio bank) from a given buffer, a location in the buffer, and a few other things.

An EvioNode object represents an evio container - either a bank, segment, or tag segment.

Parameters
bufferbuffer to examine
recNodeobject holding data about block header
positionposition in buffer
placeplace of event in buffer (starting at 0)
Returns
EvioNode object containing evio event information
Exceptions
EvioExceptionif not enough data in buffer to read evio bank header (8 bytes).

References createEvioNode(), and extractNode().

Referenced by evio::Reader::scanBuffer(), and evio::Reader::scanUncompressedBuffer().

◆ extractEventNode() [2/2]

std::shared_ptr< EvioNode > & evio::EvioNode::extractEventNode ( std::shared_ptr< ByteBuffer > &  buffer,
size_t  recPosition,
size_t  position,
uint32_t  place 
)
static

This method extracts an EvioNode object representing an evio event (top level evio bank) from a given buffer, a location in the buffer, and a few other things.

An EvioNode object represents an evio container - either a bank, segment, or tag segment.

Parameters
bufferbuffer to examine
recPositionposition of containing record
positionposition in buffer
placeplace of event in buffer (starting at 0)
Returns
EvioNode object containing evio event information
Exceptions
EvioExceptionif not enough data in buffer to read evio bank header (8 bytes).

References createEvioNode(), and extractNode().

◆ extractNode()

std::shared_ptr< EvioNode > & evio::EvioNode::extractNode ( std::shared_ptr< EvioNode > &  bankNode,
size_t  position 
)
static

This method populates an EvioNode object that will represent an evio bank from that same node containing a reference to the backing buffer and given a position in that buffer.

Parameters
bankNodeEvioNode to represent a bank and containing, at least, a reference to backing buffer.
positionposition in backing buffer
Returns
EvioNode bankNode arg filled with appropriate data.
Exceptions
EvioExceptionif not enough data in buffer to read evio bank header (8 bytes).

References evio::DataType::BANK, evio::ByteBuffer::getInt(), evio::ByteBuffer::getUInt(), evio::DataType::getValue(), and evio::ByteBuffer::remaining().

Referenced by evio::EvioCompactReaderV4::addStructure(), and extractEventNode().

◆ getAllDescendants()

void evio::EvioNode::getAllDescendants ( std::vector< std::shared_ptr< EvioNode >> &  descendants)

Get the list of all descendant nodes that this node contains - not only the immediate children.

This is meaningful only if this node has been scanned, otherwise nothing is added to the given list.

Parameters
descendantslist to be filled with EvioNodes of all descendants

◆ getAllNodes()

std::vector< std::shared_ptr< EvioNode > > & evio::EvioNode::getAllNodes ( )

Get the vector of all nodes that this node contains, always including itself.

This is meaningful only if this node has been scanned, otherwise it contains only itself.

Returns
list of all nodes that this node contains.

◆ getBuffer()

std::shared_ptr< ByteBuffer > & evio::EvioNode::getBuffer ( )

Get the buffer containing this node.

Note, buffer's position and limit may not be set according to this node's position and limit.

Returns
buffer containing this node.

◆ getByteData() [1/3]

std::shared_ptr< ByteBuffer > evio::EvioNode::getByteData ( bool  copy)

Get the data associated with this node in ByteBuffer form.

Depending on the copy argument, the given buffer will be filled with either a copy of or a view into this node's buffer. Position and limit are set for reading.

Parameters
copyif true, then return a copy as opposed to a view into this node's buffer.
Returns
newly created ByteBuffer containing data. Position and limit are set for reading.

◆ getByteData() [2/3]

ByteBuffer & evio::EvioNode::getByteData ( ByteBuffer dest,
bool  copy 
)

Get the data associated with this node in ByteBuffer form.

Depending on the copy argument, the given buffer will be filled with either a copy of or a view into this node's buffer. Position and limit are set for reading.

Parameters
destbuffer in which to place data.
copyif true, then return a copy as opposed to a view into this node's buffer.
Returns
dest arg ByteBuffer containing data. Position and limit are set for reading.

References evio::ByteBuffer::copyData(), and evio::ByteBuffer::limit().

Referenced by getByteData().

◆ getByteData() [3/3]

std::shared_ptr< ByteBuffer > & evio::EvioNode::getByteData ( std::shared_ptr< ByteBuffer > &  dest,
bool  copy 
)

Get the data associated with this node in ByteBuffer form.

Depending on the copy argument, the given buffer will be filled with either a copy of or a view into this node's buffer. Position and limit are set for reading.

Parameters
destbuffer in which to place data.
copyif true, then return a copy as opposed to a view into this node's buffer.
Returns
dest arg ByteBuffer containing data. Position and limit are set for reading.

References getByteData().

◆ getChildAt()

std::shared_ptr< EvioNode > evio::EvioNode::getChildAt ( uint32_t  index)

Get the child node at the given index (starts at 0).

This is meaningful only if this node has been scanned, otherwise it is null.

Parameters
indexindex of child node
Returns
child node at the given index; null if not scanned or no child at that index

◆ getChildCount() [1/2]

uint32_t evio::EvioNode::getChildCount ( ) const

Get the number all children that this node contains.

This is meaningful only if this node has been scanned, otherwise it returns 0.

Returns
number of children that this node contains; 0 if not scanned

◆ getChildCount() [2/2]

uint32_t evio::EvioNode::getChildCount ( int  level)

Get the number of children that this node contains at a single level of the evio tree.

This is meaningful only if this node has been scanned, otherwise it returns 0.

Parameters
levelgo down this many levels in evio structure to count children. A level of 0 means immediate children, 1 means grandchildren, etc.
Returns
number of children that this node contains at the given level; 0 if not scanned or level < 0.

◆ getChildNodes()

std::vector< std::shared_ptr< EvioNode > > & evio::EvioNode::getChildNodes ( )

Get the vector of all child nodes that this node contains.

This is meaningful only if this node has been scanned, otherwise it is null.

Returns
list of all child nodes that this node contains; empty if not scanned or no children

◆ getDataLength()

uint32_t evio::EvioNode::getDataLength ( ) const

Get the length of this evio structure's data only (no header words) in 32-bit words.

Returns
length of this evio structure's data only (no header words) in 32-bit words.

◆ getDataPosition()

size_t evio::EvioNode::getDataPosition ( ) const

Get the file/buffer byte position of this evio structure's data.

Returns
file/buffer byte position of this evio structure's data

◆ getDataType()

uint32_t evio::EvioNode::getDataType ( ) const

Get the evio type of the data this evio structure contains.

Call DataType#getDataType(uint32_t) on the returned value to get the object representation.

Returns
evio type of the data this evio structure contains

◆ getDataTypeObj()

DataType evio::EvioNode::getDataTypeObj ( ) const

Get the evio type of the data this evio structure contains as an object.

Returns
evio type of the data this evio structure contains as an object.

References evio::DataType::getDataType().

Referenced by toString().

◆ getEventNumber()

uint32_t evio::EvioNode::getEventNumber ( ) const

If this object represents an event (top-level, evio bank), then returns its number (place in file or buffer) starting with 1.

If not, return -1.

Returns
event number if representing an event, else -1

◆ getIntData() [1/2]

std::vector< uint32_t > & evio::EvioNode::getIntData ( )

Get the data associated with this node as an 32-bit integer vector.

Store it and return it in future calls (like in event builder). If data is of a type less than 32 bits, the last int will be junk.

Returns
integer array containing data.

◆ getIntData() [2/2]

void evio::EvioNode::getIntData ( std::vector< uint32_t > &  intData)

Get the data associated with this node as an 32-bit integer vector.

Place data in the given vector. If data is of a type less than 32 bits, the last int will be junk.

Parameters
intDatavector in which to store data.

◆ getLength()

uint32_t evio::EvioNode::getLength ( ) const

Get the length of this evio structure (not including length word itself) in 32-bit words.

Returns
length of this evio structure (not including length word itself) in 32-bit words

◆ getLongData()

void evio::EvioNode::getLongData ( std::vector< uint64_t > &  longData)

Get the data associated with this node as an 64-bit integer vector.

Place data in the given vector. If data is of a type less than 64 bits, the last element may be junk.

Parameters
longDatavector in which to store data.

◆ getNum()

uint8_t evio::EvioNode::getNum ( ) const

Get the num of this evio structure.

Will be zero for tagsegments.

Returns
num of this evio structure

◆ getPad()

uint32_t evio::EvioNode::getPad ( ) const

Get the padding of this evio structure.

Will be zero for segments and tagsegments.

Returns
padding of this evio structure

◆ getParentNode()

std::shared_ptr< EvioNode > evio::EvioNode::getParentNode ( )

Get this node's parent node.

Returns
this node's parent node or null if none.

◆ getPlace()

uint32_t evio::EvioNode::getPlace ( ) const

Get the place of containing event in file/buffer.

First event = 0, second = 1, etc. Only for internal use.

Returns
place of containing event in file/buffer.

◆ getPosition()

size_t evio::EvioNode::getPosition ( ) const

Get the file/buffer byte position of this evio structure.

Returns
file/buffer byte position of this evio structure

◆ getRecordPosition()

size_t evio::EvioNode::getRecordPosition ( ) const

Get the file/buffer byte position of the record containing this node.

Since
version 6.
Returns
file/buffer byte position of the record containing this node.

◆ getScanned()

bool evio::EvioNode::getScanned ( ) const

Has this object been scanned (i.e.

has all the information about this node's children been parsed and stored) ?

Returns
true if this object has been scanned, else false

◆ getShortData()

void evio::EvioNode::getShortData ( std::vector< uint16_t > &  shortData)

Get the data associated with this node as an 16-bit integer vector.

Place data in the given vector. If data is of a type less than 16 bits, the last element may be junk.

Parameters
shortDatavectro in which to store data.

◆ getStructureBuffer() [1/2]

ByteBuffer & evio::EvioNode::getStructureBuffer ( ByteBuffer dest,
bool  copy 
)

Get this node's entire evio structure in ByteBuffer form.

Depending on the copy argument, the returned buffer will either have a copy of or a view into the data of this node's buffer. Position and limit are set for reading.

Parameters
destByteBuffer provided to hold the retrieved evio structure.
copyif true, then use a copy of as opposed to a view into this node's buffer.
Returns
dest arg ByteBuffer containing evio structure's bytes. Position and limit are set for reading.

References evio::ByteBuffer::copyData(), and evio::ByteBuffer::limit().

Referenced by getStructureBuffer().

◆ getStructureBuffer() [2/2]

std::shared_ptr< ByteBuffer > & evio::EvioNode::getStructureBuffer ( std::shared_ptr< ByteBuffer > &  dest,
bool  copy 
)

Get this node's entire evio structure in ByteBuffer form.

Depending on the copy argument, the returned buffer will either have a copy of or a view into the data of this node's buffer. Position and limit are set for reading.

Parameters
destByteBuffer provided to hold the retrieved evio structure.
copyif true, then use a copy of as opposed to a view into this node's buffer.
Returns
dest arg ByteBuffer containing evio structure's bytes. Position and limit are set for reading.

References getStructureBuffer().

◆ getTag()

uint16_t evio::EvioNode::getTag ( ) const

Get the tag of this evio structure.

Returns
tag of this evio structure

◆ getThis()

std::shared_ptr<EvioNode> evio::EvioNode::getThis ( )
inlineprotected

This methods calls shared_from_this() to obtain a new std::shared_ptr that shares ownership of the current object (this).

Returns
a new std::shared_ptr that shares ownership of the current object.

Referenced by clearLists(), and setData().

◆ getTotalBytes()

uint32_t evio::EvioNode::getTotalBytes ( ) const

Get the length of this evio structure including entire header in bytes.

Returns
length of this evio structure including entire header in bytes.

◆ getType()

uint32_t evio::EvioNode::getType ( ) const

Get the evio type of this evio structure, not what it contains.

Call DataType#getDataType(uint32_t) on the returned value to get the object representation.

Returns
evio type of this evio structure, not what it contains

Referenced by updateLengths().

◆ getTypeObj()

DataType evio::EvioNode::getTypeObj ( ) const

Get the evio type of this evio structure as an object.

Returns
evio type of this evio structure as an object.

References evio::DataType::getDataType().

Referenced by toString().

◆ isEvent()

bool evio::EvioNode::isEvent ( ) const

Does this object represent an event?

Returns
true if this object represents an event, else false

◆ isObsolete()

bool evio::EvioNode::isObsolete ( ) const

Has the data this node represents in the buffer been removed?

Returns
true if node no longer represents valid buffer data, else false.

◆ operator=()

EvioNode& evio::EvioNode::operator= ( const EvioNode other)
delete

◆ operator==() [1/2]

bool evio::EvioNode::operator== ( const EvioNode src) const

Comparison operator.

Parameters
srcright side object.
Returns
left side object.

◆ operator==() [2/2]

bool evio::EvioNode::operator== ( std::shared_ptr< const EvioNode > &  src) const

Comparison operator.

Parameters
srcright side object.
Returns
left side object.

◆ scanStructure()

void evio::EvioNode::scanStructure ( std::shared_ptr< EvioNode > &  node)
static

This recursive method stores, in the given EvioNode, all the information about an evio structure and its children found in that node (representing all or part of an underlying ByteBuffer).

It uses absolute gets so the underlying buffer's position does not change. In the vector of all nodes contained in each EvioNode object (including the top-level object), the ordering is according to their placement in the buffer (which happens to be depth-first). This method does a depth-first search (DFS).

Parameters
nodenode being scanned

References evio::DataType::BANK, createEvioNode(), evio::DataType::getValue(), evio::DataType::isBank(), evio::DataType::isSegment(), evio::DataType::isStructure(), evio::DataType::SEGMENT, and evio::DataType::TAGSEGMENT.

Referenced by evio::EvioCompactReaderV4::addStructure(), evio::EvioCompactStructureHandler::addStructure(), evio::EvioCompactStructureHandler::getScannedStructure(), and evio::EvioCompactStructureHandler::scanStructure().

◆ setBuffer()

void evio::EvioNode::setBuffer ( std::shared_ptr< ByteBuffer > &  buf)

Set the buffer.

Parameters
bufbuffer associated with this object.

◆ setData() [1/2]

void evio::EvioNode::setData ( size_t  position,
uint32_t  plc,
size_t  recPos,
std::shared_ptr< ByteBuffer > &  buf 
)

Once this node is cleared, it may be reused and then re-initialized with this method.

Parameters
positionposition in buffer
plcplace of event in buffer (starting at 0)
recPosplace of event in containing record (bytes)
bufbuffer to examine

References evio::DataType::BANK, getThis(), and evio::DataType::getValue().

◆ setData() [2/2]

void evio::EvioNode::setData ( size_t  position,
uint32_t  plc,
std::shared_ptr< ByteBuffer > &  buf,
RecordNode recNode 
)

Once this node is cleared, it may be reused and then re-initialized with this method.

Parameters
positionposition in buffer
plcplace of event in buffer (starting at 0)
bufbuffer to examine
recNodeobject holding data about header of block containing event

References evio::DataType::BANK, getThis(), and evio::DataType::getValue().

◆ setObsolete()

void evio::EvioNode::setObsolete ( bool  ob)

Set whether this node & descendants are now obsolete because the data they represent in the buffer has been removed.

Only for internal use.

Parameters
obtrue if node & descendants no longer represent valid buffer data, else false.

◆ shift()

void evio::EvioNode::shift ( int  deltaPos)

Shift the positions (pos, dataPos, and recordPos) of this node and its children by a fixed amount.

Useful, for example, when the contents of one buffer is copied into another.

Parameters
deltaPosnumber of bytes to add to existing positions.
Returns
reference to this object.

◆ toString()

std::string evio::EvioNode::toString ( ) const

Get a string representation of this object.

Returns
a string representation of this object.

References getDataTypeObj(), getTypeObj(), and evio::DataType::toString().

◆ updateLengths()

void evio::EvioNode::updateLengths ( int32_t  deltaLen)

Update the length of this node in the buffer and all its parent nodes as well.

For internal use only.

Parameters
deltaLenchange in length (words). Negative value reduces lengths.

References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::ByteOrder::ENDIAN_BIG, getType(), evio::DataType::SEGMENT, and evio::DataType::TAGSEGMENT.

◆ updateNum()

void evio::EvioNode::updateNum ( uint8_t  newNum)

Update, in the buffer, the num of the bank header this object represents.

Sometimes it's necessary to go back and change the num of an evio structure that's already been written. This will do that.

Parameters
newNumnew num value

References evio::DataType::ALSOBANK, evio::DataType::BANK, and evio::ByteOrder::ENDIAN_BIG.

◆ updateTag()

void evio::EvioNode::updateTag ( uint16_t  newTag)

Update, in the buffer, the tag of the structure header this object represents.

Sometimes it's necessary to go back and change the tag of an evio structure that's already been written. This will do that.

Parameters
newTagnew tag value

References evio::DataType::ALSOBANK, evio::DataType::ALSOSEGMENT, evio::DataType::BANK, evio::ByteOrder::ENDIAN_BIG, evio::DataType::SEGMENT, and evio::DataType::TAGSEGMENT.

Friends And Related Function Documentation

◆ EventHeaderParser

friend class EventHeaderParser
friend

◆ EvioCompactReaderV4

friend class EvioCompactReaderV4
friend

◆ EvioCompactReaderV6

friend class EvioCompactReaderV6
friend

◆ EvioCompactStructureHandler

friend class EvioCompactStructureHandler
friend

◆ EvioSwap

friend class EvioSwap
friend

◆ Util

friend class Util
friend

Member Data Documentation

◆ id

uint32_t evio::EvioNode::id = 0

Local id for testing.

◆ staticId

uint32_t evio::EvioNode::staticId = 0
static

Static id for testing.


The documentation for this class was generated from the following files: