home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
WmtRWTPtrDict.hxx
< prev
next >
Wrap
Text File
|
1996-05-31
|
2KB
|
56 lines
/*---------------------------------------------------------------------------
*
* (c) Westmount Technology 1994
*
* File: @(#)WmtRWTPtrDict.hxx 1.2
* Author: peku
* Description: pointer dictionary based on RogueWave library
*---------------------------------------------------------------------------
SccsId = @(#)WmtRWTPtrDict.hxx 1.2 03 Jun 1994 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 const * & 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 */