TIVI-153: Add as dependency for iputils
[profile/ivi/opensp.git] / include / OwnerTable.h
1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
3
4 #ifndef OwnerTable_INCLUDED
5 #define OwnerTable_INCLUDED 1
6
7 #include "PointerTable.h"
8
9 #ifdef SP_NAMESPACE
10 namespace SP_NAMESPACE {
11 #endif
12
13 template<class T, class K, class HF, class KF>
14 class OwnerTable : public PointerTable<T *, K, HF, KF> {
15 public:
16   OwnerTable() { }
17   ~OwnerTable();
18   void clear();
19   void swap(OwnerTable<T, K, HF, KF> &x) {
20     PointerTable<T *, K, HF, KF>::swap(x);
21   }
22 private:
23   OwnerTable(const OwnerTable<T, K, HF, KF> &);
24   void operator=(const OwnerTable<T, K, HF, KF> &);
25 };
26
27 template<class T, class K, class HF, class KF>
28 class OwnerTableIter : public PointerTableIter<T *, K, HF, KF> {
29 public:
30   OwnerTableIter(const OwnerTable<T, K, HF, KF> &table)
31     : PointerTableIter<T *, K, HF, KF>(table) { }
32 };
33
34 template<class T, class K, class HF, class KF>
35 class CopyOwnerTable : public OwnerTable<T, K, HF, KF> {
36 public:
37   CopyOwnerTable() { }
38   CopyOwnerTable(const CopyOwnerTable<T, K, HF, KF> &tab) { *this = tab; }
39   void operator=(const CopyOwnerTable<T, K, HF, KF> &tab);
40 };
41
42 #ifdef SP_NAMESPACE
43 }
44 #endif
45
46 #endif /* not OwnerTable_INCLUDED */
47
48 #ifdef SP_DEFINE_TEMPLATES
49 #include "OwnerTable.cxx"
50 #endif