#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 );
};
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.
inline OTC_MList();
OTC_MList(OTC_MList<T> const& theList);
theList
.
inline OTC_MList(OTC_MList<T>& theList, OTC_ShallowCopy);
theList
.
OTC_MList<T>& operator=(OTC_MList<T> const& theList);
theList
.
inline u_int population() const;
inline OTC_Boolean isEmpty() const;
OTCLIB_TRUE
if the the list
is empty.
inline void addFirst(T const& theItem);
theItem
at the head of the list.
inline void addLast(T const& theItem);
theItem
to the tail of the list.
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;
theApplicator
to each of the
items in the collection. The direction
being determined by theDirection
. Valid
values are OTCLIB_FORWARD
and
OTCLIB_BACKWARD
.
void apply(
OTC_Worker<T>& theApplicator,
OTC_Direction theDirection=OTCLIB_FORWARD,
OTC_Protection theProtection=OTCLIB_SAFE
);
theApplicator
to each of the
items in the collection. The direction
being determined by theDirection
. Valid
values are OTCLIB_FORWARD
and
OTCLIB_BACKWARD
.
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.
OTC_Bucket
, OTC_BaseActions
, OTC_MListIterator
,
OTC_MListModifier