home *** CD-ROM | disk | FTP | other *** search
- #ifndef __RWTSTACK_H__
- #define __RWTSTACK_H__
- pragma push_align_members(64);
-
- /*
- * Parameterized stack of T's, implemented using class C.
- *
- * $Header: E:/vcs/rw/tstack.h_v 1.2 15 Mar 1992 12:47:32 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.
- *
- ***************************************************************************
- *
- * WARNING: This class is very slow when used with singly-linked lists
- * because they use an inefficient implementation for removeLast().
- *
- ***************************************************************************
- *
- * $Log: E:/vcs/rw/tstack.h_v $
- *
- * Rev 1.2 15 Mar 1992 12:47:32 KEFFER
- *
- * Rev 1.0 02 Mar 1992 16:10:52 KEFFER
- * Initial revision.
- */
-
- //$DECLARE_TEMPLATE
-
- #ifndef __RWDEFS_H__
- # include "rw/defs.h"
- #endif
-
- template <class T, class C> class RWExport RWTStack : private C {
-
- public:
-
- RWTStack() { }
-
- C::clear;
- C::entries;
- C::isEmpty;
- void push(T a) {C::append(a);}
- T pop() {return C::removeLast();}
- T top() const {return C::last();}
- };
-
- pragma pop_align_members();
- #endif /* __RWTSTACK_H__ */
-