| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | #ifndef _pllist_h |
|---|
| 10 | #define _pllist_h |
|---|
| 11 | |
|---|
| 12 | #define PLLIST_H_CVSID "$Id: pllist.h,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $" |
|---|
| 13 | |
|---|
| 14 | #include "llist.h" |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | template <class T> |
|---|
| 23 | class PLList : public LList |
|---|
| 24 | { |
|---|
| 25 | public: |
|---|
| 26 | PLList(void) : LList(){} |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | int push(const T data) { return LList::push((void *)data); } |
|---|
| 30 | T pop(void) { return (T)LList::pop(); } |
|---|
| 31 | |
|---|
| 32 | int enqueue(const T data) { return LList::enqueue((void *)data); } |
|---|
| 33 | T dequeue(void) { return (T)LList::dequeue(); } |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | int putontop(const T data) { return LList::putontop((void *)data); } |
|---|
| 42 | void remove(const T data) { LList::remove((void *)data); } |
|---|
| 43 | T findn(int n) { return (T)LList::findn(n); } |
|---|
| 44 | T operator[](int n) { return findn(n); } |
|---|
| 45 | int index(const T data) { return LList::index((void *)data); } |
|---|
| 46 | |
|---|
| 47 | T findc(int which = 0) { return (T)LList::findc(which); } |
|---|
| 48 | }; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | template <class T, class K> |
|---|
| 58 | class PSLList : public LList |
|---|
| 59 | { |
|---|
| 60 | public: |
|---|
| 61 | PSLList(void) : LList(){} |
|---|
| 62 | PSLList(int(*cmp_fun)(T data, K key)) : LList(cmp_fun){} |
|---|
| 63 | |
|---|
| 64 | int push(const T data) { return LList::push((void *)data); } |
|---|
| 65 | T pop(void) { return (T)LList::pop(); } |
|---|
| 66 | |
|---|
| 67 | int enqueue(const T data) { return LList::enqueue((void *)data); } |
|---|
| 68 | T dequeue(void) { return (T)LList::dequeue(); } |
|---|
| 69 | |
|---|
| 70 | int insert(const T data, const K key) |
|---|
| 71 | { return LList::insert((void *)data, (void *)key); } |
|---|
| 72 | T find(const K key) { return (T)LList::find((void *)key); } |
|---|
| 73 | T removematch(const K key) |
|---|
| 74 | { return (T)LList::removematch((void *)key); } |
|---|
| 75 | |
|---|
| 76 | int putontop(const T data) { return LList::putontop((void *)data); } |
|---|
| 77 | void remove(const T data) { LList::remove((void *)data); } |
|---|
| 78 | T findn(int n) { return (T)LList::findn(n); } |
|---|
| 79 | T operator[](int n) { return findn(n); } |
|---|
| 80 | int index(const T data) { return LList::index((void *)data); } |
|---|
| 81 | |
|---|
| 82 | T findc(int which = 0) { return (T)LList::findc(which); } |
|---|
| 83 | }; |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | #endif |
|---|