#include <OTC/collctn/prcursor.hh> template<class T1, class T2> class OTC_PairCursor : public OTC_Resource {
public:
OTC_PairCursor();
~OTC_PairCursor();
virtual void reset() = 0;
virtual void next() = 0;
virtual T1& key() = 0;
virtual T2& item() = 0;
virtual OTC_Boolean isValid() const = 0;
virtual OTC_PairCursor<T1,T2>* clone() = 0;
static void apply( OTC_PairCursor<T1,T2>* theCursor, OTC_PairVisitor<T1,T2>& theApplicator );
static void apply( OTC_PairCursor<T1,T2>* theCursor, OTC_PairWorker<T1,T2>& theApplicator );
static void assign( OTC_PairCursor<T1,T2>*& theLeft, OTC_PairCursor<T1,T2>* theRight );
static void replace( OTC_PairCursor<T1,T2>*& theLeft, OTC_PairCursor<T1,T2>* theRight );
};
virtual void reset() = 0;
virtual void next() = 0;
virtual T1& key() = 0;
virtual T2& 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_PairCursor<T1,T2>* clone() = 0;
static void apply(
OTC_PairCursor<T1,T2>* theCursor,
OTC_PairVisitor<T1,T2>& theApplicator
);
theApplicator
to each item
accessible by theCursor
.
static void apply(
OTC_PairCursor<T1,T2>* theCursor,
OTC_PairWorker<T1,T2>& theApplicator
);
theApplicator
to each item
accessible by theCursor
.
static void assign(
OTC_PairCursor<T1,T2>*& theLeft,
OTC_PairCursor<T1,T2>* theRight
);
theRight
and then updates
theLeft
with theRight
. Handles
theRight
being null.
static void replace(
OTC_PairCursor<T1,T2>*& theLeft,
OTC_PairCursor<T1,T2>* theRight
);
theRight
, unreferences
theLeft
and then updates the variable
theLeft
with theRight
. Handles
null pointers and pointers which are
equivalent.