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

#include <unordered_list_map.h>

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

Data Structures

class  iter_rep
 

Public Member Functions

 UnorderedListMap ()
 Creates an empty map.
 
int size () const
 Returns the number of entries in the map.
 
const_iterator begin () const
 Returns iterator to first entry.
 
const_iterator end () const
 Returns iterator representing the end.
 
const_iterator find (const Key &k) const
 Returns a iterator to the entry with a given key, or end() if no such entry exists.
 
const_iterator put (const Key &k, const Value &v)
 
const_iterator erase (const_iterator loc)
 Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order.
 
bool erase (const Key &k)
 
virtual const_iterator erase (const_iterator loc)=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
 

Additional Inherited Members

- 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)
 

Constructor & Destructor Documentation

◆ UnorderedListMap()

template<typename Key , typename Value >
dsac::map::UnorderedListMap< Key, Value >::UnorderedListMap ( )
inline

Creates an empty map.

Member Function Documentation

◆ begin()

template<typename Key , typename Value >
const_iterator dsac::map::UnorderedListMap< Key, Value >::begin ( ) const
inlinevirtual

Returns iterator to first entry.

Implements dsac::map::AbstractMap< Key, Value >.

◆ end()

template<typename Key , typename Value >
const_iterator dsac::map::UnorderedListMap< Key, Value >::end ( ) const
inlinevirtual

Returns iterator representing the end.

Implements dsac::map::AbstractMap< Key, Value >.

◆ erase() [1/3]

template<typename Key , typename Value >
bool dsac::map::AbstractMap< Key, Value >::erase ( const Key &  k)
inline

Erases entry with given key (if one exists) Returns true if an entry was removed, false otherwise

◆ erase() [2/3]

template<typename Key , typename Value >
const_iterator dsac::map::UnorderedListMap< Key, Value >::erase ( const_iterator  loc)
inlinevirtual

Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order.

Implements dsac::map::AbstractMap< Key, Value >.

◆ erase() [3/3]

template<typename Key , typename Value >
virtual const_iterator dsac::map::AbstractMap< Key, Value >::erase ( const_iterator  loc)
virtual

◆ find()

template<typename Key , typename Value >
const_iterator dsac::map::UnorderedListMap< Key, Value >::find ( const Key &  k) const
inlinevirtual

Returns a iterator to the entry with a given key, or end() if no such entry exists.

Implements dsac::map::AbstractMap< Key, Value >.

◆ put()

template<typename Key , typename Value >
const_iterator dsac::map::UnorderedListMap< Key, Value >::put ( const Key &  k,
const Value &  v 
)
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 >.

Here is the call graph for this function:

◆ size()

template<typename Key , typename Value >
int dsac::map::UnorderedListMap< Key, Value >::size ( ) const
inlinevirtual

Returns the number of entries in the map.

Implements dsac::map::AbstractMap< Key, Value >.


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