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