DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | List of all members
DSRDocumentTreeNodeCursor Class Reference

Class implementing a document tree node cursor. More...

Inheritance diagram for DSRDocumentTreeNodeCursor:

## Public Member Functions
| DSRDocumentTreeNodeCursor ()
| default constructor
| DSRDocumentTreeNodeCursor (const DSRDocumentTreeNodeCursor &cursor)
| copy constructor More...
| DSRDocumentTreeNodeCursor (const DSRTreeNodeCursor< DSRDocumentTreeNode > &cursor)
| copy constructor (for base class) More...
| DSRDocumentTreeNodeCursor (DSRDocumentTreeNode *node, const DSRPositionCounter *position=NULL)
| constructor. More...
virtual | ~DSRDocumentTreeNodeCursor ()
| destructor
DSRDocumentTreeNodeCursor & | operator= (const DSRDocumentTreeNodeCursor &cursor)
| assignment operator More...
DSRDocumentTreeNodeCursor & | operator= (DSRDocumentTreeNode *node)
| assignment operator. More...
virtual size_t | gotoMatchingNode (const DSRDocumentTreeNodeFilter &filter, const OFBool searchIntoSub=OFTrue)
| set internal cursor to a matching node (starting from current position). More...
virtual size_t | gotoNextMatchingNode (const DSRDocumentTreeNodeFilter &filter, const OFBool searchIntoSub=OFTrue)
| set internal cursor to the next matching node. More...
Public Member Functions inherited from DSRTreeNodeCursor< DSRDocumentTreeNode >
| DSRTreeNodeCursor ()
| default constructor
| DSRTreeNodeCursor (const DSRTreeNodeCursor< DSRDocumentTreeNode > &cursor)
| copy constructor More...
| DSRTreeNodeCursor (DSRDocumentTreeNode *node, const DSRPositionCounter *position=NULL)
| constructor. More...
virtual | ~DSRTreeNodeCursor ()
| destructor
DSRTreeNodeCursor< DSRDocumentTreeNode > & | operator= (const DSRTreeNodeCursor< DSRDocumentTreeNode > &cursor)
| assignment operator More...
DSRTreeNodeCursor< DSRDocumentTreeNode > & | operator= (DSRDocumentTreeNode *node)
| assignment operator. More...
virtual void | clear ()
| clear all member variables. More...
virtual OFBool | isValid () const
| check whether cursor currently points to a valid node More...
virtual size_t | countChildNodes (const OFBool searchIntoSub=OFTrue) const
| count number of children of the current node. More...
OFBool | hasParentNode () const
| check whether the current node has a parent More...
OFBool | hasChildNodes () const
| check whether the current node has any children More...
OFBool | hasPreviousNode () const
| check whether the current node has a preceding sibling More...
OFBool | hasNextNode () const
| check whether the current node has a following sibling More...
OFBool | hasSiblingNodes () const
| check whether the current node has any siblings More...
virtual DSRDocumentTreeNode * | getNode () const
| get pointer to current node More...
virtual const DSRDocumentTreeNode * | getParentNode () const
| get pointer to parent node. More...
virtual const DSRDocumentTreeNode * | getChildNode () const
| get pointer to first child node. More...
virtual const DSRDocumentTreeNode * | getPreviousNode () const
| get pointer to previous node. More...
virtual const DSRDocumentTreeNode * | getNextNode () const
| get pointer to next node. More...
virtual size_t | gotoFirst ()
| goto first node on the same level (first sibling). More...
virtual size_t | gotoLast ()
| goto last node on the same level (last sibling). More...
virtual size_t | gotoPrevious ()
| goto previous node on the same level (preceding sibling) More...
virtual size_t | gotoNext ()
| goto next node on the same level (following sibling) More...
virtual size_t | goUp ()
| goto parent node (one level up) More...
virtual size_t | goDown ()
| goto first child node (one level down) More...
virtual size_t | gotoParent ()
| goto parent node (one level up) More...
virtual size_t | gotoChild ()
| goto first child node (one level down) More...
virtual size_t | iterate (const OFBool searchIntoSub=OFTrue)
| iterate over all nodes (starting from current position!) More...
size_t | gotoNode (const size_t searchID)
| set cursor to specified node. More...
size_t | gotoNode (const OFString &position, const char separator='.')
| set cursor to specified node. More...
size_t | gotoNode (const DSRTreeNodeAnnotation &annotation)
| set cursor to specified node. More...
size_t | gotoNode (const DSRDocumentTreeNode &nodeValue)
| set cursor to specified node. More...
size_t | getNodeID () const
| get current node ID. More...
size_t | getLevel () const
| get current level. More...
DSRPositionCounter & | getPositionCounter ()
| get reference to internal position counter. More...
const OFString & | getPosition (OFString &position, const char separator='.') const
| get position string of the current node. More...

