Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
dsac::map::ProbeHashMap< Key, Value, Hash > Class Template Reference

#include <probe_hash_map.h>

Inheritance diagram for dsac::map::ProbeHashMap< Key, Value, Hash >:
Inheritance graph
Collaboration diagram for dsac::map::ProbeHashMap< Key, Value, Hash >:
Collaboration graph

Data Structures

class  iter_rep
 

Public Member Functions

 ProbeHashMap ()
 Creates an empty map.
 
const_iterator begin () const
 
const_iterator end () const
 
- Public Member Functions inherited from dsac::map::AbstractHashMap< Key, Value, Hash >
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
 
- Public Member Functions inherited from dsac::map::AbstractMap< Key, Value >
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 AbstractHashMap< Key, Value, Hash > Base
 
- Protected Types inherited from dsac::map::AbstractHashMap< Key, Value, Hash >
typedef AbstractMap< Key, Value > Base
 

Protected Member Functions

void create_table ()
 
int find_slot (int h, const Key &k) const
 
const_iterator bucket_find (int h, const Key &k) const
 
const_iterator bucket_put (int h, const Key &k, const Value &v)
 
const_iterator bucket_erase (int h, const_iterator loc)
 
- Protected Member Functions inherited from dsac::map::AbstractHashMap< Key, Value, Hash >
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
 
- Protected Member Functions inherited from dsac::map::AbstractMap< Key, Value >
abstract_iter_repget_rep (const_iterator iter) const
 
void update_value (const Entry &e, const Value &v)
 

Protected Attributes

std::vector< Entrytable
 
std::vector< bool > open
 
std::vector< bool > defunct
 
friend iter_rep
 
int table_sz
 
int sz
 
- Protected Attributes inherited from dsac::map::AbstractHashMap< Key, Value, Hash >
Hash hash
 
int sz {0}
 
int table_sz {17}
 

Member Typedef Documentation

◆ Base

template<typename Key , typename Value , typename Hash = std::hash<Key>>
typedef AbstractHashMap<Key, Value, Hash> dsac::map::ProbeHashMap< Key, Value, Hash >::Base
protected

Constructor & Destructor Documentation

◆ ProbeHashMap()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
dsac::map::ProbeHashMap< Key, Value, Hash >::ProbeHashMap ( )
inline

Creates an empty map.

Here is the call graph for this function:

Member Function Documentation

◆ begin()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
const_iterator dsac::map::ProbeHashMap< Key, Value, Hash >::begin ( ) const
inlinevirtual

Reimplemented from dsac::map::AbstractHashMap< Key, Value, Hash >.

Here is the call graph for this function:

◆ bucket_erase()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
const_iterator dsac::map::ProbeHashMap< Key, Value, Hash >::bucket_erase ( int  h,
const_iterator  loc 
)
inlineprotectedvirtual

Implements dsac::map::AbstractHashMap< Key, Value, Hash >.

Here is the call graph for this function:

◆ bucket_find()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
const_iterator dsac::map::ProbeHashMap< Key, Value, Hash >::bucket_find ( int  h,
const Key &  k 
) const
inlineprotectedvirtual

Implements dsac::map::AbstractHashMap< Key, Value, Hash >.

Here is the call graph for this function:

◆ bucket_put()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
const_iterator dsac::map::ProbeHashMap< Key, Value, Hash >::bucket_put ( int  h,
const Key &  k,
const Value &  v 
)
inlineprotectedvirtual

Implements dsac::map::AbstractHashMap< Key, Value, Hash >.

Here is the call graph for this function:

◆ create_table()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
void dsac::map::ProbeHashMap< Key, Value, Hash >::create_table ( )
inlineprotectedvirtual

◆ end()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
const_iterator dsac::map::ProbeHashMap< Key, Value, Hash >::end ( ) const
inlinevirtual

◆ find_slot()

template<typename Key , typename Value , typename Hash = std::hash<Key>>
int dsac::map::ProbeHashMap< Key, Value, Hash >::find_slot ( int  h,
const Key &  k 
) const
inlineprotected

Field Documentation

◆ defunct

template<typename Key , typename Value , typename Hash = std::hash<Key>>
std::vector<bool> dsac::map::ProbeHashMap< Key, Value, Hash >::defunct
protected

◆ iter_rep

template<typename Key , typename Value , typename Hash = std::hash<Key>>
friend dsac::map::ProbeHashMap< Key, Value, Hash >::iter_rep
protected

◆ open

template<typename Key , typename Value , typename Hash = std::hash<Key>>
std::vector<bool> dsac::map::ProbeHashMap< Key, Value, Hash >::open
protected

◆ sz

template<typename Key , typename Value , typename Hash = std::hash<Key>>
int dsac::map::AbstractHashMap< Key, Value, Hash >::sz
protected

◆ table

template<typename Key , typename Value , typename Hash = std::hash<Key>>
std::vector<Entry> dsac::map::ProbeHashMap< Key, Value, Hash >::table
protected

◆ table_sz

template<typename Key , typename Value , typename Hash = std::hash<Key>>
int dsac::map::AbstractHashMap< Key, Value, Hash >::table_sz
protected

The documentation for this class was generated from the following file: