evio
5.2
|
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. 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... | |
evioDOMTree & | operator<< (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 evioDictionary * | getDictionary (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 evioDictionary * | dictionary |
Dictionary to use for this tree. More... | |
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.
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.
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 |
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::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.
name | Root node evioDictEntry |
cType | Root node content type |
name | Name of tree |
evio::evioDOMTree::evioDOMTree | ( | const string & | bankName, |
evioDictionary * | dictionary, | ||
ContainerType | cType = BANK , |
||
const string & | name = "evio" |
||
) | |||
throw | ( | evioException | |
) |
|
virtual |
Destructor deletes root node and contents.
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 evio::evioDOMTree::addBank | ( | uint16_t | tag, |
uint8_t | num, | ||
const vector< T > & | dataVec | ||
) | |||
throw | ( | evioException | |
) |
void evio::evioDOMTree::addBank | ( | uint16_t | tag, |
uint8_t | num, | ||
const T * | dataBuf, | ||
int | dataLen | ||
) | |||
throw | ( | evioException | |
) |
void evio::evioDOMTree::addBank | ( | evioDictEntry | tn, |
const vector< T > & | dataVec | ||
) | |||
throw | ( | evioException | |
) |
void evio::evioDOMTree::addBank | ( | evioDictEntry | tn, |
const T * | dataBuf, | ||
int | dataLen | ||
) | |||
throw | ( | evioException | |
) |
void evio::evioDOMTree::addBank | ( | const string & | name, |
const vector< T > & | dataVec | ||
) | |||
throw | ( | evioException | |
) |
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.
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, 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.
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, 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.
tn | Leaf evioDictEntry |
formatTag | Format tag |
formatString | Format string |
dataTag | Data tag |
dataNum | Data num |
dataVec | vector<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.
tn | Leaf evioDictEntry |
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 | ( | 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::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.
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::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.
nName | Node name |
ContainerType | Type of container node |
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, |
const vector< T > & | tVec | ||
) | const | ||
throw | ( | evioException | |
) |
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.
nName | Node name |
ContainerType | Type of container 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.
nName | Node name |
ContainerType | Type of container node |
evioDOMNodeP evio::evioDOMTree::createNode | ( | const string & | name, |
T * | t, | ||
void * | userArg, | ||
ContainerType | cType = BANK |
||
) | const | ||
throw | ( | evioException | |
) |
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.
nName | Node name |
formatTag | Format tag |
formatString | Format string |
dataTag | Data tag |
dataNum | Data num |
dataVec | Vector of uint32_t data |
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 |
const evioDictionary * evioDOMTree::getDictionary | ( | void | ) | const |
Sets dictionary to use by this tree.
evioDOMNodeP evio::evioDOMTree::getFirstNode | ( | Predicate | pred | ) | |
throw | ( | evioException | |||
) |
evioDOMNodeListP evioDOMTree::getNodeList | ( | void | ) | ||
throw | ( | evioException | |||
) |
Returns list of all nodes in tree.
evioDOMNodeListP evioDOMTree::getNodeList | ( | const string & | nName | ) | |
throw | ( | evioException | |||
) |
Returns list of all nodes in tree with particular name, evioDictEntry from dictionary.
name | Name of banks to find |
References evio::evioDictionary::getTagNumMap.
evioDOMNodeListP evio::evioDOMTree::getNodeList | ( | Predicate | pred | ) | |
throw | ( | evioException | |||
) |
int evioDOMTree::getSerializedLength | ( | void | ) | const | |
throw | ( | evioException | |||
) |
Gets serialized length of tree.
vector<T>* evio::evioDOMTree::getVectorUnique | ( | void | ) | ||
throw | ( | evioException | |||
) |
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.
node | Node to add to root |
void evioDOMTree::setDictionary | ( | const evioDictionary * | dict | ) |
Sets dictionary to use by this tree.
dict | Pointer to dictionary |
void evioDOMTree::setDictionary | ( | const evioDictionary & | dict | ) |
Sets dictionary to use by this tree.
dict | Ref to dictionary |
|
virtual |
Serializes tree to buffer.
buf | Buffer that receives serialized tree |
size | Size of buffer |
Implements evio::evioChannelBufferizable.
string evioDOMTree::toString | ( | void | ) | const |
Returns XML string listing tree contents.
string evioDOMTree::toString | ( | const evioToStringConfig * | config | ) | const |
Returns XML string listing tree contents.
config | Pointer to evioToStringConfig contains options that control string creation |
References evio::evioToStringConfig::setDictionary(), and evio::evioToStringConfig::toStringDictionary.
string evioDOMTree::toString | ( | const evioToStringConfig & | config | ) | const |
config | Pointer to config Returns XML string listing tree contents. |
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.