DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | List of all members
OFStack< T > Class Template Reference

template stack class. More...

Inheritance diagram for OFStack< T >:

## Public Member Functions
| OFStack ()
| default constructor
| OFStack (const OFStack< T > &x)
| copy constructor
OFStack< T > & | operator= (const OFStack< T > &x)
| assignment operator
OFBool | empty () const
| checks if the stack is empty. More...
size_t | size () const
| returns the number of elements on the stack More...
T & | top ()
| returns a reference to the top element on the stack. More...
const T & | top () const
| returns a const reference to the top element on the stack. More...
void | push (const T &x)
| inserts a new element on top of the stack. More...
void | pop ()
| removes the top element from the stack. More...

## Private Member Functions
int | copy (const OFStack< T > &x)
| copy assignment of a stack. More...
Private Member Functions inherited from OFStackBase
| OFStackBase ()
| default constructor
virtual | ~OFStackBase ()
| destructor
OFBool | base_empty () const
| checks if the stack is empty More...
size_t | base_size () const
| returns size of stack More...
OFStackLinkBase * | base_top ()
| returns element on top of stack. More...
const OFStackLinkBase * | base_top () const
| returns element on top of stack. More...
void | base_push (OFStackLinkBase *element)
| pushes element onto stack. More...
void | base_pop ()
| removes top element from stack. More...

## Additional Inherited Members
Private Attributes inherited from OFStackBase
OFStackLinkBase * | head
| pointer to top element of stack
size_t | stackSize
| size of stack

## Detailed Description

### template<class T>
class OFStack< T >

template stack class.

The interface is a subset of the STL stack class.

## Member Function Documentation

## ◆ copy()

template<class T >

int OFStack< T >::copy | ( | const OFStack< T > & | x | ) |
| inline private

copy assignment of a stack.

Parameters

  x | stack to be copied

Returns
  dummy value, required to keep Sun CC 2.0.1 happy

References OFStackBase::head, OFStack< T >::size(), and OFStackBase::stackSize.

Referenced by OFStack< T >::OFStack(), and OFStack< T >::operator=().

## ◆ empty()

template<class T >

OFBool OFStack< T >::empty | ( |  | ) | const
| inline

checks if the stack is empty.

Returns
  OFTrue if stack is empty, OFFalse otherwise.

References OFStackBase::base_empty().

Referenced by DSRTree< T >::DSRTree(), and DSRTree< T >::removeNode().

## ◆ pop()

template<class T >

void OFStack< T >::pop | ( |  | ) |
| inline

removes the top element from the stack.

This method may not be called if the stack is empty.

References OFStackBase::base_pop().

Referenced by DSRTree< T >::DSRTree(), and DSRTree< T >::removeNode().

## ◆ push()

template<class T >

void OFStack< T >::push | ( | const T & | x | ) |
| inline

inserts a new element on top of the stack.

The value of the new element is copy constructed from the given argument.

Parameters

  x | value to be pushed (copied) onto the stack

References OFStackBase::base_push().

Referenced by DSRTree< T >::DSRTree(), and DSRTree< T >::removeNode().

## ◆ size()

template<class T >

size_t OFStack< T >::size | ( |  | ) | const
| inline

returns the number of elements on the stack

Returns
  number of elements on stack

References OFStackBase::base_size().

Referenced by OFStack< T >::copy().

## ◆ top() [1/2]

template<class T >

T& OFStack< T >::top | ( |  | ) |
| inline

returns a reference to the top element on the stack.

This method may not be called if the stack is empty.

Returns
  reference to top element

Referenced by DSRTree< T >::DSRTree(), and DSRTree< T >::removeNode().

## ◆ top() [2/2]

template<class T >

const T& OFStack< T >::top | ( |  | ) | const
| inline

returns a const reference to the top element on the stack.

This method may not be called if the stack is empty.

Returns
  const reference to top element

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

- ofstd/include/dcmtk/ofstd/ofstack.h

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