Represents an evio tree/event in memory. More...
#include <evioUtil.hxx>
Public Member Functions | |
evioDOMTree (void) throw (evioException) | |
No-arg constructor creates empty tree name="evio", root node is bank with tag=0, num=0. | |
evioDOMTree (evioDictionary *dictionary) throw (evioException) | |
Constructor creates empty tree name="evio" with dictionary, root node is bank with tag=0, num=0. | |
evioDOMTree (const evioChannel &channel, const string &name="evio") throw (evioException) | |
Constructor fills tree from contents of evioChannel object, gets dictionary from channel. | |
evioDOMTree (const evioChannel *channel, const string &name="evio") throw (evioException) | |
Constructor fills tree from contents of evioChannel object, gets dictionary from channel. | |
evioDOMTree (const uint32_t *buf, const string &name="evio") throw (evioException) | |
Constructor fills tree from contents of buffer. | |
evioDOMTree (evioDOMNodeP node, const string &name="evio") throw (evioException) | |
Constructor creates tree using node as the root node. | |
evioDOMTree (uint16_t tag, uint8_t num, ContainerType cType=BANK, const string &name="evio") throw (evioException) | |
Constructor creates new container node as root node. | |
evioDOMTree (const string &bankName, ContainerType cType=BANK, const string &name="evio") throw (evioException) | |
Constructor creates new container node as root node. | |
evioDOMTree (tagNum tn, ContainerType cType=BANK, const string &name="evio") throw (evioException) | |
Constructor creates new container node as root node. | |
evioDOMTree (const string &bankName, evioDictionary *dictionary, ContainerType cType=BANK, const string &name="evio") throw (evioException) | |
virtual | ~evioDOMTree (void) |
Destructor deletes root node and contents. | |
void | clear (void) throw (evioException) |
Removes and deletes tree root node and all its contents. | |
void | addBank (evioDOMNodeP node) throw (evioException) |
Makes node root if tree is empty, or adds node to root if a container. | |
template<typename T > | |
void | addBank (uint16_t tag, uint8_t num, const vector< T > &dataVec) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
template<typename T > | |
void | addBank (uint16_t tag, uint8_t num, const T *dataBuf, int dataLen) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
template<typename T > | |
void | addBank (tagNum tn, const vector< T > &dataVec) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
template<typename T > | |
void | addBank (tagNum tn, const T *dataBuf, int dataLen) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
template<typename T > | |
void | addBank (const string &name, const vector< T > &dataVec) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
template<typename T > | |
void | addBank (const string &name, const T *dataBuf, int dataLen) throw (evioException) |
Creates leaf node and adds it to tree root node. | |
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. | |
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. | |
void | addBank (tagNum 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. | |
void | addBank (tagNum 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. | |
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. | |
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. | |
evioDOMNodeP | createNode (const string &name, ContainerType cType=BANK) const throw (evioException) |
Creates new container node. | |
template<typename T > | |
evioDOMNodeP | createNode (const string &name, const vector< T > &tVec) const throw (evioException) |
Creates leaf node. | |
template<typename T > | |
evioDOMNodeP | createNode (const string &name, const T *t, int len) const throw (evioException) |
Creates leaf node. | |
evioDOMNodeP | createNode (const string &name, const evioSerializable &o, ContainerType cType=BANK) const throw (evioException) |
Creates new container node. | |
evioDOMNodeP | createNode (const string &name, void(*f)(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) const throw (evioException) |
Creates new container node. | |
template<typename T > | |
evioDOMNodeP | createNode (const string &name, T *t, void *userArg, ContainerType cType=BANK) const throw (evioException) |
Creates container node. | |
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) |
Creates container node. | |
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. | |
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. | |
evioDOMTree & | operator<< (evioDOMNodeP node) throw (evioException) |
Makes node root if tree is empty, or adds node to root if a container. | |
int | getSerializedLength (void) const throw (evioException) |
Gets serialized length of tree. | |
int | toEVIOBuffer (uint32_t *buf, int size) const throw (evioException) |
Serializes tree to buffer. | |
evioDOMNodeListP | getNodeList (void) throw (evioException) |
Returns list of all nodes in tree. | |
evioDOMNodeListP | getNodeList (const string &name) throw (evioException) |
Returns list of all nodes in tree with particular name, tagNum from dictionary. | |
template<class Predicate > | |
evioDOMNodeListP | getNodeList (Predicate pred) throw (evioException) |
Returns list of nodes in tree satisfying predicate. | |
template<class Predicate > | |
evioDOMNodeP | getFirstNode (Predicate pred) throw (evioException) |
Returns pointer to first node in tree satisfying predicate. | |
template<typename T > | |
vector< T > * | getVectorUnique (void) throw (evioException) |
Returns vector<T> from single node in tree containing vector<T>. | |
template<typename T , class Predicate > | |
vector< T > * | getVectorUnique (Predicate pred) throw (evioException) |
Returns vector<T> from single node in tree that is of type T AND satisfies predicate. | |
string | toString (void) const |
Returns XML string listing tree contents. | |
string | toString (const evioToStringConfig *config) const |
Returns XML string listing tree contents. | |
string | toString (const evioToStringConfig &config) const |
const evioDictionary * | getDictionary (void) const |
Sets dictionary to use by this tree. | |
void | setDictionary (const evioDictionary *dict) |
Sets dictionary to use by this tree. | |
void | setDictionary (const evioDictionary &dict) |
Sets dictionary to use by this tree. | |
Public Attributes | |
evioDOMNodeP | root |
Pointer to root node of tree. | |
string | name |
Name of tree. | |
const evioDictionary * | dictionary |
Dictionary to use for this tree. |
Represents an evio tree/event in memory.
Tree root is an evioDOMNode.
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, evio::evioDOMNode::createEvioDOMNode(), evio::evioDOMNode::parentTree, and root.
evioDOMTree::evioDOMTree | ( | evioDictionary * | dict | ) | throw (evioException) |
Constructor creates empty tree name="evio" with dictionary, root node is bank with tag=0, num=0.
dict | dictionary |
References evio::BANK, and evio::evioDOMNode::createEvioDOMNode().
evioDOMTree::evioDOMTree | ( | const evioChannel & | channel, | |
const string & | name = "evio" | |||
) | throw (evioException) |
Constructor fills tree from contents of evioChannel object, gets dictionary from channel.
channel | evioChannel object | |
name | Name 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.
channel | Pointer to evioChannel object | |
name | Name of tree |
evioDOMTree::evioDOMTree | ( | const uint32_t * | buf, | |
const string & | name = "evio" | |||
) | throw (evioException) |
Constructor fills tree from contents of buffer.
buf | Buffer containing event | |
name | Name of tree |
evioDOMTree::evioDOMTree | ( | evioDOMNodeP | node, | |
const string & | name = "evio" | |||
) | throw (evioException) |
Constructor creates tree using node as the root node.
node | Pointer to node that becomes the root node | |
name | Name 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.
tag | Root node tag | |
num | Root node num | |
cType | Root node content type | |
name | Name of tree |
References evio::evioDOMNode::createEvioDOMNode().
evioDOMTree::evioDOMTree | ( | const string & | bankName, | |
ContainerType | cType = BANK , |
|||
const string & | name = "evio" | |||
) | throw (evioException) |
Constructor creates new container node as root node.
tag | Root node name | |
cType | Root node content type | |
name | Name of tree |
References evio::evioDOMNode::createEvioDOMNode(), and evio::evioDictionary::getTagNum().
evioDOMTree::evioDOMTree | ( | tagNum | tn, | |
ContainerType | cType = BANK , |
|||
const string & | name = "evio" | |||
) | throw (evioException) |
Constructor creates new container node as root node.
name | Root node tagNum | |
cType | Root node content type | |
name | Name of tree |
References evio::evioDOMNode::createEvioDOMNode().
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.
References evio::evioDOMNode::cutAndDelete(), and root.
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.
name | Leaf node name | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
t | array of uint32_t data len Length of array |
References evio::evioDictionary::getTagNum().
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.
name | Leaf node name | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
dataVec | vector<T> of data |
References evio::evioDictionary::getTagNum().
void evioDOMTree::addBank | ( | tagNum | 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.
tn | Leaf tagNum | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
t | array of uint32_t data len Length of array |
void evioDOMTree::addBank | ( | tagNum | 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.
tn | Leaf tagNum | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
dataVec | vector<T> of data |
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.
tag | Node tag | |
num | Node num | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
t | array of uint32_t data len Length of array |
References evio::evioDOMContainerNode::childList, evio::evioDOMNode::createEvioDOMNode(), 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 vector< uint32_t > & | dataVec | |||
) | throw (evioException) |
Creates leaf node and adds it to tree root node.
tag | Node tag | |
num | Node num | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
dataVec | vector<T> of data |
References evio::evioDOMContainerNode::childList, evio::evioDOMNode::createEvioDOMNode(), and evio::evioDOMNode::parent.
void evio::evioDOMTree::addBank | ( | const string & | name, | |
const T * | dataBuf, | |||
int | dataLen | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
name | Node name | |
dataBuf | Pointer to array containg data of type T | |
dataLen | Length of array |
void evio::evioDOMTree::addBank | ( | const string & | name, | |
const vector< T > & | dataVec | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
name | Leaf node name | |
dataVec | vector<T> of data |
void evio::evioDOMTree::addBank | ( | tagNum | tn, | |
const T * | dataBuf, | |||
int | dataLen | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
tn | Leaf node tagNum | |
dataBuf | Pointer to array containg data of type T | |
dataLen | Length of array |
void evio::evioDOMTree::addBank | ( | tagNum | tn, | |
const vector< T > & | dataVec | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
tn | Leaf node tagNum | |
dataVec | vector<T> of data |
void evio::evioDOMTree::addBank | ( | uint16_t | tag, | |
uint8_t | num, | |||
const T * | dataBuf, | |||
int | dataLen | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
tag | Node tag | |
num | Node num | |
dataBuf | Pointer to array containg data of type T | |
dataLen | Length of array |
void evio::evioDOMTree::addBank | ( | uint16_t | tag, | |
uint8_t | num, | |||
const vector< T > & | dataVec | |||
) | throw (evioException) [inline] |
Creates leaf node and adds it to tree root node.
tag | Node tag | |
num | Node num | |
dataVec | vector<T> of data |
void evioDOMTree::addBank | ( | evioDOMNodeP | node | ) | throw (evioException) |
Makes node root if tree is empty, or adds node to root if a container.
node | Node to add to tree |
References evio::evioDOMContainerNode::childList.
void evioDOMTree::clear | ( | void | ) | throw (evioException) |
Removes and deletes tree root node and all its contents.
References evio::evioDOMNode::cutAndDelete(), and root.
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.
nName | Node name | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
dataVec | Pointer to arry of uint32_t data | |
len | Length of array |
References evio::evioDOMNode::createEvioDOMNode().
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.
nName | Node name | |
formatTag | Format tag | |
formatString | Format string | |
dataTag | Data tag | |
dataNum | Data num | |
dataVec | Vector of uint32_t data |
References evio::evioDOMNode::createEvioDOMNode().
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, | |
T * | t, | |||
void *T::* | mfpevioDOMNodeP c, void *userArg, | |||
void * | userArg, | |||
ContainerType | cType = BANK | |||
) | const throw (evioException) [inline] |
Creates container node.
name | Node name | |
t | Pointer to object having serialize method | |
userArg | User arg passed to serialize method cType Container node type |
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, | |
T * | t, | |||
void * | userArg, | |||
ContainerType | cType = BANK | |||
) | const throw (evioException) [inline] |
Creates container node.
name | Node name | |
t | Pointer to object having serialize method | |
userArg | User arg passed to serialize method cType Container node type |
evioDOMNodeP evioDOMTree::createNode | ( | const string & | nName, | |
void(*)(evioDOMNodeP c, void *userArg) | f, | |||
void * | userArg, | |||
ContainerType | cType = BANK | |||
) | const throw (evioException) |
Creates new container node.
nName | Node name | |
ContainerType | Type of container node |
References evio::evioDOMNode::createEvioDOMNode().
evioDOMNodeP evioDOMTree::createNode | ( | const string & | nName, | |
const evioSerializable & | o, | |||
ContainerType | cType = BANK | |||
) | const throw (evioException) |
Creates new container node.
nName | Node name | |
ContainerType | Type of container node |
References evio::evioDOMNode::createEvioDOMNode().
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, | |
const T * | t, | |||
int | len | |||
) | const throw (evioException) [inline] |
Creates leaf node.
name | Node name | |
t | Pointer to array of values | |
len | Length of array |
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, | |
const vector< T > & | tVec | |||
) | const throw (evioException) [inline] |
Creates leaf node.
name | Node name | |
tVec | Vector of values |
evioDOMNodeP evioDOMTree::createNode | ( | const string & | nName, | |
ContainerType | cType = BANK | |||
) | const throw (evioException) |
Creates new container node.
nName | Node name | |
ContainerType | Type of container node |
References evio::evioDOMNode::createEvioDOMNode().
const evioDictionary * evioDOMTree::getDictionary | ( | void | ) | const |
Sets dictionary to use by this tree.
evioDOMNodeP evio::evioDOMTree::getFirstNode | ( | Predicate | pred | ) | throw (evioException) [inline] |
Returns pointer to first node in tree satisfying predicate.
Consider that the order of the search is undefined, so if there is more than one bank satisfying predicate this method may not return the same thing each time. Currently it does a depth-first search, but this could change. I.e. to be safe only use this method when you are sure there is only one bank that satisfies predicate.
pred | Function object true if node meets predicate criteria |
evioDOMNodeListP evio::evioDOMTree::getNodeList | ( | Predicate | pred | ) | throw (evioException) [inline] |
Returns list of nodes in tree satisfying predicate.
pred | Function object true if node meets predicate criteria |
evioDOMNodeListP evioDOMTree::getNodeList | ( | const string & | nName | ) | throw (evioException) |
Returns list of all nodes in tree with particular name, tagNum from dictionary.
name | Name of banks to find |
References evio::evioDictionary::getTagNumMap.
evioDOMNodeListP evioDOMTree::getNodeList | ( | void | ) | throw (evioException) |
Returns list of all nodes in tree.
References root.
int evioDOMTree::getSerializedLength | ( | void | ) | const throw (evioException) |
vector< T > * evio::evioDOMTree::getVectorUnique | ( | Predicate | pred | ) | throw (evioException) [inline] |
Returns vector<T> from single node in tree that is of type T AND satisfies predicate.
Throws exception if more than one node satisfies predicate.
pred | Function object true if node satisfies predicate |
vector< T > * evio::evioDOMTree::getVectorUnique | ( | void | ) | throw (evioException) [inline] |
Returns vector<T> from single node in tree containing vector<T>.
Throws exception if more than one node contains vector<T>.
evioDOMTree & evioDOMTree::operator<< | ( | evioDOMNodeP | node | ) | throw (evioException) |
Makes node root if tree is empty, or adds node to root if a container.
node | Node to add to root |
void evioDOMTree::setDictionary | ( | const evioDictionary & | dict | ) |
Sets dictionary to use by this tree.
dict | Ref to dictionary |
void evioDOMTree::setDictionary | ( | const evioDictionary * | dict | ) |
Sets dictionary to use by this tree.
dict | Pointer to dictionary |
int evioDOMTree::toEVIOBuffer | ( | uint32_t * | buf, | |
int | size | |||
) | const throw (evioException) [virtual] |
Serializes tree to buffer.
buf | Buffer that receives serialized tree | |
size | Size of buffer |
Implements evio::evioChannelBufferizable.
string evioDOMTree::toString | ( | const evioToStringConfig & | config | ) | const |
config | Pointer to config Returns XML string listing tree contents. |
References toString().
string evioDOMTree::toString | ( | const evioToStringConfig * | config | ) | const |
Returns XML string listing tree contents.
config | Pointer to evioToStringConfig contains options that control string creation |
References root, evio::evioToStringConfig::setDictionary(), and evio::evioToStringConfig::toStringDictionary.
string evioDOMTree::toString | ( | void | ) | const |
Returns XML string listing tree contents.
References root.
Referenced by toString().
Dictionary to use for this tree.
string evio::evioDOMTree::name |
Name of tree.
Pointer to root node of tree.
Referenced by clear(), evio::evioDOMNode::cut(), evioDOMTree(), getNodeList(), getSerializedLength(), toString(), and ~evioDOMTree().