#include <hashlist.h>
Public Types | |
typedef T | value_type |
Value type. | |
typedef T & | reference |
Reference type. | |
typedef T const & | const_reference |
Const reference type. | |
typedef T * | pointer |
Pointer type. | |
typedef T const * | const_pointer |
Const pointer type. | |
typedef list_type::size_type | size_type |
Size type. | |
typedef list_type::difference_type | difference_type |
Difference type. | |
typedef KeyT | key_type |
Key type. | |
typedef Hash< T, KeyT > | hash_type |
Type of the Hash class. | |
typedef Iterator | iterator |
Normal iterator type. | |
typedef ConstIterator | const_iterator |
Const iterator type. | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Reverse iterator. | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Const reverse iterator. | |
Public Member Functions | |
HashList (hash_type const &hash) | |
Constructor. | |
HashList (HashList const &hl) | |
Copy constructor. | |
HashList & | operator= (HashList const &right) |
Assignment operator. | |
iterator | add (KeyT const &key, T const &value) |
Adds a value to the hash list. | |
iterator | add_sorted (KeyT const &key, T const &value) |
Adds a value to the hash list in sorted order. | |
void | clear () |
Clears the hash list. | |
void | erase (iterator it) |
Erases the value pointed to by the given iterator. | |
void | erase (iterator first, iterator last) |
Erases values pointed to by the given iterator range. | |
iterator | find (KeyT const &key) |
Finds a value matching the given key. | |
const_iterator | find (KeyT const &key) const |
Const version of find(). | |
iterator | find_sorted (KeyT const &key) |
Finds a value matching the given key in a sorted list. | |
const_iterator | find_sorted (KeyT const &key) const |
Const version of find(). | |
bool | remove (KeyT const &key) |
Removes a value matching the given key. | |
bool | remove_sorted (KeyT const &key) |
Removes a value matching the given key in a sorted list. | |
iterator | begin () |
Returns an iterator for the beginning of the hash list. | |
iterator | end () |
Returns an iterator to the end of the hash list. | |
const_iterator | begin () const |
Returns a const iterator for the beginning of the hash list. | |
const_iterator | end () const |
Returns a const iterator to the end of the hash list. | |
reverse_iterator | rbegin () |
Returns a reverse iterator to the beginning of the hash list. | |
reverse_iterator | rend () |
Returns a reverse iterator to the end of the hash list. | |
const_reverse_iterator | rbegin () const |
Returns a const reverse iterator to the beginning of the hash list. | |
const_reverse_iterator | rend () const |
Returns a const reverse iterator to the end of the hash list. | |
size_type | size () const |
Returns the actual number of elements in the hash list. | |
bool | empty () const |
Returns whether the hash list is empty. | |
size_type | max_size () const |
Returns the maximum size of the hash list. | |
Static Public Attributes | |
static int const | hash_size = SIZE |
Hash size. | |
Friends | |
class | Iterator |
class | ConstIterator |
Classes | |
class | ConstIterator |
class | Iterator |
T | The type of values stored in the list. | |
KeyT | The type of the keys used to retrieve a value. | |
SIZE | The size of the hash list (the number of possible values, from 0 to SIZE-1, the associated Hash class will return). |
|
Constructor.
|
|
Adds a value to the hash list that can be retrieved with the given key.
|
|
Adds a value to the hash list in sorted order. The Hash::compare() function is used to sort the value using its key. This allows to use functions such as find_sorted() that work faster on sorted lists, but all elements of the list must have been added through the add_sorted() function.
|
|
Erases values pointed to by the given iterator range.
|
|
Erases the value pointed to by the given iterator.
|
|
Finds a value matching the given key.
|
|
Finds a value matching the given key in a sorted list. All values in the hash list should have been added with the add_sorted() function. Finding a value in a sorted list is usually faster when no value matching the key exists in the list, and runs at the same speed otherwise.
|
|
Removes a value matching the given key.
|
|
Removes a value matching the given key in a sorted list. All values in the hash list should have been added with the add_sorted() function. Removing a value in a sorted list is usually faster when no value matching the key exists in the list, and runs at the same speed otherwise.
|