#ifndef HASHMAP_H #define HASHMAP_H #include #include #include #define NUM_BUCKETS 10 class HashMap { public: bool empty() const; size_t size() const; /** * Find a key, and return the value for it, or NULL if the key does * not exist. */ const int* find( const std::string& key ) const; /** * Inserts a new value, only if that key does not already exist. */ void insert( const std::string& key, int value ); typedef std::pair keyvalue_type; typedef std::list< keyvalue_type > bucket_type; private: bucket_type buckets_[NUM_BUCKETS]; }; #endif