NAME

OTC_SimpleList - Linked list with inbuilt iterator.

SYNOPSIS


#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();
};

CLASS TYPE

Concrete

DESCRIPTION

Do not use this class, instead, use 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.

CONSTRUCTION

OTC_SimpleList();

DESTRUCTION

~OTC_SimpleList();

POPULATION

inline u_int population() const;
inline OTC_Boolean isEmpty() const;

ITERATION

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;

ADDITION

void addBefore(T const& theItem);
void addAfter(T const& theItem);
void addFirst(T const& theItem);
void addLast(T const& theItem);

LOOKING

inline T& item();
inline T const& item() const;
inline T& first();
inline T const& first() const;
inline T& last();
inline T const& last() const;

REMOVING

Note that if pointers are held in the list and they need to be deleted, you should delete the objects explicitly as the remove() functions will not delete objects pointed at, by pointers in the list.
void removeAll();
void remove();
void removeFirst();
void removeLast();

SEE ALSO

OTC_Holder

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED