NAME

OTC_LinkIterator - Iterator over a range of objects in a doubly linked list.

SYNOPSIS


#include <OTC/collctn/linkiter.hh>

class OTC_LinkIterator : public OTC_MPObject
{
  public:
    ~OTC_LinkIterator();
    static os_typespec* get_os_typespec();
    OTC_LinkIterator(
      OTC_Linkable* theStart,
      OTC_Linkable* theEnd,
      OTC_Protection theProtection=OTCLIB_SAFE
    );
    OTC_LinkIterator(OTC_LinkIterator const& theIter);
    OTC_LinkIterator& operator=(OTC_LinkIterator const& theIter);
    inline OTC_Boolean isStart() const;
    inline OTC_Boolean isEnd() const;
    inline OTC_Boolean isLink() const;
    inline void resetStart();
    inline void resetEnd();
    inline void resetFirst();
    inline void resetLast();
    void next();
    void prev();
    inline OTC_Link* link() const;
};

CLASS TYPE

Concrete

DESCRIPTION

The class OTC_LinkIterator, implements an iterator over a range of objects in a doubly linked list. The iterator provides the ability to move back and forth along the list of objects, and provides the ability to know when the iterator is located over a valid link, or on an end anchor point. By default, the iterator also transparently increments and decrements reference counts on the objects, to ensure that removal of a link from the list will not corrupt the iterator. This feature can be disabled if necessary.

INITIALISATION

OTC_LinkIterator(
  OTC_Linkable* theStart,
  OTC_Linkable* theEnd,
  OTC_Protection theProtection=OTCLIB_SAFE
);
OTC_LinkIterator(OTC_LinkIterator const& theIter);
OTC_LinkIterator& operator=(OTC_LinkIterator const& theIter);

LOCATION

inline OTC_Boolean isStart() const;
inline OTC_Boolean isEnd() const;
inline OTC_Boolean isLink() const;

ITERATION

inline void resetStart();
inline void resetEnd();
inline void resetFirst();
inline void resetLast();
void next();
void prev();

RETRIEVAL

inline OTC_Link* link() const;

SEE ALSO

OTC_Link, OTC_Anchor, OTC_Linkable

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED