OTC_Bucket
.
#include <OTC/collctn/buckcurs.hh> template<class T> class OTC_BucketCursor : public OTC_Cursor<T> {
public:
static os_typespec* get_os_typespec();
~OTC_BucketCursor();
OTC_BucketCursor( OTC_LinkList* aList, OTC_Direction theDirection=OTCLIB_FORWARD, OTC_Protection theProtection=OTCLIB_SAFE );
OTC_BucketCursor( OTC_LinkList* aList, OTC_Linkable* theStart, OTC_Linkable* theEnd, OTC_Direction theDirection=OTCLIB_FORWARD, OTC_Protection theProtection=OTCLIB_SAFE );
OTC_BucketCursor(OTC_BucketCursor<T> const& aIter);
void reset();
void next();
T& item();
OTC_Boolean isValid() const;
OTC_Cursor<T>* clone();
inline OTC_Direction direction() const;
void reverse();
};
OTC_Cursor
, which iterates over the items
in an instance of OTC_LinkList
, where the derived type of
link is OTC_Bucket
.
This class should no longer be used. Instead the OTC_ItemCursor
class should be used. The OTC_BucketCursor
class will be
removed in OSE 4.0.
OTC_BucketCursor(
OTC_LinkList* aList,
OTC_Direction theDirection=OTCLIB_FORWARD,
OTC_Protection theProtection=OTCLIB_SAFE
);
aList
is the list being iterated over.
theDirection
indicates which way
traversal is to occur. If theDirection
is OTCLIB_FORWARD
, traversal will be
from the start of aList
to the end. If
it is OTCLIB_BACKWARD
, it will be in the
opposite direction. theProtection
determines whether reference counting is
performed on the links in the list.
Reference counting ensures the integrity of
the iterator when removals and additions
are perfomed. The values for theProtection
are OTCLIB_SAFE
and OTCLIB_UNSAFE
.
The default argument is OTCLIB_UNSAFE
.
OTC_BucketCursor(
OTC_LinkList* aList,
OTC_Linkable* theStart,
OTC_Linkable* theEnd,
OTC_Direction theDirection=OTCLIB_FORWARD,
OTC_Protection theProtection=OTCLIB_SAFE
);
aList
is the list being iterated over.
theStart
and theEnd
are the anchor
points within the list which define the
bounds of the iterator. If theDirection
is OTCLIB_FORWARD
, traversal will be
from the theStart
to theEnd
. If it
is OTCLIB_BACKWARD
, it will be in
the opposite direction. Note that this
class relies on theStart
preceeding
theEnd
in the list. theProtection
determines whether reference counting is
performed on the links in the list.
Reference counting ensures the integrity of
the iterator when removals and additions
are perfomed. The values for theProtection
are OTCLIB_SAFE
and OTCLIB_UNSAFE
.
The default argument is OTCLIB_UNSAFE
.
OTC_BucketCursor(OTC_BucketCursor<T> const& aIter);
aIter
.
void reset();
void next();
T& item();
OTC_Boolean isValid() const;
OTCLIB_TRUE
while there is a
link under the current location of the
iterator and not an anchor point. In other
words if the iterator is located over a
link which has been marked as dead, then
OTCLIB_TRUE
will still be returned.
OTC_Cursor<T>* clone();
inline OTC_Direction direction() const;
void reverse();