|
DCMTK
Version 3.6.2
OFFIS DICOM Toolkit
|
Class implementing a position counter to be used for iterating a tree of nodes. More...
Public Member Functions | |
| DSRPositionCounter (const size_t flags=0) | |
| (default) constructor More... | |
| DSRPositionCounter (const DSRPositionCounter &counter) | |
| copy constructor More... | |
| virtual | ~DSRPositionCounter () |
| destructor | |
| DSRPositionCounter & | operator= (const DSRPositionCounter &counter) |
| assignment operator More... | |
| operator size_t () const | |
| conversion operator that returns the position on the current level (0 if the position counter is invalid) | |
| DSRPositionCounter & | operator++ () |
| pre-increment operator. More... | |
| DSRPositionCounter & | operator-- () |
| pre-decrement operator. More... | |
| void | clear () |
| clear all member variables. More... | |
| void | initialize (const OFBool valid=OFTrue, const size_t flags=0) |
| initialize the position counter More... | |
| OFBool | isValid () const |
| check whether position counter is valid (i.e. has been initialized) More... | |
| OFBool | goUp () |
| go one level up, i.e. restore the position on the next upper level and forget about the current level More... | |
| OFBool | goDown () |
| go one level down, i.e. store the position on the current level and start with 1 on the new level More... | |
| size_t | getFlags () const |
| get specified flags that can be used to customize the counter More... | |
| size_t | getLevel () const |
| get current level of the position counter. More... | |
| const OFString & | getString (OFString &position, const char separator='.') const |
| get string representing the current state of the position counter. More... | |
Private Attributes | |
| size_t | Position |
| current position within the current level | |
| OFList< size_t > | PositionList |
| list of position counters in upper levels | |
| size_t | Flags |
| flags used to customize the counter | |
Class implementing a position counter to be used for iterating a tree of nodes.
| DSRPositionCounter::DSRPositionCounter | ( | const size_t | flags = 0 | ) |
(default) constructor
| flags | optional flags used to customize the processing of the counter. These flags are only stored but not evaluated by this class. |
| DSRPositionCounter::DSRPositionCounter | ( | const DSRPositionCounter & | counter | ) |
copy constructor
| counter | object to be copied |
| void DSRPositionCounter::clear | ( | ) |
clear all member variables.
The position counter becomes invalid afterwards (same state as after default construction). Also see initialize().
Referenced by DSRTreeNodeCursor< DSRDocumentTreeNode >::clear(), and DSRTree< DSRDocumentTreeNode >::extractNode().
|
inline |
get specified flags that can be used to customize the counter
Referenced by DSRTreeNodeCursor< DSRDocumentTreeNode >::DSRTreeNodeCursor().
|
inline |
get current level of the position counter.
The top most (root) level is 1, the next lower level is 2, etc.
| const OFString& DSRPositionCounter::getString | ( | OFString & | position, |
| const char | separator = '.' |
||
| ) | const |
get string representing the current state of the position counter.
See DSRTreeNodeCursor::getPosition() for details.
| position | variable where the position string should be stored |
| separator | character used to separate the figures (default: '.') |
Referenced by DSRTreeNodeCursor< DSRDocumentTreeNode >::getPosition().
| OFBool DSRPositionCounter::goDown | ( | ) |
go one level down, i.e. store the position on the current level and start with 1 on the new level
Referenced by DSRTree< DSRDocumentTreeNode >::addNode(), DSRTreeNodeCursor< DSRDocumentTreeNode >::goDown(), and DSRTreeNodeCursor< DSRDocumentTreeNode >::iterate().
| OFBool DSRPositionCounter::goUp | ( | ) |
go one level up, i.e. restore the position on the next upper level and forget about the current level
Referenced by DSRTree< DSRDocumentTreeNode >::extractNode(), DSRTreeNodeCursor< DSRDocumentTreeNode >::goUp(), and DSRTreeNodeCursor< DSRDocumentTreeNode >::iterate().
| void DSRPositionCounter::initialize | ( | const OFBool | valid = OFTrue, |
| const size_t | flags = 0 |
||
| ) |
initialize the position counter
| valid | flag specifying whether the counter should be initialized as valid (default) or invalid |
| flags | optional flags used to customize the processing of the counter. These flags are only stored but not evaluated by this class. |
Referenced by DSRTree< DSRDocumentTreeNode >::addNode(), DSRTreeNodeCursor< DSRDocumentTreeNode >::DSRTreeNodeCursor(), and DSRTreeNodeCursor< DSRDocumentTreeNode >::setCursor().
|
inline |
check whether position counter is valid (i.e. has been initialized)
Referenced by DSRTreeNodeCursor< DSRDocumentTreeNode >::DSRTreeNodeCursor().
|
inline |
pre-increment operator.
Increases the position on the current level by 1. Also makes the position counter valid if it was invalid before.
|
inline |
pre-decrement operator.
Decreases the position on the current level by 1. This makes the position counter invalid if the position was 1 before.
| DSRPositionCounter& DSRPositionCounter::operator= | ( | const DSRPositionCounter & | counter | ) |
assignment operator
| counter | object to be copied |