#include <OTC/collctn/cursor.hh> template<class T> class OTC_Cursor : public OTC_Resource {
public:
~OTC_Cursor();
OTC_Cursor();
virtual void reset() = 0;
virtual void next() = 0;
virtual T& item() = 0;
virtual OTC_Boolean isValid() const = 0;
virtual OTC_Cursor<T>* clone() = 0;
static void apply( OTC_Cursor<T>* theCursor, OTC_Visitor<T>& theApplicator );
static void apply( OTC_Cursor<T>* theCursor, OTC_Worker<T>& theApplicator );
static void assign( OTC_Cursor<T>*& theLeft, OTC_Cursor<T>* theRight );
static void replace( OTC_Cursor<T>*& theLeft, OTC_Cursor<T>* theRight );
};
virtual void reset() = 0;
virtual void next() = 0;
virtual T& item() = 0;
virtual OTC_Boolean isValid() const = 0;
OTCLIB_TRUE
while there is
a valid data item under the current
location of the iterator.
virtual OTC_Cursor<T>* clone() = 0;
static void apply(
OTC_Cursor<T>* theCursor,
OTC_Visitor<T>& theApplicator
);
theApplicator
to each item
accessible by theCursor
.
static void apply(
OTC_Cursor<T>* theCursor,
OTC_Worker<T>& theApplicator
);
theApplicator
to each item
accessible by theCursor
.
static void assign(OTC_Cursor<T>*& theLeft, OTC_Cursor<T>* theRight);
theRight
and then updates
theLeft
with theRight
. Handles
theRight
being null.
static void replace(OTC_Cursor<T>*& theLeft, OTC_Cursor<T>* theRight);
theRight
, unreferences
theLeft
and then updates the variable
theLeft
with theRight
. Handles
null pointers and pointers which are
equivalent.