home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWIDLIST_H__
- #define __RWIDLIST_H__
- pragma push_align_members(64);
-
- /*
- * RWIsvDlist: An intrusive doubly-linked list.
- *
- * $Header: E:/vcs/rw/idlist.h_v 1.0 11 Mar 1992 14:10:44 KEFFER $
- *
- ****************************************************************************
- *
- * Rogue Wave Software, Inc.
- * P.O. Box 2328
- * Corvallis, OR 97339
- *
- * Copyright (C) 1992. This software is subject to copyright
- * protection under the laws of the United States and other countries.
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/rw/idlist.h_v $
- *
- * Rev 1.0 11 Mar 1992 14:10:44 KEFFER
- * Initial revision.
- */
-
- #include "rw/idlink.h"
- #include "rw/islist.h"
-
- /****************************************************************
- * *
- * Declarations for RWIsvDlist *
- * *
- ****************************************************************/
-
- class RWExport RWIsvDlist : public RWIsvSlist {
-
- friend class RWExport RWIsvDlistIterator;
-
- private:
-
- RWIsvDlist(const RWIsvDlist&); // Hide the copy constructor and assignment operator
- void operator=(const RWIsvDlist&);
-
- protected:
-
- RWIsvSlist::_lastDlink;
- void insertAfterLink(RWIsvDlink*, RWIsvDlink*);
-
- public:
-
- RWIsvDlist() { }
- RWIsvDlist(RWIsvDlink* a);
-
- /********************* Member functions **************************/
- void append(RWIsvDlink* a) {RWIsvDlist::insertAfterLink(_lastDlink, a);}
- RWIsvDlink* at(int i) const {return (RWIsvDlink*)RWIsvSlist::at(i);}
- RWIsvSlist::clear;
- RWIsvSlist::entries;
- RWIsvDlink* first() const {return (RWIsvDlink*)RWIsvSlist::first();}
- RWIsvDlink* get() {return removeFirst();}
- void insert(RWIsvDlink* a) {RWIsvDlist::append(a);}
- void insertAfter(int, RWIsvDlink*);
- void insertAt(int, RWIsvDlink*);
- RWIsvSlist::isEmpty;
- RWIsvDlink* last() const {return _lastDlink;}
- void prepend(RWIsvDlink*);
- RWIsvDlink* removeAt(int);
- RWIsvDlink* removeFirst(); // Remove and return link at head of list
- RWIsvDlink* removeLast(); // Remove and return the last link
- RWIsvDlink* removeReference(const RWIsvDlink* a); // Remove and return link; link MUST be in list
- };
-
-
- /****************************************************************
- * *
- * Declarations for RWIsvDlistIterator *
- * *
- ****************************************************************/
-
- class RWExport RWIsvDlistIterator : public RWIsvSlistIterator {
-
- typedef RWIsvSlistIterator BASE;
-
- // Disallow postfix increment. Unless we hide it, some compilers will
- // substitute the prefix increment operator in its place.
- RWBoolean operator++(int);
-
- public:
-
- // Constructor: starts with iterator positioned at last link.
- RWIsvDlistIterator(RWIsvDlist& s) : RWIsvSlistIterator(s) { }
-
- // Operators:
- RWBoolean operator++() {return BASE::operator++();}
- RWIsvDlink* operator()() {return (RWIsvDlink*)BASE::operator()();}
- RWBoolean operator+=(int n) {return BASE::operator+=(n);}
-
- RWIsvDlist* container() const {return _dlist;}
- void insertAfterPoint(RWIsvDlink*);
- RWIsvDlink* key() const {return (RWIsvDlink*)BASE::key();}
- void operator--();
- void operator-=(int n);
- RWIsvDlink* remove();
- RWIsvDlink* removeNextReference(const RWIsvDlink*);
- void reset() {BASE::reset();}
- void reset(RWIsvDlist& s) {BASE::reset(s);}
- };
-
- pragma pop_align_members();
- #endif /* __RWIDLIST_H__ */
-