Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
#include <abstract_hash_map.h>
Public Member Functions | |
int | size () const |
Returns the number of entries in the map. | |
const_iterator | find (const Key &k) const |
Returns a const_iterator to the entry with a given key, or end() if no such entry exists. | |
const_iterator | erase (const_iterator loc) |
Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order. | |
const_iterator | put (const Key &k, const Value &v) |
virtual const_iterator | begin () const=0 |
virtual const_iterator | end () const=0 |
![]() | |
bool | empty () const |
Returns true if the map is empty, false otherwise. | |
bool | contains (const Key &k) const |
Returns true if the map contains an entry with the given key. | |
const Value & | at (const Key &k) const |
bool | erase (const Key &k) |
virtual | ~AbstractMap () |
virtual int | size () const =0 |
virtual const_iterator | begin () const =0 |
virtual const_iterator | end () const =0 |
virtual const_iterator | find (const Key &k) const =0 |
virtual const_iterator | put (const Key &k, const Value &v)=0 |
virtual const_iterator | erase (const_iterator loc)=0 |
Protected Types | |
typedef AbstractMap< Key, Value > | Base |
Protected Member Functions | |
int | get_hash (const Key &k) const |
void | resize (int new_table_size) |
virtual void | create_table ()=0 |
virtual const_iterator | bucket_find (int h, const Key &k) const =0 |
virtual const_iterator | bucket_put (int h, const Key &k, const Value &v)=0 |
virtual const_iterator | bucket_erase (int h, const_iterator loc)=0 |
![]() | |
abstract_iter_rep * | get_rep (const_iterator iter) const |
void | update_value (const Entry &e, const Value &v) |
Protected Attributes | |
Hash | hash |
int | sz {0} |
int | table_sz {17} |
|
protected |
|
virtual |
Implements dsac::map::AbstractMap< Key, Value >.
Reimplemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
protectedpure virtual |
Implemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
protectedpure virtual |
Implemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
protectedpure virtual |
Implemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
protectedpure virtual |
Implemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
virtual |
Implements dsac::map::AbstractMap< Key, Value >.
Reimplemented in dsac::map::ChainHashMap< Key, Value, Hash >, and dsac::map::ProbeHashMap< Key, Value, Hash >.
|
inlinevirtual |
Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order.
Implements dsac::map::AbstractMap< Key, Value >.
|
inlinevirtual |
Returns a const_iterator to the entry with a given key, or end() if no such entry exists.
Implements dsac::map::AbstractMap< Key, Value >.
|
inlineprotected |
|
inlinevirtual |
Associates given key with given value. If key already exists previous value is overwritten. Returns an iterator to the entry associated with the key
Implements dsac::map::AbstractMap< Key, Value >.
|
inlineprotected |
|
inlinevirtual |
Returns the number of entries in the map.
Implements dsac::map::AbstractMap< Key, Value >.
|
protected |
|
protected |
|
protected |