home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWGSTACK_H__
- #define __RWGSTACK_H__
- pragma push_align_members(64);
-
- /*
- * Declarations for a Generic Stack, implemented as a Singly-linked list.
- *
- * $Header: E:/vcs/rw/gstack.h_v 1.3 18 Feb 1992 19:23:02 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/gstack.h_v $
- *
- * Rev 1.3 18 Feb 1992 19:23:02 KEFFER
- * Now includes "rw/generic.h".
- * Class tag is now RWExport instead of huge.
- *
- * Rev 1.2 28 Oct 1991 09:08:16 keffer
- * Changed inclusions to <rw/xxx.h>
- *
- * Rev 1.1 09 Oct 1991 18:34:36 keffer
- * Ported to Zortech V3.0
- *
- * Rev 1.0 28 Jul 1991 08:11:22 keffer
- * Tools.h++ V4.0.5 PVCS baseline version
- *
- */
-
- #include "rw/slist.h"
- #include "rw/generic.h"
-
- #define GStack(type) name2(type,GStack)
-
- #ifdef NO_ACCESS_ADJUSTMENT
-
- #define GStackdeclare(type) \
- class RWExport GStack(type) : private RWSlist { \
- public: \
- GStack(type)() { } \
- GStack(type)(type* a) : RWSlist(a) { } \
- GStack(type)(const GStack(type)& q) : RWSlist(q) { } \
- void operator=(const GStack(type)& q) { RWSlist::operator=(q);} \
- \
- void push(type* a) {RWSlist::prepend(a);} \
- type* pop() {return (type*)RWSlist::get();} \
- type* top() const {return (type*)RWSlist::first();} \
- void clear() {RWSlist::clear();} \
- RWBoolean contains(RWBoolean (*t)(const type*, const void*), const void* a) const \
- {return RWSlist::contains((RWtestGeneric)t, a);} \
- RWBoolean containsReference(const type* a) const \
- {return RWSlist::containsReference(a);} \
- unsigned entries() const { return RWSlist::entries(); } \
- type* insert(type* a) {return (type*)RWSlist::insert(a);} \
- RWBoolean isEmpty() const { return RWSlist::isEmpty(); } \
- unsigned occurrencesOf(RWBoolean (*t)(const type*, const void*), const void* a) const \
- {return RWSlist::occurrencesOf((RWtestGeneric)t, a);} \
- unsigned occurrencesOfReference(const type* a) const \
- {return RWSlist::occurrencesOfReference(a);} \
- };
-
- #else
-
- #define GStackdeclare(type) \
- class RWExport GStack(type) : private RWSlist { \
- public: \
- GStack(type)() { } \
- GStack(type)(type* a) : RWSlist(a) { } \
- GStack(type)(const GStack(type)& q) : RWSlist(q) { } \
- void operator=(const GStack(type)& q) { RWSlist::operator=(q);} \
- \
- void push(type* a) {RWSlist::prepend(a);} \
- type* pop() {return (type*)RWSlist::get();} \
- type* top() const {return (type*)RWSlist::first();} \
- RWSlist::clear; \
- RWBoolean contains(RWBoolean (*t)(const type*, const void*), const void* a) const \
- {return RWSlist::contains((RWtestGeneric)t, a);} \
- RWBoolean containsReference(const type* a) const \
- {return RWSlist::containsReference(a);} \
- RWSlist::entries; \
- type* insert(type* a) {return (type*)RWSlist::insert(a);} \
- RWSlist::isEmpty; \
- unsigned occurrencesOf(RWBoolean (*t)(const type*, const void*), const void* a) const \
- {return RWSlist::occurrencesOf((RWtestGeneric)t, a);} \
- unsigned occurrencesOfReference(const type* a) const \
- {return RWSlist::occurrencesOfReference(a);} \
- };
-
- #endif /* NO_ACCESS_ADJUSTMENT */
-
- pragma pop_align_members();
- #endif /* __RWGSTACK_H__ */
-