map with hashing access More...
#include <hash_map.hh>
Public Types | |
typedef container_type::const_iterator | const_iterator |
const iterator type | |
typedef Data | data_type |
Data type. | |
typedef container_type::iterator | iterator |
iterator type | |
typedef Key | key_type |
Key type. | |
typedef std::pair< Key const, Data > | value_type |
Value type for cells. | |
Public Member Functions | |
iterator | begin () |
beginning of table | |
const_iterator | begin () const |
beginning of table | |
void | clear () |
Remove all elements. | |
bool | empty () const |
Emptyness test. | |
iterator | end () |
end of table | |
const_iterator | end () const |
end of table | |
void | erase (iterator const &first, iterator const &last) |
Remove range. | |
void | erase (iterator const &i) |
Remove element. | |
void | erase (key_arg key) |
remove element | |
iterator | find (key_arg key) |
Search for key. | |
const_iterator | find (key_arg key) const |
Search key. | |
std::pair< iterator, bool > | insert (value_arg val) |
Cell insertion. | |
size_t | max_size () const |
max element number | |
size_t | size () const |
element count | |
void | swap (hash_map &other) |
swapping function | |
Private Types | |
typedef hash_toolbox::table < key_type, value_type, select_1st< value_type >, Hash, Equal > | container_type |
typedef container_type::key_arg | key_arg |
typedef container_type::value_arg | value_arg |
Private Attributes | |
container_type | the_table |
map with hashing access
This is an unsorted map where keys are accessed using a hash function
Key | the key |
Data | The data associated to Key |
Hash | hashing functor fo Key |
Eqaul | equality functor for Key |
Definition at line 31 of file hash_map.hh.
typedef container_type::const_iterator utilmm::hash_map< Key, Data, Hash, Equal >::const_iterator |
const iterator type
const iterator type
The type used to iterate through this class without any modification
Definition at line 67 of file hash_map.hh.
typedef hash_toolbox::table<key_type, value_type, select_1st<value_type>, Hash, Equal> utilmm::hash_map< Key, Data, Hash, Equal >::container_type [private] |
Definition at line 51 of file hash_map.hh.
typedef Data utilmm::hash_map< Key, Data, Hash, Equal >::data_type |
Data type.
This is the type of the data asociated to the key
Definition at line 39 of file hash_map.hh.
typedef container_type::iterator utilmm::hash_map< Key, Data, Hash, Equal >::iterator |
iterator type
iterator type
The type used to iterate through and manipulate this class
Definition at line 62 of file hash_map.hh.
typedef container_type::key_arg utilmm::hash_map< Key, Data, Hash, Equal >::key_arg [private] |
Definition at line 53 of file hash_map.hh.
typedef Key utilmm::hash_map< Key, Data, Hash, Equal >::key_type |
Key type.
Definition at line 34 of file hash_map.hh.
typedef container_type::value_arg utilmm::hash_map< Key, Data, Hash, Equal >::value_arg [private] |
Definition at line 52 of file hash_map.hh.
typedef std::pair<Key const, Data> utilmm::hash_map< Key, Data, Hash, Equal >::value_type |
Value type for cells.
Value type for cells.
For hash_map
value_type
is a std::pair
containing the key and the associated data.
Definition at line 47 of file hash_map.hh.
iterator utilmm::hash_map< Key, Data, Hash, Equal >::begin | ( | ) | [inline] |
beginning of table
Beginning of table.
Definition at line 104 of file hash_map.hh.
const_iterator utilmm::hash_map< Key, Data, Hash, Equal >::begin | ( | ) | const [inline] |
beginning of table
Beginning of table.
Definition at line 118 of file hash_map.hh.
void utilmm::hash_map< Key, Data, Hash, Equal >::clear | ( | ) | [inline] |
Remove all elements.
remove all elements
This function is strictly equivelent to erase
(begin(), end())
Definition at line 197 of file hash_map.hh.
bool utilmm::hash_map< Key, Data, Hash, Equal >::empty | ( | ) | const [inline] |
Emptyness test.
Emptyness test.
true | if this instance has no element |
false | else |
Definition at line 96 of file hash_map.hh.
iterator utilmm::hash_map< Key, Data, Hash, Equal >::end | ( | ) | [inline] |
end of table
End of table.
Definition at line 111 of file hash_map.hh.
const_iterator utilmm::hash_map< Key, Data, Hash, Equal >::end | ( | ) | const [inline] |
end of table
End of table.
Definition at line 125 of file hash_map.hh.
void utilmm::hash_map< Key, Data, Hash, Equal >::erase | ( | iterator const & | first, |
iterator const & | last | ||
) | [inline] |
Remove range.
Remove elements.
first | an iterator |
last | an iterator |
removes all the element of the table in the range [first, last [
Definition at line 170 of file hash_map.hh.
void utilmm::hash_map< Key, Data, Hash, Equal >::erase | ( | iterator const & | i | ) | [inline] |
Remove element.
i | The lement to remove |
This function removes the element pointed by i form the table
Definition at line 179 of file hash_map.hh.
void utilmm::hash_map< Key, Data, Hash, Equal >::erase | ( | key_arg | key | ) | [inline] |
remove element
key | the key of the element |
This function erase, if any, the element whose key is key
Definition at line 189 of file hash_map.hh.
iterator utilmm::hash_map< Key, Data, Hash, Equal >::find | ( | key_arg | key | ) | [inline] |
Search for key.
key | the key to find. |
This function tries to search in table an element with key key
end()
if not found. Definition at line 139 of file hash_map.hh.
const_iterator utilmm::hash_map< Key, Data, Hash, Equal >::find | ( | key_arg | key | ) | const [inline] |
Search key.
Search for key.
key | the key to find. |
This function tries to search in table an element with key key
end()
if not found. Definition at line 146 of file hash_map.hh.
std::pair<iterator, bool> utilmm::hash_map< Key, Data, Hash, Equal >::insert | ( | value_arg | val | ) | [inline] |
Cell insertion.
val | The value to insert |
This function tries to insert val in current instance. It will not insert it if ther's already a cell with the same key as val
first
is an iterator
pointing to cell with the same key as val and second
is true if and only if val
was inserted. Definition at line 162 of file hash_map.hh.
size_t utilmm::hash_map< Key, Data, Hash, Equal >::max_size | ( | ) | const [inline] |
max element number
max elmement number
Definition at line 88 of file hash_map.hh.
size_t utilmm::hash_map< Key, Data, Hash, Equal >::size | ( | ) | const [inline] |
element count
element count
Definition at line 81 of file hash_map.hh.
void utilmm::hash_map< Key, Data, Hash, Equal >::swap | ( | hash_map< Key, Data, Hash, Equal > & | other | ) | [inline] |
swapping function
swapping values function
This function exchange the value of current instance with the value of another instance.
other | The other instance |
Definition at line 73 of file hash_map.hh.
container_type utilmm::hash_map< Key, Data, Hash, Equal >::the_table [private] |
Definition at line 55 of file hash_map.hh.