home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWDLIST_H__
- #define __RWDLIST_H__
- pragma push_align_members(64);
-
- /*
- * Declarations for Doubly-linked lists.
- *
- * $Header: E:/vcs/rw/dlist.h_v 1.2 18 Feb 1992 09:54:18 KEFFER $
- *
- ****************************************************************************
- *
- * Rogue Wave
- * P.O. Box 2328
- * Corvallis, OR 97339
- * Voice: (503) 754-3010 FAX: (503) 757-6650
- *
- * Copyright (C) 1989, 1990, 1991. This software is subject to copyright
- * protection under the laws of the United States and other countries.
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/rw/dlist.h_v $
- *
- * Rev 1.2 18 Feb 1992 09:54:18 KEFFER
- *
- * Rev 1.1 28 Oct 1991 09:08:12 keffer
- * Changed inclusions to <rw/xxx.h>
- *
- * Rev 1.0 28 Jul 1991 08:14:22 keffer
- * Tools.h++ V4.0.5 PVCS baseline version
- *
- */
-
- #include "rw/slist.h"
-
- // Link in Doubly linked list:
- class RWExport RWDlink : public RWSlink {
- friend class RWExport RWDlist;
- friend class RWExport RWDlistIterator;
- protected:
- RWDlink* prevDlink; // Pointer to previous link.
- RWDlink(void* a, RWDlink* p = 0, RWDlink* n = 0) : RWSlink(a,n)
- { prevDlink = p; }
- };
-
- // Doubly linked list:
-
- class RWExport RWDlist : public RWSlist {
- friend class RWExport RWDlistIterator;
- private:
- void deleteLink(RWDlink*);
- RWDlink* findLink(int) const;
- void insertAfterLink(RWDlink*, void*);
- public:
- RWDlist() { }
- RWDlist(void* a);
- RWDlist(const RWDlist&);
- ~RWDlist() {clear();}
- void operator=(const RWDlist&);
-
- /********************* Member functions **************************/
- void* append(void*); // Add at tail of list.
- void clear();
- void* get(); // Return and delete value at head of list
- void* insert(void* a) { return RWDlist::append(a); }
- void* insertAfter(int, void*);
- void* prepend(void*);
- void* remove(RWtestGeneric, const void*);
- void* removeReference(const void*);
- };
-
- // Iterator for doubly linked list (moves iterator through the list):
- class RWExport RWDlistIterator : public RWSlistIterator {
- public:
- // constructor: start with iterator positioned at last link
- RWDlistIterator(RWDlist& s);
-
- /****************** Special RWDlistIterator functions ************************/
- void* insertAfterPoint(void*); // Insert item behind iterator.
- void operator--(); // Move iterator back one link.
- void operator-=(int n); // Move iterator back n links.
- void* remove(); // Remove current item
- void* removeNext(RWtestGeneric, const void*);
- void* removeNextReference(const void*);
- };
-
-
- /****************** RWDlistIterator inlines **************************/
-
- // constructor: start with iterator positioned at last link
- Inline
- RWDlistIterator::RWDlistIterator(RWDlist& s) : RWSlistIterator(s) { }
-
- pragma pop_align_members();
- #endif /* __RWDLIST_H__ */
-