home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWSTACKCOL_H__
- #define __RWSTACKCOL_H__
- pragma push_align_members(64);
-
- /*
- * Declarations for a Stack of RWCollectables, implemented as a Singly-linked list.
- *
- * $Header: E:/vcs/rw/stackcol.h_v 1.3 04 Mar 1992 09:04:48 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/stackcol.h_v $
- *
- * Rev 1.3 04 Mar 1992 09:04:48 KEFFER
- * nil changed to rwnil
- *
- * Rev 1.2 18 Feb 1992 09:54:48 KEFFER
- *
- * Rev 1.1 28 Oct 1991 09:08:24 keffer
- * Changed inclusions to <rw/xxx.h>
- *
- * Rev 1.0 28 Jul 1991 08:17:26 keffer
- * Tools.h++ V4.0.5 PVCS baseline version
- *
- */
-
- /*
- * Restricted interface to class RWSlistCollectables to implement a
- * last in first out (LIFO) stack.
- */
-
- #include "rw/slistcol.h"
-
- class RWExport RWSlistCollectablesStack : public RWSlistCollectables {
- public:
- RWSlistCollectablesStack();
- RWSlistCollectablesStack(RWCollectable* a) : RWSlistCollectables(a) { }
-
- /************* Virtual functions inherited from RWSlistCollectables ***********/
- //virtual void apply(RWapplyCollectable ap, void* x)
- //virtual void clear();
- //virtual void clearAndDestroy();
- //virtual RWBoolean contains(const RWCollectable* a) const;
- //RWBoolean containsReference(const RWCollectable* a) const'
- //virtual unsigned entries() const;
- //virtual RWCollectable* first() const // Same as top()
- //virtual RWCollectable* get() // Same as pop()
- virtual RWCollectable* insert(RWCollectable* a) // Same as push()
- { return prepend(a); }
- virtual ClassID isA() const {return __RWSLISTCOLLECTABLESSTACK;}
- //virtual RWBoolean isEmpty() const
- //virtual RWCollectable* last() const // Return value at bottom of stack
- virtual RWCollectable* newSpecies() const;
- //virtual unsigned occurrencesOf(const RWCollectable* a) const
- //unsigned occurrencesOfReference(const RWCollectable* a) const
- //virtual RWCollectable* prepend(RWCollectable*);
- virtual void restoreGuts(RWvistream&);
- virtual void restoreGuts(RWFile&);
- virtual RWCollectable* remove(const RWCollectable*) // Treated as pop(); argument ignored
- {return RWSlistCollectables::get();}
-
- /********************* Special functions **************************/
- void push(RWCollectable* a) {RWSlistCollectables::prepend(a);}
- RWCollectable* pop() {return RWSlistCollectables::get();}
- RWCollectable* top() const {return RWSlistCollectables::first();}
-
- private:
- /******************** Disallowed functions ************************/
- virtual RWCollectable* append(RWCollectable*) {return rwnil;}
- virtual RWCollectable*& at(int i) {return RWSlistCollectables::at(i);}
- #ifdef CONST_OVERLOADS
- virtual const RWCollectable* at(int) const {return rwnil;}
- #endif
- virtual RWCollectable* find(const RWCollectable*) const {return rwnil;}
- RWCollectable* findReference(const RWCollectable*) const {return rwnil;}
- virtual int index(const RWCollectable*) const {return -1;}
- RWCollectable* removeReference(const RWCollectable*) {return rwnil;}
- virtual void removeAndDestroy(const RWCollectable*) { }
- };
-
- pragma pop_align_members();
- #endif /* __RWSTACKCOL_H__ */
-