NAME

OTC_MList - A list class which can be modified through an iterator(modifier).

SYNOPSIS


#include <OTC/collctn/mlist.hh>

template<class T>
class OTC_MList
{
  public:
    static os_typespec* get_os_typespec();
    inline OTC_MList();
    OTC_MList(OTC_MList<T> const& theList);
    inline OTC_MList(OTC_MList<T>& theList, OTC_ShallowCopy);
    OTC_MList<T>& operator=(OTC_MList<T> const& theList);
    inline u_int population() const;
    inline OTC_Boolean isEmpty() const;
    inline void addFirst(T const& theItem);
    inline void addLast(T const& theItem);
    inline T& first();
    inline T const& first() const;
    inline T& last();
    inline T const& last() const;
    inline void removeAll();
    inline void removeFirst();
    inline void removeLast();
    void apply(
      OTC_Visitor<T>& theApplicator,
      OTC_Direction theDirection=OTCLIB_FORWARD,
      OTC_Protection theProtection=OTCLIB_SAFE
    ) const;
    void apply(
      OTC_Worker<T>& theApplicator,
      OTC_Direction theDirection=OTCLIB_FORWARD,
      OTC_Protection theProtection=OTCLIB_SAFE
    );
};

CLASS TYPE

Concrete

DESCRIPTION

OTC_MList implements a list of objects where access to and manipulation of items, is permitted on items occurring at the ends of the list. Manipulation and removal of items may also be achieved through a separate class specific iterator and modifier.

INITIALISATION

inline OTC_MList();
OTC_MList(OTC_MList<T> const& theList);
inline OTC_MList(OTC_MList<T>& theList, OTC_ShallowCopy);

ASSIGNMENT

OTC_MList<T>& operator=(OTC_MList<T> const& theList);

QUERY

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

ADDITION

inline void addFirst(T const& theItem);
inline void addLast(T const& theItem);

ACCESS

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

REMOVAL

inline void removeAll();
inline void removeFirst();
inline void removeLast();

APPLICATORS

void apply(
  OTC_Visitor<T>& theApplicator,
  OTC_Direction theDirection=OTCLIB_FORWARD,
  OTC_Protection theProtection=OTCLIB_SAFE
) const;
void apply(
  OTC_Worker<T>& theApplicator,
  OTC_Direction theDirection=OTCLIB_FORWARD,
  OTC_Protection theProtection=OTCLIB_SAFE
);

NOTES

The OTC_Bucket class is used internally to hold items in the list. Thus, the OTC_BaseActions class may be used to provide actions to be performed, when items are inserted and removed from the list.

SEE ALSO

OTC_Bucket, OTC_BaseActions, OTC_MListIterator, OTC_MListModifier

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED