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

Represents an evio tree/event in memory. More...

#include <evioUtil.hxx>

Inheritance diagram for evio::evioDOMTree:
evio::evioStreamParserHandler evio::evioChannelBufferizable

Public Member Functions

 evioDOMTree (void) throw (evioException)
 No-arg constructor creates empty tree name="evio", root node is bank with tag=0, num=0. More...
 
 evioDOMTree (evioDictionary *dictionary) throw (evioException)
 Constructor creates empty tree name="evio" with dictionary, root node is bank with tag=0, num=0. More...
 
 evioDOMTree (const evioChannel &channel, const string &name="evio") throw (evioException)
 Constructor fills tree from contents of evioChannel object, gets dictionary from channel. More...
 
 evioDOMTree (const evioChannel *channel, const string &name="evio") throw (evioException)
 Constructor fills tree from contents of evioChannel object, gets dictionary from channel. More...
 
 evioDOMTree (const uint32_t *buf, const string &name="evio") throw (evioException)
 Constructor fills tree from contents of buffer. More...
 
 evioDOMTree (evioDOMNodeP node, const string &name="evio") throw (evioException)
 Constructor creates tree using node as the root node. More...
 
 evioDOMTree (uint16_t tag, uint8_t num, ContainerType cType=BANK, const string &name="evio") throw (evioException)
 Constructor creates new container node as root node. More...
 
 evioDOMTree (const string &bankName, ContainerType cType=BANK, const string &name="evio") throw (evioException)
 Constructor creates new container node as root node. More...
 
 evioDOMTree (evioDictEntry tn, ContainerType cType=BANK, const string &name="evio") throw (evioException)
 Constructor creates new container node as root node. More...
 
 evioDOMTree (const string &bankName, evioDictionary *dictionary, ContainerType cType=BANK, const string &name="evio") throw (evioException)
 
virtual ~evioDOMTree (void)
 Destructor deletes root node and contents. More...
 
void clear (void) throw (evioException)
 Removes and deletes tree root node and all its contents. More...
 
void addBank (evioDOMNodeP node) throw (evioException)
 Makes node root if tree is empty, or adds node to root if a container. More...
 
template<typename T >
void addBank (uint16_t tag, uint8_t num, const vector< T > &dataVec) throw (evioException)
 
template<typename T >
void addBank (uint16_t tag, uint8_t num, const T *dataBuf, int dataLen) throw (evioException)
 
template<typename T >
void addBank (evioDictEntry tn, const vector< T > &dataVec) throw (evioException)
 
template<typename T >
void addBank (evioDictEntry tn, const T *dataBuf, int dataLen) throw (evioException)
 
template<typename T >
void addBank (const string &name, const vector< T > &dataVec) throw (evioException)
 
template<typename T >
void addBank (const string &name, const T *dataBuf, int dataLen) throw (evioException)
 
