DCMTK: DcmStack Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DcmStack Class Reference

this class manages a stack of pointers to DcmObject instances. More...

## Public Member Functions
| DcmStack ()
| default constructor, creates empty stack
| DcmStack (const DcmStack &arg)
| copy constructor.
| ~DcmStack ()
| destructor, not virtual. Do not derive from this class.
DcmStack & | operator= (const DcmStack &arg)
| copy assignment operator.
OFBool | operator== (const DcmStack &arg) const
| comparison operator, needed for MSVC5.
OFBool | operator< (const DcmStack &arg) const
| dummy comparison operator, needed for MSVC5.
DcmObject * | push (DcmObject *obj)
| push new pointer do DcmObject instance on stack
DcmObject * | pop ()
| removes uppermost entry from stack and returns it.
DcmObject * | top () const
| returns uppermost entry of stack without removing it.
DcmObject * | elem (const unsigned long number) const
| returns n-th element from stack without removing it.
OFBool | empty () const
| checks if the stack is empty
unsigned long | card () const
| returns cardinality (number of entries) of the stack
void | clear ()
| returns the stack to default-constructed state, i.e.

## Private Attributes
DcmStackNode * | topNode_
| pointer to the upmost stack entry, NULL if empty
unsigned long | cardinality_
| current cardinality of the stack

## Detailed Description

this class manages a stack of pointers to DcmObject instances.

The objects pointed to are never touched, e.g. deleted.

## Constructor & Destructor Documentation

## ◆ DcmStack()

DcmStack::DcmStack | ( | const DcmStack & | arg | ) |

copy constructor.

Only pointers to objects are copied, the DcmObject instances are not duplicated.

Parameters

  arg | stack to copy from

References DcmStack().

## Member Function Documentation

## ◆ card()

unsigned long DcmStack::card | ( |  | ) | const

returns cardinality (number of entries) of the stack

Returns
  cardinality of stack

## ◆ clear()

void DcmStack::clear | ( |  | ) |

returns the stack to default-constructed state, i.e.

empty state.

## ◆ elem()

DcmObject * DcmStack::elem | ( | const unsigned long | number | ) | const

returns n-th element from stack without removing it.

Parameters

  number | the number of the element

Returns
  n-th element from stack

## ◆ empty()

OFBool DcmStack::empty | ( |  | ) | const

checks if the stack is empty

Returns
  true if stack is empty, false otherwise

## ◆ operator<()

OFBool DcmStack::operator< | ( | const DcmStack & | arg | ) | const

dummy comparison operator, needed for MSVC5.

Parameters

  arg | stack to compare to

Returns
  true if the cardinality of this stack is smaller than the cardinality of arg, or if the cardinality is equal and pointer comparison, from the top to the bottom of the stack results in a smaller pointer for this stack.

References DcmStack().

## ◆ operator=()

DcmStack & DcmStack::operator= | ( | const DcmStack & | arg | ) |

copy assignment operator.

Only pointers to objects are copied, the DcmObject instances are not duplicated.

Parameters

  arg | object to assign from

Returns
  reference to this object

References DcmStack().

## ◆ operator==()

OFBool DcmStack::operator== | ( | const DcmStack & | arg | ) | const

comparison operator, needed for MSVC5.

Parameters

  arg | stack to compare to

Returns
  true if stacks are equal, false otherwise

References DcmStack().

## ◆ pop()

DcmObject * DcmStack::pop | ( |  | ) |

removes uppermost entry from stack and returns it.

Returns
  uppermost stack entry

## ◆ push()

DcmObject * DcmStack::push | ( | DcmObject * | obj | ) |

push new pointer do DcmObject instance on stack

Parameters

  obj | object pointer to push on stack

Returns
  pointer passed as obj

## ◆ top()

DcmObject * DcmStack::top | ( |  | ) | const

returns uppermost entry of stack without removing it.

Returns
  uppermost stack entry

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

- dcmdata/include/dcmtk/dcmdata/dcstack.h

Generated on Wed Apr 30 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2