## Additional Inherited Members
Protected Member Functions inherited from DSRTreeNodeCursor< DSRDocumentTreeNode >
void | swap (DSRTreeNodeCursor< DSRDocumentTreeNode > &cursor)
| fast, non-throwing swap function. More...
void | clearNodeCursorStack ()
| clear the internal node cursor stack
const DSRTreeNodeCursor< DSRDocumentTreeNode > & | getCursor () const
| get cursor More...
void | setCursor (const DSRTreeNodeCursor< DSRDocumentTreeNode > &cursor)
| set cursor to specified object More...
size_t | setCursor (DSRDocumentTreeNode *node)
| set cursor to specified node. More...
DSRDocumentTreeNode * | getChild () const
| get pointer to first child node More...
Protected Attributes inherited from DSRTreeNodeCursor< DSRDocumentTreeNode >
DSRDocumentTreeNode * | NodeCursor
| pointer to current node
OFStack< DSRDocumentTreeNode * > | NodeCursorStack
| stack of node pointers. Used to store the cursor position of upper levels.
DSRPositionCounter | Position
| counter for the current position within the current level and on upper levels

## Detailed Description

Class implementing a document tree node cursor.

Included sub-templates are not supported by this type of cursor, i.e. the subtree that is managed by an instance of DSRIncludedTemplateTreeNode is not iterated.

## Constructor & Destructor Documentation

## ◆ DSRDocumentTreeNodeCursor() [1/3]

DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor | ( | const DSRDocumentTreeNodeCursor & | cursor | ) |

copy constructor

Parameters

  cursor | object to be copied

## ◆ DSRDocumentTreeNodeCursor() [2/3]

DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor | ( | const DSRTreeNodeCursor< DSRDocumentTreeNode > & | cursor | ) |

copy constructor (for base class)

Parameters

  cursor | object to be copied

## ◆ DSRDocumentTreeNodeCursor() [3/3]

DSRDocumentTreeNodeCursor::DSRDocumentTreeNodeCursor | ( | DSRDocumentTreeNode * | node,
|  | const DSRPositionCounter * | position = `NULL`
| ) |  |

constructor.

See comments on DSRTreeNodeCursor<>::setCursor() method.

Parameters

  node | pointer to tree node used to initialize the cursor
  position | optional pointer to position counter that should be used to initialize the internal counter

## Member Function Documentation

## ◆ gotoMatchingNode()

virtual size_t DSRDocumentTreeNodeCursor::gotoMatchingNode | ( | const DSRDocumentTreeNodeFilter & | filter,
|  | const OFBool | searchIntoSub = `OFTrue`
| ) |  |
| virtual

set internal cursor to a matching node (starting from current position).

If more than one node exists matching the given filter, the first one will be selected. Use gotoNextMatchingNode() in order to go to the next matching node.

Parameters

  filter | matching criterion based on a single or multiple filters
  searchIntoSub | flag indicating whether to search into sub-trees ("deep search") or on the current level only

Returns
  ID of the new current node if successful, 0 otherwise

## ◆ gotoNextMatchingNode()

virtual size_t DSRDocumentTreeNodeCursor::gotoNextMatchingNode | ( | const DSRDocumentTreeNodeFilter & | filter,
|  | const OFBool | searchIntoSub = `OFTrue`
| ) |  |
| virtual

set internal cursor to the next matching node.

Starts from "next" node, i.e. either the first child of the current node or the first sibling following the current node.

Parameters

  filter | matching criterion based on a single or multiple filters
  searchIntoSub | flag indicating whether to search into sub-trees ("deep search") or on the current level only

Returns
  ID of the new current node if successful, 0 otherwise

## ◆ operator=() [1/2]

DSRDocumentTreeNodeCursor& DSRDocumentTreeNodeCursor::operator= | ( | const DSRDocumentTreeNodeCursor & | cursor | ) |

assignment operator

Parameters

  cursor | object to be copied

Returns
  reference to modified cursor (this object)

## ◆ operator=() [2/2]

DSRDocumentTreeNodeCursor& DSRDocumentTreeNodeCursor::operator= | ( | DSRDocumentTreeNode * | node | ) |

assignment operator.

See comments on DSRTreeNodeCursor<>::setCursor() method.

Parameters

  node | node to which the cursor should be set

Returns
  reference to modified cursor (this object)

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

- dcmsr/include/dcmtk/dcmsr/dsrdncsr.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1