// Copyright (c) 1994 James Clark // See the file COPYING for copying permission. #ifndef HashTable_DEF_INCLUDED #define HashTable_DEF_INCLUDED 1 #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif template void HashTable::insert(const K &key, const V &value, Boolean replace) { HashTableItem *newItem = new HashTableItem(key, value); HashTableItem *tem = (HashTableItem *)table_.insert(newItem); if (tem) { delete newItem; if (replace) { tem->key = key; tem->value = value; } } } template HashTableItem::HashTableItem(const K &k, const V &v) : HashTableItemBase(k), value(v) { } template HashTableItemBase *HashTableItem::copy() const { return new HashTableItem(*this); } #ifdef SP_NAMESPACE } #endif #endif /* not HashTable_DEF_INCLUDED */