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 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: OwnerTable()17 OwnerTable() { } 18 ~OwnerTable(); 19 void clear(); swap(OwnerTable<T,K,HF,KF> & x)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: OwnerTableIter(const OwnerTable<T,K,HF,KF> & table)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: CopyOwnerTable()38 CopyOwnerTable() { } CopyOwnerTable(const CopyOwnerTable<T,K,HF,KF> & tab)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.cxx" 51 #endif 52