#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);
};
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.
OTC_DequeI();
OTC_DequeI(OTC_DequeI const& theDeque);
theDeque
. Ie., each shares and access
the same implementation.
inline OTC_LinkList* list() const;
inline u_int population() const;
inline OTC_Boolean isEmpty() const;
OTCLIB_TRUE
if there are no
live links in the deque.
void remove(OTC_Link* theLink);
theLink
from the deque. If
theLink
is not in this deque, the result
is undefined. Using this function to
delete a link not in this deque, will at
the minimum invalidate the population
for this deque.
inline void removeAll();
void removeFirst();
void removeLast();
OTC_Link* first() const;
OTC_Link* last() const;
void addFirst(OTC_Link* theLink);
theLink
at the start of the
the deque.
void addLast(OTC_Link* theLink);
theLink
at the end of the
the deque.
void addBeforeLink(OTC_Link* theNewLink, OTC_Link* theOldLink);
theNewLink
before theOldLink
in this list. If theOldLink
is not
in this list, the result is undefined.
If theOldLink
is the start anchor,
theNewLink
will be added as the
first link in the list. If theNewLink
is already in a list, the result
is undefined.
void addAfterLink(OTC_Link* theNewLink, OTC_Link* theOldLink);
theNewLink
after theOldLink
in this list. If theOldLink
is not
in this list, the result is undefined.
If theOldLink
is the end anchor,
theNewLink
will be added as the
last link in the list. If theNewLink
is already in a list, the result
is undefined.