text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

HashMap.h

Go to the documentation of this file.
00001 
00018 #include <vector>
00019 #include <map>
00020 
00021 using namespace std;
00022 
00023 template <typename Key, typename T, typename Hash>
00024 class HashMap : private vector<map<Key, T> >
00025 {
00026 public:
00027 
00032    HashMap(const int maxBuckets);
00033 
00037    T& operator[](Key& key);
00038 
00045    map<Key, T>::const_iterator findItem(const Key& key);
00046 
00052    void insert(const Key& key, const T& item);
00053 
00059    int erase(const Key& k);
00060 
00062    Hash hash;
00063 }; // end HashMap
00064 
00065 #include "HashMap.cpp"
00066 // End of header file

Generated on Sun Aug 27 22:18:13 2006 for AWLogo by  doxygen 1.4.6