DCMTK: OFIterator< T > Class Template Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OFIterator< T > Class Template Reference

iterator class for OFList. More...

## Public Types
typedef T | value_type
| member typedef for T
typedef T * | pointer
| member typedef for T*
typedef T & | reference
| member typedef for T&
typedef STD_NAMESPACE bidirectional_iterator_tag | iterator_category
| member typedef declaring the category

## Public Member Functions
| OFIterator ()
| default constructor.
| OFIterator (const OFIterator< T > &x)
| copy constructor
OFIterator< T > & | operator= (const OFIterator< T > &x)
| copy assignment operator
OFBool | operator== (const OFIterator< T > &x) const
| comparison of two iterators.
OFBool | operator!= (const OFIterator< T > &x) const
| comparison of two iterators.
T & | operator* () const
| dereferences the iterator.
T * | operator-> () const
| dereferences the iterator.
OFIterator< T > & | operator++ ()
| moves the iterator to the next element of the list.
OFIterator< T > | operator++ (int)
| moves the iterator to the next element of the list.
OFIterator< T > & | operator-- ()
| moves the iterator to the previous element of the list.
OFIterator< T > | operator-- (int)
| moves the iterator to the previous element of the list.

## Protected Member Functions
| OFIterator (OFListLinkBase *x)
| constructor.

## Protected Attributes
OFListLinkBase * | node
| list node referenced by the iterator

## Friends
class | OFList< T >

## Detailed Description

template<class T>
class OFIterator< T >

iterator class for OFList.

An iterator is a generalization of a pointer and allows a C++ program to work with different containers independently from their internal structure. Instances of this template class should be declared as OFListIterator(T) instead of OFListIterator<T>. This allows to re-map OFList to the STL list class if available.

## Constructor & Destructor Documentation

## ◆ OFIterator() [1/2]

template<class T>

OFIterator< T >::OFIterator | ( | OFListLinkBase * | x | ) |
| inlineprotected

constructor.

Parameters

  x | list node referenced by the iterator

References node.

Referenced by OFIterator(), operator!=(), operator++(), operator++(), operator--(), operator--(), operator=(), and operator==().

## ◆ OFIterator() [2/2]

template<class T>

OFIterator< T >::OFIterator | ( |  | ) |
| inline

default constructor.

Creates an iterator referencing nothing. In general, iterators should always be copy-constructed in user code.

References node.

## Member Function Documentation

## ◆ operator!=()

template<class T>

OFBool OFIterator< T >::operator!= | ( | const OFIterator< T > & | x | ) | const
| inline

comparison of two iterators.

The iterators are equal if and only if they reference the same element, independent from the element values.

Parameters

  x | iterator to be compared

Returns
  OFTrue if not equal, OFFalse otherwise.

References OFIterator(), and node.

## ◆ operator*()

template<class T>

T & OFIterator< T >::operator* | ( |  | ) | const
| inline

dereferences the iterator.

May only be called if iterator references a valid element of a list.

Returns
  reference to the element "pointed to" by the iterator.

References node.

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

template<class T>

OFIterator< T > & OFIterator< T >::operator++ | ( |  | ) |
| inline

moves the iterator to the next element of the list.

The list is circular: the first element follows after the end of the list. May only be called if iterator references a valid element or the end of a list.

Returns
  reference to the incremented iterator.

References OFIterator(), and node.

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

template<class T>

OFIterator< T > OFIterator< T >::operator++ | ( | int |  | ) |
| inline

moves the iterator to the next element of the list.

The list is circular: the first element follows after the end of the list. May only be called if iterator references a valid element or the end of a list. This is the post-increment operator.

Returns
  previous iterator state, by value

References OFIterator(), and node.

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

template<class T>

OFIterator< T > & OFIterator< T >::operator-- | ( |  | ) |
| inline

moves the iterator to the previous element of the list.

The list is circular: the end of the list follows before the first element. May only be called if iterator references a valid element or the end of a list.

Returns
  reference to the decremented iterator.

References OFIterator(), and node.

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

template<class T>

OFIterator< T > OFIterator< T >::operator-- | ( | int |  | ) |
| inline

moves the iterator to the previous element of the list.

The list is circular: the end of the list follows before the first element. May only be called if iterator references a valid element or the end of a list. This is the post-decremented operator.

Returns
  previous iterator state, by value

References OFIterator(), and node.

## ◆ operator->()

template<class T>

T * OFIterator< T >::operator-> | ( |  | ) | const
| inline

dereferences the iterator.

May only be called if iterator references a valid element of a list.

Returns
  reference to the element "pointed to" by the iterator.

## ◆ operator==()

template<class T>

OFBool OFIterator< T >::operator== | ( | const OFIterator< T > & | x | ) | const
| inline

comparison of two iterators.

The iterators are equal if and only if they reference the same element, independent from the element values.

Parameters

  x | iterator to be compared

Returns
  OFTrue if equal, OFFalse otherwise.

References OFIterator(), and node.

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

- ofstd/include/dcmtk/ofstd/oflist.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2