DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Protected Attributes | List of all members
OFSetIterator< T > Class Template Reference

This template class represents an iterator class for corresponding set data structures in ofstd. More...

## Public Member Functions
| OFSetIterator (OFSet< T > &ofsetv)
| Constructor. More...
virtual | ~OFSetIterator ()
| Destructor.
void | ResetBeginning ()
| Resets the iterator to the set's first element.
void | ResetEnd ()
| Resets the iterator to the set's last element.
T * | Object ()
| Returns the current element. More...
void | Next ()
| Sets the iterator to the next element in the set.
void | Prev ()
| Sets the iterator to the previous element in the set.
OFBool | operator== (const OFSetIterator< T > &other) const
| Determines if two iterators are identical. More...
OFBool | operator!= (const OFSetIterator< T > &other) const
| Determines if two iterators are not identical. More...

## Protected Attributes
OFSet< T > & | ofset
| reference to the set instance
unsigned int | pos
| current position in the set

## Detailed Description

### template<class T>
class OFSetIterator< T >

This template class represents an iterator class for corresponding set data structures in ofstd.

Note the following properties of this class:

- even if the underlying set is unordered, it does have an internal order which can be used for iteration purposes
- a reference to the set which shall be iterated over will be remembered inside an object of OFSetIterator<T>; the set will NOT be copied
- it is possible to iterate from beginning to end or from end to beginning of the underlying set using Next() or Prev() (see below)
- if an element from the set is removed during the iteration, the iteration process has to be canceled and restarted
- two OFSetIterators can be compared through operators == and !=; two iterators are considered to be identical, if and only if they operate on the exact same set (identical memory addresses) and they currently refer to the same element

## Constructor & Destructor Documentation

## ◆ OFSetIterator()

template<class T >

OFSetIterator< T >::OFSetIterator | ( | OFSet< T > & | ofsetv | ) |
| inline

Constructor.

The iterator will be set to the set's first element.

Parameters

  ofsetv | Set to which the created object shall be an iterator.

## Member Function Documentation

## ◆ Object()

template<class T >

T* OFSetIterator< T >::Object | ( |  | ) |
| inline

Returns the current element.

Returns
  Pointer to the current original element in the set.

References OFSetIterator< T >::ofset, and OFSetIterator< T >::pos.

## ◆ operator!=()

template<class T >

OFBool OFSetIterator< T >::operator!= | ( | const OFSetIterator< T > & | other | ) | const
| inline

Determines if two iterators are not identical.

Parameters

  other | Iterator which shall be compared with this.

Returns
  OFTrue if iterators are not identical, OFFalse otherwise.

## ◆ operator==()

template<class T >

OFBool OFSetIterator< T >::operator== | ( | const OFSetIterator< T > & | other | ) | const
| inline

Determines if two iterators are identical.

Parameters

  other | Iterator which shall be compared with this.

Returns
  OFTrue if iterators are identical, OFFalse otherwise.

References OFSetIterator< T >::ofset, and OFSetIterator< T >::pos.

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

- ofstd/include/dcmtk/ofstd/ofsetit.h

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