Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / nsgmls / OwnerTable.h
1 /* $XConsortium: OwnerTable.h /main/2 1996/08/13 10:09:13 mgreess $ */
2 // Copyright (c) 1994 James Clark
3 // See the file COPYING for copying permission.
4
5 #ifndef OwnerTable_INCLUDED
6 #define OwnerTable_INCLUDED 1
7
8 #include "PointerTable.h"
9
10 #ifdef SP_NAMESPACE
11 namespace SP_NAMESPACE {
12 #endif
13
14 template<class T, class K, class HF, class KF>
15 class OwnerTable : public PointerTable<T *, K, HF, KF> {
16 public:
17   OwnerTable() { }
18   ~OwnerTable();
19   void clear();
20   void swap(OwnerTable<T, K, HF, KF> &x) {
21     PointerTable<T *, K, HF, KF>::swap(x);
22   }
23 private:
24   OwnerTable(const OwnerTable<T, K, HF, KF> &) {}
25   void operator=(const OwnerTable<T, K, HF, KF> &) {}
26 };
27
28 template<class T, class K, class HF, class KF>
29 class OwnerTableIter : public PointerTableIter<T *, K, HF, KF> {
30 public:
31   OwnerTableIter(const OwnerTable<T, K, HF, KF> &table)
32     : PointerTableIter<T *, K, HF, KF>(table) { }
33 };
34
35 template<class T, class K, class HF, class KF>
36 class CopyOwnerTable : public OwnerTable<T, K, HF, KF> {
37 public:
38   CopyOwnerTable() { }
39   CopyOwnerTable(const CopyOwnerTable<T, K, HF, KF> &tab) { *this = tab; }
40   void operator=(const CopyOwnerTable<T, K, HF, KF> &tab);
41 };
42
43 #ifdef SP_NAMESPACE
44 }
45 #endif
46
47 #endif /* not OwnerTable_INCLUDED */
48
49 #ifdef SP_DEFINE_TEMPLATES
50 #include "OwnerTable.C"
51 #endif