DCMTK Version 3.6.8
OFFIS DICOM Toolkit
|
Template class to store and access items in a list structure. More...
Public Member Functions | |
DSRListOfItems () | |
default constructor | |
DSRListOfItems (const DSRListOfItems< T > &lst) | |
copy constructor More... | |
virtual | ~DSRListOfItems () |
destructor | |
DSRListOfItems< T > & | operator= (const DSRListOfItems< T > &lst) |
assignment operator More... | |
OFBool | operator== (const DSRListOfItems< T > &lst) const |
comparison operator "equal" More... | |
OFBool | operator!= (const DSRListOfItems< T > &lst) const |
comparison operator "not equal" More... | |
void | clear () |
clear all internal variables | |
OFBool | isEmpty () const |
check whether the list is empty More... | |
size_t | getNumberOfItems () const |
get number of items contained in the list More... | |
OFBool | isElement (const T &item) const |
check whether specified item is contained in the list More... | |
const T & | getItem (const size_t idx) const |
get reference to the specified item More... | |
OFCondition | getItem (const size_t idx, T &item) const |
get copy of the specified item More... | |
OFCondition | getItems (OFVector< T > &items) const |
get copy of all items (as a vector) More... | |
void | addItem (const T &item) |
add item to the list More... | |
void | addOnlyNewItem (const T &item) |
add item to the list only if it's not already contained More... | |
void | addItems (const OFVector< T > &items) |
add items to the list More... | |
OFCondition | insertItem (const size_t idx, const T &item) |
insert item at specified position to the list More... | |
OFCondition | removeItem (const size_t idx) |
remove item from the list More... | |
Protected Member Functions | |
OFBool | gotoItemPos (size_t idx, OFLIST_TYPENAME OFListConstIterator(T) &iterator) const |
goto specified item position More... | |
OFBool | gotoItem (const T &item, OFLIST_TYPENAME OFListConstIterator(T) &iterator) const |
goto specified item More... | |
Protected Attributes | |
OFList< T > | ItemList |
the list maintained by this class | |
Template class to store and access items in a list structure.
For instances of this class T needs to have at least a default constructor, assignment and comparison operator.
|
inline |
copy constructor
lst | list to be copied |
|
inline |
|
inline |
add items to the list
items | items to be added (stored as a vector) |
|
inline |
add item to the list only if it's not already contained
item | item to be added |
References DSRListOfItems< T >::isElement(), and DSRListOfItems< T >::ItemList.
|
inline |
get reference to the specified item
idx | index of the item to be returned (starting from 1) |
References DSRListOfItems< T >::gotoItemPos(), and DSRListOfItems< T >::ItemList.
|
inline |
get copy of the specified item
idx | index of the item to be returned (starting from 1) |
item | reference to a variable where the result should be stored. (not changed/cleared if an error occurs!) |
References EC_IllegalParameter, EC_Normal, DSRListOfItems< T >::gotoItemPos(), and DSRListOfItems< T >::ItemList.
|
inline |
get copy of all items (as a vector)
items | reference to a variable where the result should be stored. (always cleared before items are added) |
References OFVector< T >::clear(), EC_Normal, DSRListOfItems< T >::ItemList, OFVector< T >::push_back(), and OFVector< T >::reserve().
|
inline |
get number of items contained in the list
References DSRListOfItems< T >::ItemList.
|
inlineprotected |
goto specified item
item | value of the item to go to (starting from 1) |
iterator | list iterator storing the position of the item |
References DSRListOfItems< T >::ItemList.
Referenced by DSRListOfItems< T >::isElement().
|
inlineprotected |
goto specified item position
idx | index of the item to go to (starting from 1) |
iterator | list iterator storing the position of the item |
Referenced by DSRListOfItems< T >::getItem(), DSRListOfItems< T >::insertItem(), and DSRListOfItems< T >::removeItem().
|
inline |
insert item at specified position to the list
idx | index of the item before the new one should be inserted (starting from 1) |
item | item to be inserted |
References EC_IllegalParameter, EC_Normal, DSRListOfItems< T >::gotoItemPos(), and DSRListOfItems< T >::ItemList.
|
inline |
check whether specified item is contained in the list
item | item to be checked |
References DSRListOfItems< T >::gotoItem(), and DSRListOfItems< T >::ItemList.
Referenced by DSRListOfItems< T >::addOnlyNewItem().
|
inline |
check whether the list is empty
References DSRListOfItems< T >::ItemList.
|
inline |
comparison operator "not equal"
lst | list that should be compared to the current one |
References DSRListOfItems< T >::ItemList.
|
inline |
assignment operator
lst | list to be copied |
References DSRListOfItems< T >::ItemList.
|
inline |
comparison operator "equal"
lst | list that should be compared to the current one |
References DSRListOfItems< T >::ItemList.
|
inline |
remove item from the list
idx | index of the item to be removed (starting from 1) |
References EC_IllegalParameter, EC_Normal, DSRListOfItems< T >::gotoItemPos(), and DSRListOfItems< T >::ItemList.