xref: /onnv-gate/usr/src/cmd/man/src/util/nsgmls.src/include/IList.h (revision 0:68f95e015346)
1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
3 #pragma ident	"%Z%%M%	%I%	%E% SMI"
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:
IList()21   IList() { }
IList(T * p)22   IList(T *p) : IListBase(p) { }
~IList()23   ~IList() { clear(); }
append(T * p)24   void append(T *p) { IListBase::append(p); }
insert(T * p)25   void insert(T *p) { IListBase::insert(p); }
remove(T * p)26   void remove(T *p) { IListBase::remove(p); }
swap(IList<T> & list)27   void swap(IList<T> &list) { IListBase::swap(list); }
head()28   T *head() const { return (T *)IListBase::head(); }
get()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> &);	// undefined
35   IList<T> &operator=(const IList<T> &); // undefined
36 };
37 
38 #ifdef SP_NAMESPACE
39 }
40 #endif
41 
42 #endif /* not IList_INCLUDED */
43