home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWDLISTCOL_H__
- #define __RWDLISTCOL_H__
- pragma push_align_members(64);
-
- /*
- * Declarations for Doubly-linked list of RWCollectables.
- *
- * $Header: E:/vcs/rw/dlistcol.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/dlistcol.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:36 keffer
- * Tools.h++ V4.0.5 PVCS baseline version
- *
- */
-
- #include "rw/dlist.h"
- #include "rw/seqcltn.h"
- #include "rw/iterator.h"
-
- class RWExport RWDlistCollectables : public RWSequenceable, public RWDlist {
- friend class RWExport RWDlistCollectablesIterator;
- public:
- RWDlistCollectables();
- RWDlistCollectables(RWCollectable* a) : RWDlist(a) { }
- ~RWDlistCollectables();
-
- RWBoolean operator==(const RWDlistCollectables&) const;
-
- /*************** Virtual function inherited from RWSequenceable *****************/
- virtual RWCollectable* append(RWCollectable* a) // Add at tail of list.
- {return (RWCollectable*)RWDlist::append(a);}
- virtual void apply(RWapplyCollectable ap, void* x)
- { RWDlist::apply((RWapplyGeneric)ap, x); }
- virtual RWCollectable*& at(int i)
- { return (RWCollectable*&)RWDlist::at(i); }
- #ifdef CONST_OVERLOADS
- virtual const RWCollectable* at(int i) const
- { return (const RWCollectable*)RWDlist::at(i); }
- #endif
- virtual void clear()
- { RWDlist::clear(); }
- //virtual void clearAndDestroy();
- virtual RWBoolean contains(const RWCollectable* a) const
- {return RWCollection::contains(a);}
- virtual unsigned entries() const
- {return RWDlist::entries();}
- virtual RWCollectable* find(const RWCollectable* a) const
- { return (RWCollectable*)RWDlist::find(rwIsEqualFun, a); }
- virtual RWCollectable* first() const // Return value at head of list.
- {return (RWCollectable*) RWDlist::first();}
- virtual int index(const RWCollectable* a) const
- { return RWDlist::index(rwIsEqualFun, a); }
- virtual RWCollectable* insert(RWCollectable* a)
- { return (RWCollectable*)RWDlist::insert(a); }
- virtual RWCollectable* insertAfter(int i, RWCollectable* a)
- { return (RWCollectable*)RWDlist::insertAfter(i,a); }
- virtual ClassID isA() const
- {return __RWDLISTCOLLECTABLES;}
- virtual RWBoolean isEmpty() const
- {return RWDlist::isEmpty();}
- virtual RWCollectable* last() const // Return value at tail of list.
- {return (RWCollectable*) RWDlist::last();}
- virtual RWCollectable* newSpecies() const;
- virtual unsigned occurrencesOf(const RWCollectable* a) const
- { return RWDlist::occurrencesOf(rwIsEqualFun, a); }
- virtual RWCollectable* prepend(RWCollectable* a)
- { return (RWCollectable*)RWDlist::prepend(a);}
- virtual RWCollectable* remove(const RWCollectable* a)
- { return (RWCollectable*)RWDlist::remove(rwIsEqualFun, a); }
- //void removeAndDestroy(const RWCollectable* a);
-
- /**************** (Redefined) Special Functions *****************/
- RWBoolean containsReference(const RWCollectable* a) const
- { return RWDlist::containsReference(a); }
- RWCollectable* findReference(const RWCollectable* a) const
- { return (RWCollectable*)RWDlist::findReference(a); }
- RWCollectable* get() // Return value and delete link at head of list.
- {return (RWCollectable*) RWDlist::get();}
- unsigned occurrencesOfReference(const RWCollectable* a) const
- { return RWDlist::occurrencesOfReference(a); }
- RWCollectable* removeReference(const RWCollectable* a)
- { return (RWCollectable*)RWDlist::removeReference(a); }
- /*****************************************************************/
- };
-
- /*
- * Iterator for doubly-linked list (moves iterator through the list);
- * starts by pointing at last link.
- */
- class RWExport RWDlistCollectablesIterator : public RWIterator, public RWDlistIterator {
- public:
- RWDlistCollectablesIterator(RWDlistCollectables& s);
-
- /****************** (Redefined) Standard Iterator functions *********************/
- virtual RWCollectable* findNext(const RWCollectable* a)
- { return (RWCollectable*)RWDlistIterator::findNext(rwIsEqualFun, a); }
- virtual RWCollectable* key() const // Return current item
- { return (RWCollectable*)RWDlistIterator::key(); }
- virtual RWCollectable* operator()() // Advance iterator
- { return (RWCollectable*)RWDlistIterator::operator()(); }
- virtual void reset()
- { RWDlistIterator::reset(); }
-
- /***************** (Redefined) Special RWDlistIterator functions ********************/
-
- RWCollectable* findNextReference(const RWCollectable* a)
- { return (RWCollectable*)RWDlistIterator::findNextReference(a); }
- RWCollectable* insertAfterPoint(RWCollectable* a) // Insert item behind iterator.
- { return (RWCollectable*)RWDlistIterator::insertAfterPoint(a); }
- RWCollectable* remove() // Remove current item
- { return (RWCollectable*)RWDlistIterator::remove(); }
- RWCollectable* removeNext(const RWCollectable* a)
- { return (RWCollectable*)RWDlistIterator::removeNext(rwIsEqualFun, a); }
- RWCollectable* removeNextReference(const RWCollectable* a)
- { return (RWCollectable*)RWDlistIterator::removeNextReference(a); }
- /*****************************************************************/
- };
-
- pragma pop_align_members();
- #endif /* __RWDLISTCOL_H__ */
-