NAME

OTC_DequeI - Core for implementing deque and list structures without an index.

SYNOPSIS


#include <OTC/collctn/dequei.hh>

class OTC_DequeI
{
  public:
    ~OTC_DequeI();
    OTC_DequeI();
    OTC_DequeI(OTC_DequeI const& theDeque);
    inline OTC_LinkList* list() const;
    inline u_int population() const;
    inline OTC_Boolean isEmpty() const;
    void remove(OTC_Link* theLink);
    inline void removeAll();
    void removeFirst();
    void removeLast();
    OTC_Link* first() const;
    OTC_Link* last() const;
    void addFirst(OTC_Link* theLink);
    void addLast(OTC_Link* theLink);
    void addBeforeLink(OTC_Link* theNewLink, OTC_Link* theOldLink);
    void addAfterLink(OTC_Link* theNewLink, OTC_Link* theOldLink);
};

CLASS TYPE

Concrete

DESCRIPTION

The OTC_DequeI class factors out details necessary for implementing deque and list structures which do not require indexes. Factoring these details into this class means that they do not have to be part of the template interface which would be wrapped around this class. This class still provides access to the underlying list and also to the links in the list so that iteration mechanisms can be provided. You should however, always use the member functions of this class when wishing to manipulate the list. In other words you should not add or remove links directly to or from the list as that will invalidate the cached population maintained by this class.

INITIALISATION

OTC_DequeI();
OTC_DequeI(OTC_DequeI const& theDeque);

QUERY

inline OTC_LinkList* list() const;
inline u_int population() const;
inline OTC_Boolean isEmpty() const;

REMOVAL

void remove(OTC_Link* theLink);
inline void removeAll();
void removeFirst();
void removeLast();

ACCESS

OTC_Link* first() const;
OTC_Link* last() const;

ADDITION

void addFirst(OTC_Link* theLink);
void addLast(OTC_Link* theLink);
void addBeforeLink(OTC_Link* theNewLink, OTC_Link* theOldLink);
void addAfterLink(OTC_Link* theNewLink, OTC_Link* theOldLink);

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED