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 | |
virtual | ~DSRListOfItems () |
destructor | |
DSRListOfItems< T > & | operator= (const DSRListOfItems< T > &lst) |
assignment operator | |
void | clear () |
clear all internal variables | |
OFBool | isEmpty () const |
check whether the list is empty | |
size_t | getNumberOfItems () const |
get number of items contained in the list | |
OFBool | isElement (const T &item) const |
check whether specified item is contained in the list | |
const T & | getItem (const size_t idx) const |
get reference to the specified item | |
OFCondition | getItem (const size_t idx, T &item) const |
get copy of the specified item | |
void | addItem (const T &item) |
add item to the list | |
void | addOnlyNewItem (const T &item) |
add item to the list only if it's not already contained | |
OFCondition | insertItem (const size_t idx, const T &item) |
insert item at specified position to the list | |
OFCondition | removeItem (const size_t idx) |
remove item from the list | |
Static Public Attributes | |
static const T | EmptyItem |
default item which is returned in getItem() if the index is invalid. | |
Protected Member Functions | |
OFBool | gotoItemPos (size_t idx, OFLIST_TYPENAME OFListConstIterator(T)&iterator) const |
goto specified item position | |
OFBool | gotoItem (const T &item, OFLIST_TYPENAME OFListConstIterator(T)&iterator) const |
goto specified item | |
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.
Definition at line 53 of file dsrtlist.h.
DSRListOfItems< T >::DSRListOfItems | ( | const DSRListOfItems< T > & | lst | ) | [inline] |
void DSRListOfItems< T >::addItem | ( | const T & | item | ) | [inline] |
void DSRListOfItems< T >::addOnlyNewItem | ( | const T & | item | ) | [inline] |
add item to the list only if it's not already contained
item | item to be added |
Definition at line 173 of file dsrtlist.h.
OFCondition DSRListOfItems< T >::getItem | ( | const size_t | idx, | |
T & | item | |||
) | const [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!) |
Definition at line 149 of file dsrtlist.h.
const T& DSRListOfItems< T >::getItem | ( | const size_t | idx | ) | const [inline] |
get reference to the specified item
idx | index of the item to be returned (starting from 1) |
Reimplemented in DSRGraphicDataList.
Definition at line 134 of file dsrtlist.h.
size_t DSRListOfItems< T >::getNumberOfItems | ( | ) | const [inline] |
get number of items contained in the list
Definition at line 115 of file dsrtlist.h.
OFBool DSRListOfItems< T >::gotoItem | ( | const T & | item, | |
OFLIST_TYPENAME OFListConstIterator(T)& | iterator | |||
) | const [inline, protected] |
goto specified item
item | value of the item to go to (starting from 1) | |
iterator | list iterator storing the positition of the item |
Definition at line 253 of file dsrtlist.h.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::isElement().
OFBool DSRListOfItems< T >::gotoItemPos | ( | size_t | idx, | |
OFLIST_TYPENAME OFListConstIterator(T)& | iterator | |||
) | const [inline, protected] |
goto specified item position
idx | index of the item to go to (starting from 1) | |
iterator | list iterator storing the positition of the item |
Definition at line 233 of file dsrtlist.h.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::getItem(), DSRListOfItems< DSRWaveformChannelItem >::insertItem(), and DSRListOfItems< DSRWaveformChannelItem >::removeItem().
OFCondition DSRListOfItems< T >::insertItem | ( | const size_t | idx, | |
const T & | item | |||
) | [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 |
Definition at line 184 of file dsrtlist.h.
OFBool DSRListOfItems< T >::isElement | ( | const T & | item | ) | const [inline] |
check whether specified item is contained in the list
item | item to be checked |
Definition at line 124 of file dsrtlist.h.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::addOnlyNewItem().
OFBool DSRListOfItems< T >::isEmpty | ( | ) | const [inline] |
check whether the list is empty
Definition at line 107 of file dsrtlist.h.
DSRListOfItems<T>& DSRListOfItems< T >::operator= | ( | const DSRListOfItems< T > & | lst | ) | [inline] |
assignment operator
lst | list to be copied |
Reimplemented in DSRGraphicDataList, DSRReferencedDatetimeList, and DSRWaveformChannelList.
Definition at line 83 of file dsrtlist.h.
OFCondition DSRListOfItems< T >::removeItem | ( | const size_t | idx | ) | [inline] |
remove item from the list
idx | index of the item to be removed (starting from 1) |
Definition at line 208 of file dsrtlist.h.
const T DSRListOfItems< T >::EmptyItem [static] |
default item which is returned in getItem() if the index is invalid.
This static member variable needs to be defined (not only declared) in each derived class.
Definition at line 223 of file dsrtlist.h.
Referenced by DSRListOfItems< DSRWaveformChannelItem >::getItem().