NAME
OTC_RangeCursor -
A cursor over a range of integers.
SYNOPSIS
#include <OTC/collctn/rngecurs.hh>
class OTC_RangeCursor : public OTC_Cursor<int>
{
public:
~OTC_RangeCursor();
static os_typespec* get_os_typespec();
OTC_RangeCursor(
int theLower,
u_int theLength,
OTC_Direction theDirection=OTCLIB_FORWARD
);
void reset();
void next();
int& item();
OTC_Boolean isValid() const;
OTC_Cursor<int>* clone();
};
CLASS TYPE
Concrete
DESCRIPTION
This class is a cursor over a range of integers. Note that the
cursor is not over real data and should only be used with the
OTC_Iterator class, which will not allow modification of values
returned.
CONSTRUCTION
OTC_RangeCursor(
int theLower,
u_int theLength,
OTC_Direction theDirection=OTCLIB_FORWARD
);
Creates a cursor which will return values
from the range with lower bound theLower
and length theLength. theDirection
indicates in which direction the cursor
will traverse, ie., OTCLIB_FORWARD will
result in traversal from theLower to
theUpper; OTCLIB_BACKWARD will result
in traversal in the opposite direction.
MOVEMENT
void reset();
Resets the iterator back to the start.
void next();
Moves the iterator to the next value.
RETRIEVAL
int& item();
Returns the item under the cursor. It
is a precondition, that the cursor be
located over a valid value. If this is not
the case, an exception will be raised.
OTC_Boolean isValid() const;
Returns OTCLIB_TRUE while there is a
valid value under the cursor.
CLONING
OTC_Cursor<int>* clone();
Returns a new cursor which is a clone
of this one.
SEE ALSO
OTC_Cursor, OTC_Iterator
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED