|
DCMTK Version 3.6.9
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 | |
| DSRPositionCounter (const DSRPositionCounter &counter) | |
| copy constructor | |
| virtual | ~DSRPositionCounter () |
| destructor | |
| DSRPositionCounter & | operator= (const DSRPositionCounter &counter) |
| assignment operator | |
| 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. | |
| DSRPositionCounter & | operator-- () |
| pre-decrement operator. | |
| void | clear () |
| clear all member variables. | |
| void | initialize (const OFBool valid=OFTrue, const size_t flags=0) |
| initialize the position counter | |
| OFBool | isValid () const |
| check whether position counter is valid (i.e. has been initialized) | |
| OFBool | goUp () |
| go one level up, i.e. restore the position on the next upper level and forget about the current level | |
| OFBool | goDown () |
| go one level down, i.e. store the position on the current level and start with 1 on the new level | |
| size_t | getFlags () const |
| get specified flags that can be used to customize the counter | |
| size_t | getLevel () const |
| get current level of the position counter. | |
| const OFString & | getString (OFString &position, const char separator='.') const |
| get string representing the current state of the position counter. | |
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. |
Referenced by DSRPositionCounter(), operator++(), operator--(), and operator=().
| DSRPositionCounter::DSRPositionCounter | ( | const DSRPositionCounter & | counter | ) |
| void DSRPositionCounter::clear | ( | ) |
clear all member variables.
The position counter becomes invalid afterwards (same state as after default construction). Also see initialize().
|
inline |
get specified flags that can be used to customize the counter
References Flags.
Referenced by DSRTreeNodeCursor< T >::DSRTreeNodeCursor().
|
inline |
get current level of the position counter.
The top most (root) level is 1, the next lower level is 2, etc.
References isValid(), and PositionList.
| 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: '.') |
| OFBool DSRPositionCounter::goDown | ( | ) |
go one level down, i.e. store the position on the current level and start with 1 on the new level
| OFBool DSRPositionCounter::goUp | ( | ) |
go one level up, i.e. restore the position on the next upper level and forget about the current level
| 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. |
|
inline |
check whether position counter is valid (i.e. has been initialized)
References Position.
Referenced by DSRTreeNodeCursor< T >::DSRTreeNodeCursor(), and getLevel().
|
inline |
pre-increment operator.
Increases the position on the current level by 1. Also makes the position counter valid if it was invalid before.
References DSRPositionCounter(), and Position.
|
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.
References DSRPositionCounter(), and Position.
| DSRPositionCounter & DSRPositionCounter::operator= | ( | const DSRPositionCounter & | counter | ) |
assignment operator
| counter | object to be copied |
References DSRPositionCounter().