NAME

OTC_Linkable - Base class for objects which can be linked together.

SYNOPSIS


#include <OTC/collctn/linkable.hh>

class OTC_Linkable : public OTC_MPObject
{
  public:
    void unlink();
    void kill();
    inline OTC_Boolean isLink() const;
    inline OTC_Boolean isDead() const;
    inline OTC_Linkable* prev() const;
    inline OTC_Linkable* next() const;
    void addBefore(OTC_Linkable* theObject);
    void addAfter(OTC_Linkable* theObject);
    void reference();
    void unReference();
  protected:
    OTC_Linkable(OTC_Boolean theIsLink=OTCLIB_FALSE);
    virtual ~OTC_Linkable();
};

CLASS TYPE

Abstract

DESCRIPTION

The OTC_Linkable class, is the basic building block for creating a doubly linked list of objects. Derived from OTC_Linkable are two classes which can be used when constructing a linked list. These two classes are OTC_Link and OTC_Anchor. The first of these is the base class for any user objects being placed into a linked list. The second class is used as an anchor point, from which to hang a linked list of objects. The OTC_Anchor class is also used in pairs to mark the boundaries for the traversal of an iterator.

UNLINKING

void unlink();

KILLING

void kill();

QUERY

inline OTC_Boolean isLink() const;
inline OTC_Boolean isDead() const;
inline OTC_Linkable* prev() const;
inline OTC_Linkable* next() const;

ADDITIONS

void addBefore(OTC_Linkable* theObject);
void addAfter(OTC_Linkable* theObject);

REFERENCES

void reference();
void unReference();

INITIALISATION

OTC_Linkable(OTC_Boolean theIsLink=OTCLIB_FALSE);

DESTRUCTION

virtual ~OTC_Linkable();

NOTES

All instances of classes derived from OTC_Linkable must be created on the free store, using new.

SEE ALSO

OTC_Link, OTC_Anchor, OTC_LinkIterator

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

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