home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------------------
- *
- * (c) Westmount Technology 1994
- *
- * File: @(#)WmtRWTPtrDict.hxx /main/titanic/1
- * Author: peku
- * Description: pointer dictionary based on RogueWave library
- *---------------------------------------------------------------------------
- SccsId = @(#)WmtRWTPtrDict.hxx /main/titanic/1 25 Sep 1997 Copyright 1994 Westmount Technology */
-
- #ifndef WMTRWTPTRDICT_HXX
- #define WMTRWTPTRDICT_HXX
-
- #ifndef __RWTVHDICT_H__
- #include "rw/tvhdict.h"
- #endif
-
- typedef void* voidptr;
-
- template<class K, class V>
- #ifdef __GNUG__
- class WmtRWTPtrDict : public RWTValHashDictionary<K, voidptr> {
- #else
- class WmtRWTPtrDict : private RWTValHashDictionary<K, voidptr> {
- #endif
- public:
- WmtRWTPtrDict(unsigned (*hashKey)(const K&)) :
- RWTValHashDictionary<K, voidptr>(hashKey) {}
-
- RWBoolean doFindValue(const K& key, V * & retval) const
- { return RWTValHashDictionary<K, voidptr>::findValue(key, (voidptr&)retval); }
- void doInsertKeyAndValue(const K& key, V *val)
- { RWTValHashDictionary<K, voidptr>::insertKeyAndValue(key, val); }
- RWBoolean doRemove(const K& key)
- { return RWTValHashDictionary<K, voidptr>::remove(key); }
- void doClear()
- { RWTValHashDictionary<K, voidptr>::clear(); }
- };
-
- template <class K, class V>
- class WmtRWTPtrDictIterator : private RWTValHashDictionaryIterator<K, voidptr> {
- public:
- WmtRWTPtrDictIterator(const WmtRWTPtrDict<K, V>& c) :
- RWTValHashDictionaryIterator<K, voidptr>((RWTValHashDictionary<K, voidptr>&)c) {}
-
- K key() const
- { return (K)RWTValHashDictionaryIterator<K, voidptr>::key(); }
- V *value() const
- { return (V*)RWTValHashDictionaryIterator<K, voidptr>::value(); }
- RWBoolean operator++()
- { return RWTValHashDictionaryIterator<K, voidptr>::operator++(); }
- void reset() { RWTValHashDictionaryIterator<K, voidptr>::reset(); }
- };
-
- #endif /* WMTRWTPTRDICT_HXX */
-