DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
Class managing a tree of nodes. More...
Public Member Functions | |
DSRTree () | |
default constructor | |
virtual | ~DSRTree () |
destructor | |
virtual void | clear () |
clear all member variables | |
OFBool | isEmpty () const |
check whether tree has any nodes | |
size_t | gotoRoot () |
set internal cursor to root node | |
size_t | gotoNode (const size_t searchID, const OFBool startFromRoot=OFTrue) |
set internal cursor to specified node | |
size_t | gotoNode (const OFString &reference, const OFBool startFromRoot=OFTrue) |
set internal cursor to specified node | |
virtual size_t | addNode (DSRTreeNode *node, const E_AddMode addMode=AM_afterCurrent) |
add new node to the current one. | |
virtual size_t | removeNode () |
remove current node from tree. | |
Protected Member Functions | |
DSRTreeNode * | getRoot () const |
get pointer to root node | |
Private Member Functions | |
DSRTree (const DSRTree &) | |
DSRTree & | operator= (const DSRTree &) |
Private Attributes | |
DSRTreeNode * | RootNode |
pointer to the root tree node |
Class managing a tree of nodes.
virtual size_t DSRTree::addNode | ( | DSRTreeNode * | node, |
const E_AddMode | addMode = AM_afterCurrent |
||
) | [virtual] |
add new node to the current one.
Please note that no copy of the given node is created. Therefore, the node should be created with new() - do not use a reference to a local variable. If the node could be added successfully the cursor is set to it automatically.
node | pointer to the new node to be added |
addMode | flag specifying at which position to add the new node. (AM_afterCurrent, AM_beforeCurrent, AM_belowCurrent) |
Reimplemented in DSRDocumentTree.
DSRTreeNode* DSRTree::getRoot | ( | ) | const [inline, protected] |
get pointer to root node
size_t DSRTree::gotoNode | ( | const size_t | searchID, |
const OFBool | startFromRoot = OFTrue |
||
) |
set internal cursor to specified node
searchID | ID of the node to set the cursor to |
startFromRoot | flag indicating whether to start from the root node or the current one |
size_t DSRTree::gotoNode | ( | const OFString & | reference, |
const OFBool | startFromRoot = OFTrue |
||
) |
set internal cursor to specified node
reference | position string of the node to set the cursor to. (the format is e.g. "1.2.3" for the third child of the second child of the first node - see DSRTreeNodeCursor). |
startFromRoot | flag indicating whether to start from the root node or the current one |
size_t DSRTree::gotoRoot | ( | ) |
set internal cursor to root node
OFBool DSRTree::isEmpty | ( | ) | const |
check whether tree has any nodes
virtual size_t DSRTree::removeNode | ( | ) | [virtual] |
remove current node from tree.
Please note that not only the specified node but also all of its child nodes are removed from the tree and then deleted. The cursor is set automatically to a new valid position.
Reimplemented in DSRDocumentTree.