DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | List of all members
OFList< T > Class Template Reference

double linked list template class. More...

+ Inheritance diagram for OFList< T >:

Public Member Functions

OFIterator< T > insert (OFIterator< T > position, const T &x)
 inserts an element into the list before the given position. More...
 
 OFList ()
 default constructor
 
 OFList (const OFList< T > &oldList)
 copy constructor
 
OFIterator< T > begin () const
 returns an iterator referencing the first element in the list. More...
 
OFIterator< T > end () const
 returns an iterator which points to the past-to-end element of the list. More...
 
OFBool empty () const
 returns true if list is empty. More...
 
size_t size () const
 returns number of elements in the list. More...
 
T & front ()
 returns a reference to the first element in the list. More...
 
const T & front () const
 returns a constant reference to the first element in the list. More...
 
T & back ()
 returns a reference to the last element in the list. More...
 
const T & back () const
 returns a constant reference to the last element in the list. More...
 
void push_front (const T &x)
 inserts before the first element of the list. More...
 
void pop_front ()
 removes the first element of the list. More...
 
void push_back (const T &x)
 inserts after the last element of the list. More...
 
void pop_back ()
 removes the last element of the list. More...
 
void insert (OFIterator< T > position, size_t n, const T &x)
 inserts n elements with value x into the list, before the given position. More...
 
OFIterator< T > erase (OFIterator< T > position)
 removes the element at the given position from the list. More...
 
OFIterator< T > erase (OFIterator< T > position, OFIterator< T > last)
 removes all elements in the range [position,last) from the list. More...
 
void clear ()
 removes all elements from the list. More...
 
void splice (OFIterator< T > position, OFList< T > &x)
 moves the contents of list x into the current list before the given position. More...
 
void splice (OFIterator< T > position, OFList< T > &x, OFIterator< T > i)
 inserts one element from list x into the current list and removes it from x More...
 
void splice (OFIterator< T > position, OFList< T > &x, OFIterator< T > first, OFIterator< T > last)
 inserts elements in the range [first, last) before position and removes the elements from x More...
 
void remove (const T &value)
 removes all elements from the list referred by an iterator i where *i == value More...
 
OFList< T > & operator= (const OFList< T > &arg)
 copy assignment operator More...
 

Private Member Functions

void copy (const OFList< T > &oldList)
 inserts a copy of the given list into the current list. More...
 
void recalcListSize ()
 counts the elements in the list and adjusts the listSize member variable.
 

Detailed Description

template<class T>
class OFList< T >

double linked list template class.

The interface is a subset of the STL list class.

Member Function Documentation

◆ back() [1/2]

template<class T>
T& OFList< T >::back ( )
inline

returns a reference to the last element in the list.

May only be called if list is non-empty.

Returns
last element in list, by reference

◆ back() [2/2]

template<class T>
const T& OFList< T >::back ( ) const
inline

returns a constant reference to the last element in the list.

May only be called if list is non-empty.

Returns
last element in list, by constant reference

◆ begin()

template<class T>
OFIterator<T> OFList< T >::begin ( ) const
inline

returns an iterator referencing the first element in the list.

If the list is empty, then begin() == end().

Returns
iterator to first element of list, by value.

Referenced by OFMap< log4cplus::tstring, ProvisionNode >::begin(), OFList< DRTRelatedRTROIObservationsSequence::Item *>::copy(), OFList< DRTRelatedRTROIObservationsSequence::Item *>::operator=(), and OFList< DRTRelatedRTROIObservationsSequence::Item *>::splice().

◆ clear()

template<class T>
void OFList< T >::clear ( )
inline

removes all elements from the list.

All iterators pointing to elements in the list become invalid.

Referenced by OFMap< log4cplus::tstring, ProvisionNode >::clear(), and OFTestTest::runAndReturn().

◆ copy()

template<class T>
void OFList< T >::copy ( const OFList< T > &  oldList)
inlineprivate

inserts a copy of the given list into the current list.

Parameters
oldListlist to be copied

◆ empty()

template<class T>
OFBool OFList< T >::empty ( void  ) const
inline

returns true if list is empty.

Returns
OFTrue if list is empty, OFFalse otherwise.

◆ end()

template<class T>
OFIterator<T> OFList< T >::end ( ) const
inline

◆ erase() [1/2]

template<class T>
OFIterator<T> OFList< T >::erase ( OFIterator< T >  position)
inline

removes the element at the given position from the list.

