1 // Copyright (c) 1994 James Clark 2 // See the file COPYING for copying permission. 3 4 #ifndef IList_INCLUDED 5 #define IList_INCLUDED 1 6 7 #include "IListBase.h" 8 9 #ifdef SP_NAMESPACE 10 namespace SP_NAMESPACE { 11 #endif 12 13 template<class T> class IListIter; 14 15 // This owns the objects that are put in it. 16 17 template<class T> 18 class IList : private IListBase { 19 public: IList()20 IList() { } IList(T * p)21 IList(T *p) : IListBase(p) { } ~IList()22 ~IList() { clear(); } append(T * p)23 void append(T *p) { IListBase::append(p); } insert(T * p)24 void insert(T *p) { IListBase::insert(p); } remove(T * p)25 void remove(T *p) { IListBase::remove(p); } swap(IList<T> & list)26 void swap(IList<T> &list) { IListBase::swap(list); } head()27 T *head() const { return (T *)IListBase::head(); } get()28 T *get() { return (T *)IListBase::get(); } 29 using IListBase::clear; 30 using IListBase::empty; 31 friend class IListIter<T>; 32 private: 33 IList(const IList<T> &); // undefined 34 IList<T> &operator=(const IList<T> &); // undefined 35 }; 36 37 #ifdef SP_NAMESPACE 38 } 39 #endif 40 41 #endif /* not IList_INCLUDED */ 42