NAME

OTC_ItemCursor - Cursor over buckets containing an item.

SYNOPSIS


#include <OTC/collctn/icursor.hh>

template<class T, class L>
class OTC_ItemCursor : public OTC_LinkCursor, public OTC_Cursor<T>
{
  public:
    static os_typespec* get_os_typespec();
    ~OTC_ItemCursor();
    OTC_ItemCursor(
      OTC_LinkList* aList,
      OTC_Direction theDirection=OTCLIB_FORWARD,
      OTC_Protection theProtection=OTCLIB_SAFE
    );
    OTC_ItemCursor(
      OTC_LinkList* aList,
      OTC_Linkable* theStart,
      OTC_Linkable* theEnd,
      OTC_Direction theDirection=OTCLIB_FORWARD,
      OTC_Protection theProtection=OTCLIB_SAFE
    );
    OTC_ItemCursor(OTC_ItemCursor<T,L> const& theIter);
    void reset();
    void next();
    T& item();
    OTC_Boolean isValid() const;
    OTC_Cursor<T>* clone();
};

CLASS TYPE

Concrete

DESCRIPTION

Derived version of OTC_Cursor, which iterates over the items in an instance of OTC_LinkList. The type of the class derived from OTC_Link and which are held by the link list must be supplied as the second template argument. The class derived from OTC_Link must provide a function called item(). This function must return a reference to a modifiable object of type T.

INITIALISATION

OTC_ItemCursor(
  OTC_LinkList* aList,
  OTC_Direction theDirection=OTCLIB_FORWARD,
  OTC_Protection theProtection=OTCLIB_SAFE
);
OTC_ItemCursor(
  OTC_LinkList* aList,
  OTC_Linkable* theStart,
  OTC_Linkable* theEnd,
  OTC_Direction theDirection=OTCLIB_FORWARD,
  OTC_Protection theProtection=OTCLIB_SAFE
);
OTC_ItemCursor(OTC_ItemCursor<T,L> const& theIter);

MOVEMENT

Following operations allow movement of the iterator over the list.
void reset();
void next();

RETRIEVAL

T& item();
OTC_Boolean isValid() const;

CLONING

OTC_Cursor<T>* clone();

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED