diff options
Diffstat (limited to 'utils/HashTable.h')
-rw-r--r-- | utils/HashTable.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/utils/HashTable.h b/utils/HashTable.h index 5a0ab29..92a70ce 100644 --- a/utils/HashTable.h +++ b/utils/HashTable.h @@ -3,7 +3,7 @@ * * by Stephane Chatty * - * Copyright 1991-1995 + * Copyright 1991-1996 * Laboratoire de Recherche en Informatique (LRI) * Centre d'Etudes de la Navigation Aerienne (CENA) * @@ -181,8 +181,7 @@ inline operator ITEM* () { return (ITEM*) (CcuHashCellRef::operator CcuHashIte template <class ITEM> class CcuHashTableOf : public CcuHashTable { public: -inline CcuHashTableOf (unsigned int size, HASH_F hash = 0, HCP_F cp = 0, HDEL_F del = 0, HCMP_F cmp= 0) - : CcuHashTable (size, hash, cp, del, cmp) {} +inline CcuHashTableOf (unsigned int size, HASH_F hash = 0, HCP_F cp = 0, HDEL_F del = 0, HCMP_F cmp= 0) : CcuHashTable (size, hash, cp, del, cmp) {} inline ~CcuHashTableOf () {} inline CcuHashCellOf<ITEM>* Add (const void* key, int* found = 0) { return (CcuHashCellOf<ITEM>*) CcuHashTable::Add (key, found); } inline CcuHashCellOf<ITEM>* Get (const void* key) { return (CcuHashCellOf<ITEM>*) CcuHashTable::Get (key); } @@ -210,6 +209,17 @@ inline CcuHashIterOf<ITEM>& operator ++ () { return (CcuHashIterOf<ITEM>&)(this- inline ITEM* operator * () const { return (ITEM*) (CcuHashIter::operator * ()); } }; +template <class ITEM> class CcuHashCellIterOf : public CcuHashCellIter { +public: +inline CcuHashCellIterOf (const CcuHashTableOf<ITEM>& t) : CcuHashCellIter (t) { } +inline ~CcuHashCellIterOf () {} +inline CcuHashCellIterOf<ITEM>& operator ++ () { return (CcuHashCellIterOf<ITEM>&)(this->CcuHashCellIter::operator ++ ()); } +#ifndef CPLUS_BUG16 +inline CcuHashCellIterOf<ITEM> operator ++ (int i) { return *(CcuHashCellIterOf<ITEM>*)&(this->CcuHashCellIter::operator ++ (i)); } +#endif +inline CcuHashCellOf<ITEM>* operator * () const { return (CcuHashCellOf<ITEM>*) (CcuHashCellIter::operator * ()); } +}; + #endif /* CPLUS_BUG19 */ #endif /* HashTable_H_ */ |