00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _LLH_
00014 #define _LLH_
00015
00016 #ifndef NULL
00017 #define NULL ((void *)0)
00018 #endif
00019
00020 template <class Type> class List;
00021
00022
00023 template <class Type>
00024 class LL {
00025 public:
00026
00027
00028 LL(Type *d=(Type *) NULL, LL<Type> *n=(LL<Type> *) NULL, LL<Type> *p=(LL<Type> *)NULL);
00029 LL(LL<Type> &ll) : datamem((Type *)NULL), prevmem((LL<Type> *)NULL), nextmem((LL<Type> *)NULL)
00030 { *this = ll; }
00031
00032 ~LL();
00033
00034
00035
00036 LL<Type> &operator=(const LL<Type> &ll);
00037
00038
00039 int operator!=(const LL<Type> &ll) const { return !(*this == ll); }
00040 int operator==(const LL<Type> &ll) const;
00041
00042
00043 Type *operator[](int num) const;
00044
00045
00046 LL<Type> *operator[](const Type *d);
00047
00048
00049 void DeleteData();
00050 Type *Remove();
00051
00052 private:
00053
00054 Type *datamem;
00055 LL<Type> *prevmem;
00056 LL<Type> *nextmem;
00057
00058 friend class List<Type>;
00059 };
00060
00061
00062 #endif