OTC_MList
. No modification allowed.
#include <OTC/collctn/mlstiter.hh> template<class T> class OTC_MListIterator {
public:
inline OTC_MListIterator( OTC_MList<T> const& theList, OTC_Protection theProtection=OTCLIB_SAFE );
inline void prev();
inline void next();
inline void resetFirst();
inline void resetLast();
inline T const& item() const;
inline OTC_Boolean isValid() const;
protected:
inline T& _item() const;
inline void _remove();
inline void _addBefore(T const& theItem);
inline void _addAfter(T const& theItem);
};
OTC_MList
class.
Modification of items through the iterator is not permitted.
If modification of items held by an instance of OTC_MList
,
through an iterator is required, the OTC_MListModifier
class
should be used.
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_MListIterator(
OTC_MList<T> const& 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 off 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 void prev();
inline void next();
inline void resetFirst();
inline void resetLast();
inline T const& item() const;
inline OTC_Boolean isValid() const;
OTCLIB_TRUE
while there is a
valid item under the current location
of the iterator.
OTC_MListModifier