void addBank (uint16_t tag, uint8_t num, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &dataVec) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
void addBank (uint16_t tag, uint8_t num, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
void addBank (evioDictEntry tn, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &dataVec) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
void addBank (evioDictEntry tn, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
void addBank (const string &name, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &dataVec) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
void addBank (const string &name, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) throw (evioException)
 Creates leaf node and adds it to tree root node. More...
 
evioDOMNodeP createNode (const string &name, ContainerType cType=BANK) const throw (evioException)
 Creates new container node. More...
 
template<typename T >
evioDOMNodeP createNode (const string &name, const vector< T > &tVec) const throw (evioException)
 
template<typename T >
evioDOMNodeP createNode (const string &name, const T *t, int len) const throw (evioException)
 
evioDOMNodeP createNode (const string &name, const evioSerializable &o, ContainerType cType=BANK) const throw (evioException)
 Creates new container node. More...
 
evioDOMNodeP createNode (const string &name, void(*f)(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) const throw (evioException)
 Creates new container node. More...
 
template<typename T >
evioDOMNodeP createNode (const string &name, T *t, void *userArg, ContainerType cType=BANK) const throw (evioException)
 
template<typename T >
evioDOMNodeP createNode (const string &name, T *t, void *T::*mfp(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) const throw (evioException)
 
evioDOMNodeP createNode (const string &name, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &dataVec) const throw (evioException)
 Creates new composite leaf node. More...
 
evioDOMNodeP createNode (const string &name, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) const throw (evioException)
 Creates new composite leaf node. More...
 
evioDOMTreeoperator<< (evioDOMNodeP node) throw (evioException)
 Makes node root if tree is empty, or adds node to root if a container. More...
 
int getSerializedLength (void) const throw (evioException)
 Gets serialized length of tree. More...
 
int toEVIOBuffer (uint32_t *buf, int size) const throw (evioException)
 Serializes tree to buffer. More...
 
evioDOMNodeListP getNodeList (void) throw (evioException)
 Returns list of all nodes in tree. More...
 
evioDOMNodeListP getNodeList (const string &name) throw (evioException)
 Returns list of all nodes in tree with particular name, evioDictEntry from dictionary. More...
 
template<class Predicate >
evioDOMNodeListP getNodeList (Predicate pred) throw (evioException)
 
template<class Predicate >
evioDOMNodeP getFirstNode (Predicate pred) throw (evioException)
 
template<typename T >
vector< T > * getVectorUnique (void) throw (evioException)
 
template<typename T , class Predicate >
vector< T > * getVectorUnique (Predicate pred) throw (evioException)
 
string toString (void) const
 Returns XML string listing tree contents. More...
 
string toString (const evioToStringConfig *config) const
 Returns XML string listing tree contents. More...
 
string toString (const evioToStringConfig &config) const
 
const evioDictionarygetDictionary (void) const
 Sets dictionary to use by this tree. More...
 
void setDictionary (const evioDictionary *dict)
 Sets dictionary to use by this tree. More...
 
void setDictionary (const evioDictionary &dict)
 Sets dictionary to use by this tree. More...
 
- Public Member Functions inherited from evio::evioStreamParserHandler
virtual ~evioStreamParserHandler (void)
 
- Public Member Functions inherited from evio::evioChannelBufferizable
virtual ~evioChannelBufferizable ()
 

Public Attributes

evioDOMNodeP root
 Pointer to root node of tree. More...
 
string name
 Name of tree. More...
 
const evioDictionarydictionary
 Dictionary to use for this tree. More...
 

Detailed Description

Represents an evio tree/event in memory.

Tree root is an evioDOMNode.

Constructor & Destructor Documentation

evioDOMTree::evioDOMTree ( void  )
throw (evioException
)

No-arg constructor creates empty tree name="evio", root node is bank with tag=0, num=0.

References evio::BANK.

evioDOMTree::evioDOMTree ( evioDictionary dict)
throw (evioException
)

Constructor creates empty tree name="evio" with dictionary, root node is bank with tag=0, num=0.

Parameters
dictdictionary

References evio::BANK.

evioDOMTree::evioDOMTree ( const evioChannel channel,
const string &  name = "evio" 
)
throw (evioException
)

Constructor fills tree from contents of evioChannel object, gets dictionary from channel.

Parameters
channelevioChannel object
nameName of tree
evioDOMTree::evioDOMTree ( const evioChannel channel,
const string &  name = "evio" 
)
throw (evioException
)

Constructor fills tree from contents of evioChannel object, gets dictionary from channel.

Parameters
channelPointer to evioChannel object
nameName of tree
evioDOMTree::evioDOMTree ( const uint32_t *  buf,
const string &  name = "evio" 
)
throw (evioException
)

Constructor fills tree from contents of buffer.

Parameters
bufBuffer containing event
nameName of tree
evioDOMTree::evioDOMTree ( evioDOMNodeP  node,
const string &  name = "evio" 
)
throw (evioException
)

Constructor creates tree using node as the root node.

Parameters
nodePointer to node that becomes the root node
nameName of tree
evioDOMTree::evioDOMTree ( uint16_t  tag,
uint8_t  num,
ContainerType  cType = BANK,
const string &  name = "evio" 
)
throw (evioException
)

Constructor creates new container node as root node.

Parameters
tagRoot node tag
numRoot node num
cTypeRoot node content type
nameName of tree
evioDOMTree::evioDOMTree ( const string &  bankName,
ContainerType  cType = BANK,
const string &  name = "evio" 
)
throw (evioException
)

Constructor creates new container node as root node.

Parameters
tagRoot node name
cTypeRoot node content type
nameName of tree

References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().

evioDOMTree::evioDOMTree ( evioDictEntry  tn,
ContainerType  cType = BANK,
const string &  name = "evio" 
)
throw (evioException
)

Constructor creates new container node as root node.

Parameters
nameRoot node evioDictEntry
cTypeRoot node content type
nameName of tree
evio::evioDOMTree::evioDOMTree ( const string &  bankName,
evioDictionary dictionary,
ContainerType  cType = BANK,
const string &  name = "evio" 
)
throw (evioException
)
evioDOMTree::~evioDOMTree ( void  )
virtual

Destructor deletes root node and contents.

Member Function Documentation

void evioDOMTree::addBank ( evioDOMNodeP  node)
throw (evioException
)

Makes node root if tree is empty, or adds node to root if a container.

Parameters
nodeNode to add to tree

References evio::evioDOMContainerNode::childList.

template<typename T >
void evio::evioDOMTree::addBank ( uint16_t  tag,
uint8_t  num,
const vector< T > &  dataVec 
)
throw (evioException
)
template<typename T >
void evio::evioDOMTree::addBank ( uint16_t  tag,
uint8_t  num,
const T *  dataBuf,
int  dataLen 
)
throw (evioException
)
template<typename T >
void evio::evioDOMTree::addBank ( evioDictEntry  tn,
const vector< T > &  dataVec 
)
throw (evioException
)
template<typename T >
void evio::evioDOMTree::addBank ( evioDictEntry  tn,
const T *  dataBuf,
int  dataLen 
)
throw (evioException
)
template<typename T >
void evio::evioDOMTree::addBank ( const string &  name,
const vector< T > &  dataVec 
)
throw (evioException
)
template<typename T >
void evio::evioDOMTree::addBank ( const string &  name,
const T *  dataBuf,
int  dataLen 
)
throw (evioException
)
void evioDOMTree::addBank ( uint16_t  tag,
uint8_t  num,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const vector< uint32_t > &  dataVec 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
tagNode tag
numNode num
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
dataVecvector<T> of data

References evio::evioDOMContainerNode::childList, and evio::evioDOMNode::parent.

void evioDOMTree::addBank ( uint16_t  tag,
uint8_t  num,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const uint32_t *  t,
int  len 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
tagNode tag
numNode num
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
tarray of uint32_t data len Length of array

References evio::evioDOMContainerNode::childList, and evio::evioDOMNode::parent.

void evioDOMTree::addBank ( evioDictEntry  tn,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const vector< uint32_t > &  dataVec 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
tnLeaf evioDictEntry
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
dataVecvector<T> of data
void evioDOMTree::addBank ( evioDictEntry  tn,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const uint32_t *  t,
int  len 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
tnLeaf evioDictEntry
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
tarray of uint32_t data len Length of array
void evioDOMTree::addBank ( const string &  name,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const vector< uint32_t > &  dataVec 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
nameLeaf node name
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
dataVecvector<T> of data

References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().

void evioDOMTree::addBank ( const string &  name,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const uint32_t *  t,
int  len 
)
throw (evioException
)

Creates leaf node and adds it to tree root node.

Parameters
nameLeaf node name
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
tarray of uint32_t data len Length of array

References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().

void evioDOMTree::clear ( void  )
throw (evioException
)

Removes and deletes tree root node and all its contents.

References evio::evioDOMNode::cutAndDelete().

evioDOMNodeP evioDOMTree::createNode ( const string &  nName,
ContainerType  cType = BANK 
) const
throw (evioException
)

Creates new container node.

Parameters
nNameNode name
ContainerTypeType of container node
Returns
Pointer to new node
template<typename T >
evioDOMNodeP evio::evioDOMTree::createNode ( const string &  name,
const vector< T > &  tVec 
) const
throw (evioException
)
template<typename T >
evioDOMNodeP evio::evioDOMTree::createNode ( const string &  name,
const T *  t,
int  len 
) const
throw (evioException
)
evioDOMNodeP evioDOMTree::createNode ( const string &  nName,
const evioSerializable o,
ContainerType  cType = BANK 
) const
throw (evioException
)

Creates new container node.

Parameters
nNameNode name
ContainerTypeType of container node
Returns
Pointer to new node
evioDOMNodeP evioDOMTree::createNode ( const string &  nName,
void(*)(evioDOMNodeP c, void *userArg)  f,
void *  userArg,
ContainerType  cType = BANK 
) const
throw (evioException
)

Creates new container node.

Parameters
nNameNode name
ContainerTypeType of container node
Returns
Pointer to new node
template<typename T >
evioDOMNodeP evio::evioDOMTree::createNode ( const string &  name,
T *  t,
void *  userArg,
ContainerType  cType = BANK 
) const
throw (evioException
)
template<typename T >
evioDOMNodeP evio::evioDOMTree::createNode ( const string &  name,
T *  t,
void *T::*  mfpevioDOMNodeP c, void *userArg,
void *  userArg,
ContainerType  cType = BANK 
) const
throw (evioException
)
evioDOMNodeP evioDOMTree::createNode ( const string &  nName,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const vector< uint32_t > &  dataVec 
) const
throw (evioException
)

Creates new composite leaf node.

Parameters
nNameNode name
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
dataVecVector of uint32_t data
Returns
Pointer to new node
evioDOMNodeP evioDOMTree::createNode ( const string &  nName,
uint16_t  formatTag,
const string &  formatString,
uint16_t  dataTag,
uint8_t  dataNum,
const uint32_t *  t,
int  len 
) const
throw (evioException
)

Creates new composite leaf node.

Parameters
nNameNode name
formatTagFormat tag
formatStringFormat string
dataTagData tag
dataNumData num
dataVecPointer to arry of uint32_t data
lenLength of array
Returns
Pointer to new node
const evioDictionary * evioDOMTree::getDictionary ( void  ) const

Sets dictionary to use by this tree.

Returns
Const pointer to dictionary
template<class Predicate >
evioDOMNodeP evio::evioDOMTree::getFirstNode ( Predicate  pred)
throw (evioException
)
evioDOMNodeListP evioDOMTree::getNodeList ( void  )
throw (evioException
)

Returns list of all nodes in tree.

Returns
Pointer to list of nodes in tree (actually unique_ptr<>)
evioDOMNodeListP evioDOMTree::getNodeList ( const string &  nName)
throw (evioException
)

Returns list of all nodes in tree with particular name, evioDictEntry from dictionary.

Parameters
nameName of banks to find
Returns
Pointer to list of nodes in tree (actually unique_ptr<>)

References evio::evioDictionary::getTagNumMap.

template<class Predicate >
evioDOMNodeListP evio::evioDOMTree::getNodeList ( Predicate  pred)
throw (evioException
)
int evioDOMTree::getSerializedLength ( void  ) const
throw (evioException
)

Gets serialized length of tree.

Returns
Size of serialized tree in 4-byte words
template<typename T >
vector<T>* evio::evioDOMTree::getVectorUnique ( void  )
throw (evioException
)
template<typename T , class Predicate >
vector<T>* evio::evioDOMTree::getVectorUnique ( Predicate  pred)
throw (evioException
)
evioDOMTree & evioDOMTree::operator<< ( evioDOMNodeP  node)
throw (evioException
)

Makes node root if tree is empty, or adds node to root if a container.

Parameters
nodeNode to add to root
Returns
Pointer to this
void evioDOMTree::setDictionary ( const evioDictionary dict)

Sets dictionary to use by this tree.

Parameters
dictPointer to dictionary
void evioDOMTree::setDictionary ( const evioDictionary dict)

Sets dictionary to use by this tree.

Parameters
dictRef to dictionary
int evioDOMTree::toEVIOBuffer ( uint32_t *  buf,
int  size 
) const
throw (evioException
)
virtual

Serializes tree to buffer.

Parameters
bufBuffer that receives serialized tree
sizeSize of buffer
Returns
Size of serialized buffer in 4-byte words

Implements evio::evioChannelBufferizable.

string evioDOMTree::toString ( void  ) const

Returns XML string listing tree contents.

Returns
XML string listing contents
string evioDOMTree::toString ( const evioToStringConfig config) const

Returns XML string listing tree contents.

Parameters
configPointer to evioToStringConfig contains options that control string creation
Returns
XML string listing contents

References evio::evioToStringConfig::setDictionary(), and evio::evioToStringConfig::toStringDictionary.

string evioDOMTree::toString ( const evioToStringConfig config) const
Parameters
configPointer to config Returns XML string listing tree contents.
Returns
XML string listing contents

Member Data Documentation

const evioDictionary* evio::evioDOMTree::dictionary

Dictionary to use for this tree.

string evio::evioDOMTree::name

Name of tree.

evioDOMNodeP evio::evioDOMTree::root

Pointer to root node of tree.


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