evio
5.3
|
Virtual class represents an evio node in memory, concrete sub-classes evioDOMContainerNode and evioDOMLeafNode are hidden from users. More...
#include <evioUtil.hxx>
Public Member Functions | |
virtual | ~evioDOMNode ()=default |
virtual void | addNode (evioDOMNodeP node) |
Adds node to container node. More... | |
void | append (const string &s) |
Appends string to leaf node. More... | |
void | append (const char *s) |
Appends const char* to leaf node. More... | |
void | append (char *s) |
Appends char* to leaf node. More... | |
void | append (const char **ca, int len) |
Appends array of const char* to leaf node. More... | |
void | append (char **ca, int len) |
Appends array of const char* to leaf node. More... | |
template<typename T > | |
void | append (T tVal) |
template<typename T > | |
void | append (const vector< T > &tVec) |
template<typename T > | |
void | append (const T *tBuf, int len) |
template<typename T > | |
void | replace (const vector< T > &tVec) |
template<typename T > | |
void | replace (const T *tBuf, int len) |
virtual evioDOMNodeP | cut () |
Cleanly removes node from tree or node hierarchy. More... | |
virtual void | cutAndDelete () |
Cleanly removes node from tree or node hierarchy and recursively deletes node and its contents. More... | |
virtual evioDOMNodeP | move (evioDOMNodeP newParent) |
Changes node parent. More... | |
virtual bool | operator== (uint16_t tag) const |
True if node tag equals value. More... | |
virtual bool | operator!= (uint16_t tag) const |
True if node tag does not equal value. More... | |
bool | operator== (evioDictEntry tnPair) const |
True if node tag and num same as in evioDictEntry pair. More... | |
bool | operator!= (evioDictEntry tnPair) const |
True if node tag and num NOT the same as in evioDictEntry pair. More... | |
evioDOMNode & | operator<< (evioDOMNodeP node) |
Adds node to container node. More... | |
evioDOMNode & | operator<< (const string &s) |
Appends single string to leaf node. More... | |
evioDOMNode & | operator<< (const char *s) |
Appends single const char* to leaf node. More... | |
evioDOMNode & | operator<< (char *s) |
Appends single char* to leaf node. More... | |
template<typename T > | |
evioDOMNode & | operator<< (T tVal) |
template<typename T > | |
evioDOMNode & | operator<< (const vector< T > &tVec) |
evioDOMNodeList * | getChildList () |
Returns pointer to child list of container node. More... | |
evioDOMNodeListP | getChildren () |
Returns copy of child list of container node. More... | |
template<class Predicate > | |
evioDOMNodeListP | getChildren (Predicate pred) |
template<typename T > | |
vector< T > * | getVector () |
virtual string | toString () const |
Returns XML string listing container node contents. More... | |
virtual string | getHeader (int depth, const evioToStringConfig *config=&defaultToStringConfig) const =0 |
virtual string | getBody (int depth, const evioToStringConfig *config=&defaultToStringConfig) const =0 |
virtual string | getFooter (int depth, const evioToStringConfig *config=&defaultToStringConfig) const =0 |
virtual int | getSize () const =0 |
evioDOMNodeP | getParent () const |
Returns parent evioDOMNode. More... | |
int | getContentType () const |
Returns content type. More... | |
evioDOMTree * | getParentTree () const |
Returns parent evioDOMTree. More... | |
bool | isContainer () const |
True if node is a container node. More... | |
bool | isLeaf () const |
True if node is a leaf node. More... | |
Static Public Member Functions | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, ContainerType cType=BANK) |
Static factory method to create container node. More... | |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, const vector< T > &tVec) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, const T *t, int len) |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, const evioSerializable &o, ContainerType cType=BANK) |
Static factory method to create container node holding evioSerializable object. More... | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, void(*f)(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) |
Static factory method to create container node using C function to fill container. More... | |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, T *t, void *userArg, ContainerType cType=BANK) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, T *t, void *T::*mfp(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &tVec) |
Static factory method to create composite leaf node. More... | |
static evioDOMNodeP | createEvioDOMNode (uint16_t tag, uint8_t num, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) |
Static factory method to create composite leaf node. More... | |
static evioDOMNodeP | createUnknownEvioDOMNode (uint16_t tag, uint8_t num, const vector< uint32_t > &tVec) |
Unknown type node constructor used internally. More... | |
static evioDOMNodeP | createUnknownEvioDOMNode (uint16_t tag, uint8_t num, const uint32_t *t, int len) |
Unknown type node constructor used internally. More... | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, ContainerType cType=BANK) |
Static factory method to create container node. More... | |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, const vector< T > &tVec) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, const T *t, int len) |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, const evioSerializable &o, ContainerType cType=BANK) |
Static factory method to create container node holding evioSerializable object. More... | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, void(*f)(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) |
Static factory method to create container node using C function to fill container. More... | |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, T *t, void *userArg, ContainerType cType=BANK) |
template<typename T > | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, T *t, void *T::*mfp(evioDOMNodeP c, void *userArg), void *userArg, ContainerType cType=BANK) |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const vector< uint32_t > &tVec) |
Static factory method to create composite leaf node. More... | |
static evioDOMNodeP | createEvioDOMNode (const string &name, const evioDictionary *dictionary, uint16_t formatTag, const string &formatString, uint16_t dataTag, uint8_t dataNum, const uint32_t *t, int len) |
Static factory method to create composite leaf node. More... | |
static evioDOMNodeP | createUnknownEvioDOMNode (const string &name, const evioDictionary *dictionary, const vector< uint32_t > &tVec) |
Unknown type node constructor used internally. More... | |
static evioDOMNodeP | createUnknownEvioDOMNode (const string &name, const evioDictionary *dictionary, const uint32_t *t, int len) |
Unknown type node constructor used internally. More... | |
Public Attributes | |
uint16_t | tag |
The node tag, max 16-bits depending on container type. More... | |
uint8_t | num |
The node num, max 8 bits, used by BANK and String container types (2-word header). More... | |
Protected Member Functions | |
evioDOMNode (evioDOMNodeP parent, uint16_t tag, uint8_t num, int contentType) | |
Container node constructor used internally. More... | |
evioDOMNode (evioDOMNodeP parent, const string &name, const evioDictionary *dictionary, int contentType) | |
Container node constructor used internally. More... | |
Static Protected Member Functions | |
static string | getIndent (int depth, int size=3) |
Returns indent for pretty-printing, used internally. More... | |
Protected Attributes | |
evioDOMNodeP | parent |
Pointer to node parent. More... | |
evioDOMTree * | parentTree |
Pointer to parent tree if this node is the root. More... | |
int | contentType |
Content type. More... | |
Friends | |
class | evioDOMTree |
Allows evioDOMTree class to manipulate nodes. More... | |
Virtual class represents an evio node in memory, concrete sub-classes evioDOMContainerNode and evioDOMLeafNode are hidden from users.
Users work with nodes via this class, and create nodes via factory method createEvioDOMNode. Factory model ensures nodes are created on heap.
|
protected |
Container node constructor used internally.
par | Parent node |
tag | Node tag |
num | Node num |
contentType | Container node content type |
|
protected |
Container node constructor used internally.
par | Parent node |
name | Bank name @parem dictionary Dictionary to use |
contentType | Container node content type |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), evio::evioDictEntry::getTag(), num, and tag.
|
virtualdefault |
|
virtual |
Adds node to container node.
node | Node to be added |
References isContainer(), and move().
Referenced by operator<<().
void evioDOMNode::append | ( | char ** | ca, |
int | len | ||
) |
Appends array of const char* to leaf node.
sa | array of char* to append |
References append().
void evioDOMNode::append | ( | char * | s | ) |
void evioDOMNode::append | ( | const char ** | ca, |
int | len | ||
) |
Appends array of const char* to leaf node.
sa | array of char* to append |
References contentType, and evio::evioDOMLeafNode< T >::data.
void evioDOMNode::append | ( | const char * | s | ) |
Appends const char* to leaf node.
s | char* to append |
References contentType, and evio::evioDOMLeafNode< T >::data.
void evioDOMNode::append | ( | const string & | s | ) |
Appends string to leaf node.
s | string to append |
References contentType, and evio::evioDOMLeafNode< T >::data.
Referenced by append(), and operator<<().
void evio::evioDOMNode::append | ( | const T * | tBuf, |
int | len | ||
) |
void evio::evioDOMNode::append | ( | const vector< T > & | tVec | ) |
void evio::evioDOMNode::append | ( | T | tVal | ) |
|
static |
|
static |
Static factory method to create container node holding evioSerializable object.
name | Node name |
dictionary | Dictionary to use |
o | evioSerializable object |
cType | Container node content type |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), evio::evioDictEntry::getTag(), and evio::evioSerializable::serialize().
|
static |
|
static |
|
static |
Static factory method to create container node.
name | Node name |
dictionary | Dictionary to use |
cType | Container node content type |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
|
static |
|
static |
Static factory method to create composite leaf node.
name | Node name |
dictionary | Dictionary to use |
formatTag | Format tag |
formatString | Format string |
dataTag | Data tag |
dataNum | Data num |
t | Pointer to array of uint32_t data |
len | Length of array |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
Static factory method to create composite leaf node.
name | Node name |
dictionary | Dictionary to use |
formatTag | Format tag |
formatString | Format string |
dataTag | Data tag |
dataNum | Data num |
tVec | vector<uint32_t> of data |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
Static factory method to create container node using C function to fill container.
name | Node name |
dictionary | Dictionary to use |
f | C function that fills container node |
userArg | User arg passed to C function |
cType | Container node content type |
References evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
|
static |
Static factory method to create container node holding evioSerializable object.
tag | Node tag |
num | Node num |
o | evioSerializable object |
cType | Container node content type |
References num, evio::evioSerializable::serialize(), and tag.
|
static |
|
static |
|
static |
Static factory method to create container node.
tag | Node tag |
num | Node num |
cType | Container node content type |
Referenced by evio::evioDOMTree::addBank(), evio::evioDOMTree::createNode(), createUnknownEvioDOMNode(), and evio::evioDOMTree::evioDOMTree().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Unknown type node constructor used internally.
name | Name |
dictionary | Dictionary |
t | Pointer to array of uint32_t |
len | Length of array |
References contentType, createEvioDOMNode(), evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
Unknown type node constructor used internally.
name | Name |
dictionary | Dictionary |
tVec | Vector of uint32_t |
References contentType, createEvioDOMNode(), evio::evioDictionary::getEntry(), evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
static |
Unknown type node constructor used internally.
tag | Tag |
num | Num |
t | Pointer to uint32_t array |
len | Length of array |
References contentType, createEvioDOMNode(), num, and tag.
|
static |
Unknown type node constructor used internally.
tag | Tag |
num | Num |
tVec | Vector of uint32_t |
References contentType, createEvioDOMNode(), num, and tag.
|
virtual |
Cleanly removes node from tree or node hierarchy.
References evio::evioDOMContainerNode::childList, parent, parentTree, and evio::evioDOMTree::root.
Referenced by evio::evioDOMTree::addBank(), cutAndDelete(), and move().
|
virtual |
Cleanly removes node from tree or node hierarchy and recursively deletes node and its contents.
References cut().
Referenced by evio::evioDOMTree::clear(), and evio::evioDOMTree::~evioDOMTree().
|
pure virtual |
evioDOMNodeList * evioDOMNode::getChildList | ( | ) |
Returns pointer to child list of container node.
References isContainer().
Referenced by getChildren().
evioDOMNodeListP evioDOMNode::getChildren | ( | ) |
Returns copy of child list of container node.
List must be deleted by user
References getChildList().
evioDOMNodeListP evio::evioDOMNode::getChildren | ( | Predicate | pred | ) |
int evioDOMNode::getContentType | ( | ) | const |
Returns content type.
References contentType.
Referenced by evio::evioDOMContainerNode::getFooter(), and evio::evioDOMContainerNode::getHeader().
|
pure virtual |
Implemented in evio::evioDOMLeafNode< T >, evio::evioDOMLeafNode< uint32_t >, and evio::evioDOMContainerNode.
Referenced by toString().
|
pure virtual |
Implemented in evio::evioDOMLeafNode< T >, evio::evioDOMLeafNode< uint32_t >, and evio::evioDOMContainerNode.
Referenced by toString().
|
staticprotected |
Returns indent for pretty-printing, used internally.
depth | Depth level |
size | Size of indent per level |
Referenced by evio::evioCompositeDOMLeafNode::getBody(), evio::evioDOMContainerNode::getFooter(), and evio::evioDOMContainerNode::getHeader().
evioDOMNodeP evioDOMNode::getParent | ( | ) | const |
evioDOMTree * evioDOMNode::getParentTree | ( | ) | const |
|
pure virtual |
Implemented in evio::evioCompositeDOMLeafNode, evio::evioDOMLeafNode< T >, evio::evioDOMLeafNode< uint32_t >, and evio::evioDOMContainerNode.
Referenced by toString().
vector<T>* evio::evioDOMNode::getVector | ( | ) |
bool evioDOMNode::isContainer | ( | ) | const |
True if node is a container node.
References contentType.
Referenced by evio::evioDOMTree::addBank(), addNode(), getChildList(), and move().
bool evioDOMNode::isLeaf | ( | ) | const |
True if node is a leaf node.
References contentType.
Referenced by toString().
|
virtual |
Changes node parent.
newParent | New parent |
References evio::evioDOMContainerNode::childList, cut(), isContainer(), and parent.
Referenced by addNode().
bool evioDOMNode::operator!= | ( | evioDictEntry | tnPair | ) | const |
True if node tag and num NOT the same as in evioDictEntry pair.
tnPair | evioDictEntry pair to compare to |
References evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
virtual |
True if node tag does not equal value.
tg | Value to compare to |
evioDOMNode & evioDOMNode::operator<< | ( | char * | s | ) |
Appends single char* to leaf node.
s | char* to be added |
References append().
evioDOMNode & evioDOMNode::operator<< | ( | const char * | s | ) |
Appends single const char* to leaf node.
s | char* to be added |
References append().
evioDOMNode & evioDOMNode::operator<< | ( | const string & | s | ) |
Appends single string to leaf node.
sRef | String to be added |
References append().
evioDOMNode& evio::evioDOMNode::operator<< | ( | const vector< T > & | tVec | ) |
evioDOMNode & evioDOMNode::operator<< | ( | evioDOMNodeP | node | ) |
Adds node to container node.
node | Node to be added |
References addNode().
evioDOMNode& evio::evioDOMNode::operator<< | ( | T | tVal | ) |
bool evioDOMNode::operator== | ( | evioDictEntry | tnPair | ) | const |
True if node tag and num same as in evioDictEntry pair.
tnPair | evioDictEntry pair to compare to |
References evio::evioDictEntry::getNum(), and evio::evioDictEntry::getTag().
|
virtual |
True if node tag equals value.
tg | Value to compare to |
void evio::evioDOMNode::replace | ( | const T * | tBuf, |
int | len | ||
) |
void evio::evioDOMNode::replace | ( | const vector< T > & | tVec | ) |
|
virtual |
Returns XML string listing container node contents.
References getFooter(), getHeader(), getSize(), and isLeaf().
|
friend |
Allows evioDOMTree class to manipulate nodes.
|
protected |
Content type.
Referenced by append(), createUnknownEvioDOMNode(), evio::evioCompositeDOMLeafNode::evioCompositeDOMLeafNode(), getContentType(), evio::evioDOMContainerNode::getHeader(), isContainer(), and isLeaf().
uint8_t evio::evioDOMNode::num |
The node num, max 8 bits, used by BANK and String container types (2-word header).
Referenced by createEvioDOMNode(), createUnknownEvioDOMNode(), evioDOMNode(), evio::evioDOMContainerNode::getFooter(), evio::evioDOMContainerNode::getHeader(), and evio::evioToStringConfig::skipNode().
|
protected |
Pointer to node parent.
Referenced by evio::evioDOMTree::addBank(), cut(), evio::evioDOMContainerNode::getFooter(), evio::evioDOMContainerNode::getHeader(), getParent(), and move().
|
protected |
Pointer to parent tree if this node is the root.
Referenced by evio::evioDOMTree::addBank(), cut(), evio::evioDOMTree::evioDOMTree(), and getParentTree().
uint16_t evio::evioDOMNode::tag |
The node tag, max 16-bits depending on container type.
Referenced by createEvioDOMNode(), createUnknownEvioDOMNode(), evioDOMNode(), evio::evioDOMContainerNode::getFooter(), evio::evioDOMContainerNode::getHeader(), and evio::evioToStringConfig::skipNode().