All iterators pointing to the removed element become invalid.

Returns
iterator pointing to the element after the removed one

Referenced by OFMap< log4cplus::tstring, ProvisionNode >::erase(), and OFList< DRTRelatedRTROIObservationsSequence::Item *>::operator=().

◆ erase() [2/2]

template<class T>
OFIterator<T> OFList< T >::erase ( OFIterator< T >  position,
OFIterator< T >  last 
)
inline

removes all elements in the range [position,last) from the list.

All iterators pointing to the removed elements become invalid.

Parameters
positioniterator to the first element to be deleted
lastiterator pointing to the element after the last element to be removed
Returns
iterator pointing to the element after the last removed element

◆ front() [1/2]

template<class T>
T& OFList< T >::front ( )
inline

returns a reference to the first element in the list.

May only be called if list is non-empty.

Returns
first element in list, by reference

◆ front() [2/2]

template<class T>
const T& OFList< T >::front ( ) const
inline

returns a constant reference to the first element in the list.

May only be called if list is non-empty.

Returns
first element in list, by constant reference

◆ insert() [1/2]

template<class T>
OFIterator<T> OFList< T >::insert ( OFIterator< T >  position,
const T &  x 
)
inline

inserts an element into the list before the given position.

Parameters
positioniterator to position before which the element is inserted
xvalue from which the new list entry is copy-constructed
Returns
iterator pointing to the new element in the list

Referenced by OFMap< log4cplus::tstring, ProvisionNode >::insert(), and OFList< DRTRelatedRTROIObservationsSequence::Item *>::operator=().

◆ insert() [2/2]

template<class T>
void OFList< T >::insert ( OFIterator< T >  position,
size_t  n,
const T &  x 
)
inline

inserts n elements with value x into the list, before the given position.

Parameters
positioniterator to position before which the elements are inserted
nnumber of entries to be created
xvalue from which the new list entries are copy-constructed

◆ operator=()

template<class T>
OFList<T>& OFList< T >::operator= ( const OFList< T > &  arg)
inline

copy assignment operator

Parameters
argthe list to copy from
Returns
*this

◆ pop_back()

template<class T>
void OFList< T >::pop_back ( )
inline

removes the last element of the list.

May only be called if list is non-empty. All iterators pointing to the removed element become invalid.

◆ pop_front()

template<class T>
void OFList< T >::pop_front ( )
inline

removes the first element of the list.

May only be called if list is non-empty. All iterators pointing to the removed element become invalid.

◆ push_back()

template<class T>
void OFList< T >::push_back ( const T &  x)
inline

inserts after the last element of the list.

Parameters
xvalue from which the new list entry is copy constructed

Referenced by OFTestTest::recordFailure().

◆ push_front()

template<class T>
void OFList< T >::push_front ( const T &  x)
inline

inserts before the first element of the list.

Parameters
xvalue from which the new list entry is copy constructed

◆ remove()

template<class T>
void OFList< T >::remove ( const T &  value)
inline

removes all elements from the list referred by an iterator i where *i == value

Parameters
valuevalue to be compared with list contents

◆ size()

template<class T>
size_t OFList< T >::size ( ) const
inline

returns number of elements in the list.

Returns
number of elements

Referenced by OFMap< log4cplus::tstring, ProvisionNode >::empty(), and OFMap< log4cplus::tstring, ProvisionNode >::size().

◆ splice() [1/3]

template<class T>
void OFList< T >::splice ( OFIterator< T >  position,
OFList< T > &  x 
)
inline

moves the contents of list x into the current list before the given position.

Parameters
positioniterator to position before which the elements are inserted
xlist from which the elements are taken, becomes empty

◆ splice() [2/3]

template<class T>
void OFList< T >::splice ( OFIterator< T >  position,
OFList< T > &  x,
OFIterator< T >  i 
)
inline

inserts one element from list x into the current list and removes it from x

Parameters
positioniterator to position before which the element is inserted
xlist from which the element is taken
iiterator to element in list x which is to be moved

◆ splice() [3/3]

template<class T>
void OFList< T >::splice ( OFIterator< T >  position,
OFList< T > &  x,
OFIterator< T >  first,
OFIterator< T >  last 
)
inline

inserts elements in the range [first, last) before position and removes the elements from x

Parameters
positioniterator to position before which the elements are inserted
xlist from which the elements are taken
firstiterator to first element in list x to be moved
lastiterator to element after last element in list x to be moved

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


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13