|
Last change
on this file since 21385 was 8003, checked in by bird, 24 years ago |
|
New kFile* classes; now in sync with os2tools.
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /* $Id: kLIFO.h,v 1.2 2002-02-24 02:47:27 bird Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Simple LIFO template class.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1998-1999 knut st. osmundsen
|
|---|
| 6 | *
|
|---|
| 7 | */
|
|---|
| 8 | #ifndef _kLIFO_h_
|
|---|
| 9 | #define _kLIFO_h_
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Simple LIFO template class.
|
|---|
| 13 | * Node class must implement:
|
|---|
| 14 | * kEntry *getNext();
|
|---|
| 15 | * void setNext(kEntry*);
|
|---|
| 16 | * BOOL operator ==(const char *psz) const;
|
|---|
| 17 | * @author knut st. osmundsen
|
|---|
| 18 | */
|
|---|
| 19 | template <class kEntry>
|
|---|
| 20 | class kLIFO
|
|---|
| 21 | {
|
|---|
| 22 | protected:
|
|---|
| 23 | kEntry *pTop;
|
|---|
| 24 |
|
|---|
| 25 | public:
|
|---|
| 26 | kLIFO(void);
|
|---|
| 27 | virtual ~kLIFO(void);
|
|---|
| 28 |
|
|---|
| 29 | void destroy(void);
|
|---|
| 30 | virtual void push(kEntry *pNewEntry);
|
|---|
| 31 | virtual kEntry *pop(void);
|
|---|
| 32 | virtual kEntry *get(const kEntry *pGetEntry);
|
|---|
| 33 | virtual void unwind(kEntry *pToEntry);
|
|---|
| 34 | virtual void popPush(const kEntry *pToEntry, kLIFO<kEntry> &lifoTo);
|
|---|
| 35 | KBOOL isEmpty(void) const;
|
|---|
| 36 |
|
|---|
| 37 | virtual kEntry *find(const char *pszKey) const;
|
|---|
| 38 | virtual KBOOL exists(const kEntry *pEntry) const;
|
|---|
| 39 | };
|
|---|
| 40 |
|
|---|
| 41 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.