DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmList Class Reference

double-linked list class that maintains pointers to DcmObject instances. More...

## Public Member Functions
| DcmList ()
| constructor
| ~DcmList ()
| destructor
DcmObject * | append (DcmObject *obj)
| insert object at end of list More...
DcmObject * | prepend (DcmObject *obj)
| insert object at start of list More...
DcmObject * | insert (DcmObject *obj, const E_ListPos pos=ELP_next)
| insert object relative to current position and indicator More...
DcmObject * | remove ()
| remove current entry from list, return element More...
DcmObject * | get (const E_ListPos pos=ELP_atpos)
| get pointer to element in list at given position More...
DcmObject * | seek (const E_ListPos pos=ELP_next)
| seek within element in list to given position (i.e. More...
DcmObject * | seek_to (const unsigned long absolute_position)
| seek within element in list to given element index (i.e. More...
void | deleteAllElements ()
| remove and delete all elements from list. More...
unsigned long | card () const
| return cardinality of list
OFBool | empty () const
| return true if list is empty, false otherwise
OFBool | valid () const
| return true if current node exists, false otherwise

## Private Member Functions
DcmList & | operator= (const DcmList &)
| private undefined copy constructor
| DcmList (const DcmList &newList)
| private undefined copy assignment operator More...

## Private Attributes
DcmListNode * | firstNode
| pointer to first node in list
DcmListNode * | lastNode
| pointer to last node in list
DcmListNode * | currentNode
| pointer to current node in list
unsigned long | currentPosition
| current position in list. More...
unsigned long | cardinality
| number of elements in list

## Detailed Description

double-linked list class that maintains pointers to DcmObject instances.

The remove operation does not delete the object pointed to, however, the destructor will delete all elements the list points to.

## Constructor & Destructor Documentation

## ◆ DcmList()

DcmList::DcmList | ( | const DcmList & | newList | ) |
| private

private undefined copy assignment operator

Parameters

  newList | documented to avoid doxygen warnings

## Member Function Documentation

## ◆ append()

DcmObject* DcmList::append | ( | DcmObject * | obj | ) |

insert object at end of list

Parameters

  obj | pointer to object

Returns
  pointer to object, or NULL if object cannot be inserted

## ◆ deleteAllElements()

void DcmList::deleteAllElements | ( |  | ) |

remove and delete all elements from list.

Thus, the elements' memory is also freed by this operation. The list is empty after calling this function.

## ◆ get()

DcmObject* DcmList::get | ( | const E_ListPos | pos = `ELP_atpos` | ) |

get pointer to element in list at given position

Parameters

  pos | position indicator

Returns
  pointer to object

## ◆ insert()

DcmObject* DcmList::insert | ( | DcmObject * | obj,
|  | const E_ListPos | pos = `ELP_next`
| ) |  |

insert object relative to current position and indicator

Parameters

  obj | pointer to object
  pos | position indicator

Returns
  pointer to object, or NULL if object cannot be inserted

## ◆ prepend()

DcmObject* DcmList::prepend | ( | DcmObject * | obj | ) |

insert object at start of list

Parameters

  obj | pointer to object

Returns
  pointer to object, or NULL if object cannot be inserted

## ◆ remove()

DcmObject* DcmList::remove | ( |  | ) |

remove current entry from list, return element

Returns
  pointer to removed element, which is not deleted

## ◆ seek()

DcmObject* DcmList::seek | ( | const E_ListPos | pos = `ELP_next` | ) |

seek within element in list to given position (i.e.

set current element to given position)

Parameters

  pos | position indicator

Returns
  pointer to new current object

## ◆ seek_to()

DcmObject* DcmList::seek_to | ( | const unsigned long | absolute_position | ) |

seek within element in list to given element index (i.e.

set current element to given index)

Parameters

  absolute_position | position index < card()

Returns
  pointer to new current object

## Member Data Documentation

## ◆ currentPosition

unsigned long DcmList::currentPosition
| private

current position in list.

The position is maintained in order to avoid O(n) lookup when essentially iterating the elements using seek_to().

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

- dcmdata/include/dcmtk/dcmdata/dclist.h

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