#include <OTC/collctn/simplist.hh> template<class T> class OTC_SimpleList {
public:
OTC_SimpleList();
~OTC_SimpleList();
inline u_int population() const;
inline OTC_Boolean isEmpty() const;
inline OTC_Boolean isValid() const;
inline OTC_Boolean isStart() const;
inline OTC_Boolean isEnd() const;
inline void next() const;
inline void prev() const;
void resetFirst() const;
void resetLast() const;
void addBefore(T const& theItem);
void addAfter(T const& theItem);
void addFirst(T const& theItem);
void addLast(T const& theItem);
inline T& item();
inline T const& item() const;
inline T& first();
inline T const& first() const;
inline T& last();
inline T const& last() const;
void removeAll();
void remove();
void removeFirst();
void removeLast();
};
OTC_IList
. The OTC_IList
class is exactly the same as this class, only the name has
changed. This class will be removed in a future version.
OTC_SimpleList();
~OTC_SimpleList();
removeAll()
to kill all buckets
in the list. Note that if pointers are
held in the list and they need to be
deleted, the destructor should not be
relied upon to delete them. Instead, you
should iterate manually over the list and
delete each pointer.
inline u_int population() const;
inline OTC_Boolean isEmpty() const;
OTCLIB_TRUE
if the list is empty.
inline OTC_Boolean isValid() const;
OTCLIB_TRUE
if the iterator is
located over a live item.
inline OTC_Boolean isStart() const;
OTCLIB_TRUE
if the iterator is
located off the start of the list.
inline OTC_Boolean isEnd() const;
OTCLIB_TRUE
if the iterator is
located off the end of the list.
inline void next() const;
inline void prev() const;
void resetFirst() const;
void resetLast() const;
void addBefore(T const& theItem);
theItem
before the item where the
iterator is currently located. If the
iterator is located off the end of the
list, the effect is that theItem
is
appended to the list. If the iterator is
off the start of the list, the effect
is that theItem
is prepended to the
list. After the operation, the iterator
will be located on the newly inserted
item.
void addAfter(T const& theItem);
theItem
after the item where the
iterator is currently located. If the
iterator is located off the end of the
list, the effect is that theItem
is
appended to the list. If the iterator is
off the start of the list, the effect
is that theItem
is prepended to the
list. After the operation, the iterator
will be located on the newly inserted
item.
void addFirst(T const& theItem);
theItem
at the head of the list.
The location of the iterator is unchanged.
void addLast(T const& theItem);
theItem
after the last item in
the list. The location of the iterator
is unchanged.
inline T& item();
inline T const& item() const;
inline T& first();
inline T const& first() const;
inline T& last();
inline T const& last() const;
remove()
functions will not delete objects pointed at, by
pointers in the list.
void removeAll();
void remove();
void removeFirst();
void removeLast();
OTC_Holder