diff options
author | chatty | 1996-10-04 09:20:40 +0000 |
---|---|---|
committer | chatty | 1996-10-04 09:20:40 +0000 |
commit | 970610ca262632089e28c2dca33ff61eb1e5f749 (patch) | |
tree | 3537e9f748ee9d1f24b64397b50bcfd449e86e70 | |
parent | 37a62506f296b8cb967a44a77d18439c0e32ffbd (diff) | |
download | ivy-league-970610ca262632089e28c2dca33ff61eb1e5f749.zip ivy-league-970610ca262632089e28c2dca33ff61eb1e5f749.tar.gz ivy-league-970610ca262632089e28c2dca33ff61eb1e5f749.tar.bz2 ivy-league-970610ca262632089e28c2dca33ff61eb1e5f749.tar.xz |
Added CcuHashCellIterOf
-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_ */ |