OTC_MListIterator
to allow modification of items.
#include <OTC/collctn/mlstmdfr.hh> template<class T> class OTC_MListModifier : public OTC_MListIterator<T> {
public:
inline OTC_MListModifier( OTC_MList<T>& theList, OTC_Protection theProtection=OTCLIB_SAFE );
inline T& item() const;
inline void remove();
inline void addBefore(T const& theItem);
inline void addAfter(T const& theItem);
};
OTC_MListIterator
to allow modification
of items held by an instance of OTC_MList
. Items in the list can
also be removed using the iterator.
This iterator can be moved both forward and backwards. The
life of the iterator, cannot extend beyond the life of the
list being iterated over.
inline OTC_MListModifier(
OTC_MList<T>& theList,
OTC_Protection theProtection=OTCLIB_SAFE
);
theList
, or if the list is empty at the
start of the list. The argument
theProtection
determines if reference
counting will actually be performed on
links in the list. The default of
OTCLIB_SAFE
will result in reference
counting being performed. A value of
OTCLIB_UNSAFE
will turn of reference
counting. In this later case, the list
should not be modified while the iterator
exists as the state of the iterator will
be corrupted.
inline T& item() const;
inline void remove();
inline void addBefore(T const& theItem);
theItem
in the list before the
item where the iterator is currently
located. If the iterator is at the
start of the list, the item will be
added as the first item in the list.
inline void addAfter(T const& theItem);
theItem
in the list after the
item where the iterator is currently
located. If the iterator is at the
end of the list, the item will be
added as the last item in the list.
OTC_MListIterator