A hashlist with dense_hashtable as a backend. More...
#include <ash/dense_hashlist.h>
Public Types | |
typedef Key | key_type |
The type used to identify elements. | |
typedef Data | data_type |
typedef pair< const key_type, Data > | value_type |
The type of the object the container holds. | |
typedef value_type * | pointer |
The type that serves as a pointer to value_type. | |
typedef value_type const * | const_pointer |
The type that serves as a const pointer to value_type. | |
typedef value_type & | reference |
The type that serves as a reference to value_type. | |
typedef value_type const & | const_reference |
The type that serves as a pointer to value_type. | |
typedef _Base::node_type | node_type |
| |
typedef _Base::size_type | size_type |
The unsigned type used to represent the size of the container. | |
typedef _Base::difference_type | difference_type |
The signed integral type used to represent the distance between iterators. | |
typedef _Base::hasher | hasher |
The functor type used to hash keys. | |
typedef _Base::iterator | iterator |
The type used to iterate through the contents of the container. | |
typedef _Base::const_iterator | const_iterator |
The const type used to iterate through the contents of the container. | |
typedef _Base::reverse_iterator | reverse_iterator |
A reverse_iterator adaptor for an iterator. | |
typedef _Base::const_reverse_iterator | const_reverse_iterator |
A reverse_iterator adaptor for a const_iterator. | |
typedef _Base::key_equal | key_equal |
| |
typedef _Base::key_access | key_access |
Functor to access a key_type from a value_type. | |
typedef _Base::allocator_type | allocator_type |
| |
typedef _Base::local_iterator | local_iterator |
TODO. | |
typedef _Base::const_local_iterator | const_local_iterator |
TODO. | |
enum | { LINKS_PER_NODE = Node::NUM_LINKS } |
typedef pair< iterator, iterator > | iterator_pair |
A pair of iterators (convenience). | |
typedef pair< const_iterator, const_iterator > | const_iterator_pair |
A pair of const_iterators (convenience). | |
Public Member Functions | |
void | set_empty_key (key_type const &key) |
void | set_deleted_key (key_type const &key) |
void | swap (hashgraph &hg) |
Swap method. | |
size_t | memory () const |
Get the container's total memory load. | |
size_type | bucket (key_type const &key) const |
| |
bool | operator== (hashgraph const &hg) const |
Constructors/Destructors | |
We use the default destructor. | |
dense_hashlist (size_type n=0, hasher const &h=hasher(), key_equal const &k=key_equal()) | |
Default constructor. | |
template<class InputIterator > | |
dense_hashlist (InputIterator const &f, InputIterator const &l, key_type const &empty_key, size_type n=0, hasher const &h=hasher(), key_equal const &k=key_equal()) | |
Iterative constructor. | |
dense_hashlist (dense_hashlist const &dhl) | |
Copy constructor. | |
Size Methods | |
void | clear_no_resize () |
Clear the container without freeing memory. | |
Constructors/Destructors | |
We use the default destructor. | |
void | swap (hashlist &hl) |
Swap method. | |
Iteration Methods | |
iterator | begin () |
Get an iterator to the beginning. | |
const_iterator | begin () const |
Get an iterator to the beginning. | |
iterator | end () |
Get an iterator to the end. | |
const_iterator | end () const |
Get an iterator to the end. | |
reverse_iterator | rbegin () |
Get an iterator to the reverse beginning. | |
const_reverse_iterator | rbegin () const |
Get an iterator to the reverse beginning. | |
reverse_iterator | rend () |
Get an iterator to the reverse end. | |
const_reverse_iterator | rend () const |
Get an iterator to the reverse beginning. | |
Iterator Functions | |
local_iterator | begin (size_type i) |
| |
const_local_iterator | begin (size_type i) const |
| |
local_iterator | end (size_type i) |
| |
const_local_iterator | end (size_type i) const |
| |
Insert/Delete | |
pair< iterator, bool > | insert (iterator pos, const_reference v) |
Insert an element. | |
template<class InputIterator > | |
void | insert (iterator pos, InputIterator f, InputIterator const &l) |
Range insert. | |
void | erase (iterator pos) |
Erase an element. | |
void | erase (iterator first, iterator const &last) |
Erase a range of elements. | |
pair< iterator, bool > | push_front (const_reference v) |
Insert an element at the front of the container. | |
pair< iterator, bool > | push_back (const_reference v) |
Insert an object at the back of the container. | |
void | pop_front () |
Erase the element at the front of the container. | |
void | pop_back () |
Erase the element at the back of the container. | |
Lookup Methods | |
iterator | find (key_type const &key) |
Find an element. | |
const_iterator | find (key_type const &key) const |
Find an element. | |
pair< iterator, iterator > | equal_range (key_type const &k) |
Find all elements matching a given key. | |
pair< const_iterator, const_iterator > | equal_range (key_type const &k) const |
Find all elements matching a given key. | |
reference | front () |
Get the first element. | |
const_reference | front () const |
Get the first element. | |
reference | back () |
| |
const_reference | back () const |
| |
Order Methods | |
void | reverse () |
Reverse the order of elements. | |
template<class BinaryPredicate > | |
void | sort (BinaryPredicate comp) |
Sort elements according to comp . | |
void | sort () |
Sort elements according to operator< . | |
Size Functions | |
size_type | size () const |
Get the size of the container. | |
size_type | max_size () const |
Get the maximum size of the container. | |
size_t | dynamic_memory () const |
Get the container's dynamic memory load. | |
bool | empty () const |
Check if the container is empty. | |
size_type | bucket_count () const |
Get the number of buckets the container has. | |
void | resize (size_type n) |
Resize the container to hold at least n elements. | |
void | rehash (size_type n) |
| |
Accessor Methods | |
hasher | hash_funct () const |
Get the hash functor used by the container. | |
hasher | hash_function () const |
Get the hash functor used by the container. | |
key_equal | key_eq () const |
Get the key comparison functor used by the container. | |
Lookup | |
size_type | count (key_type const &k) const |
Count the number of elements with a given key. | |
Hash Container Functions | |
float | load_factor () const |
| |
float | max_load_factor () const |
| |
float | max_load_factor (size_type new_grow) |
| |
float | min_load_factor () const |
Get the min load factor. | |
float | min_load_factor (size_type new_shrink) |
Set the min load factor. | |
Protected Types | |
typedef node< 2 > | node_base |
typedef list_iterator < hashlist, trivial > | iterator_base |
typedef list_iterator < hashlist, add_const > | const_iterator_base |
typedef f_access_node< Node, KeyAccess > | node_key_access |
Functor to get/set the key of a node (wrapper for key_access). | |
typedef table_node_allocator < allocator_type > | hashtable_allocator |
The hashtable's allocator. | |
typedef Ht< node_type, key_type, hasher, node_key_access, key_equal, hashtable_allocator > | hashtable_type |
The hashtable used as a backend. | |
typedef hashtable_type::iterator | _Ht_iterator |
The hashtable's iterator - we'll wrap it with our own. | |
typedef hashtable_type::const_iterator | _Ht_const_iterator |
The hashtable's const_iterator - we'll wrap it with our own. | |
typedef pair< _Ht_iterator, _Ht_iterator > | _Ht_iterator_pair |
A pair of the hashtable's iterators (convenience). | |
typedef pair < _Ht_const_iterator, _Ht_const_iterator > | _Ht_const_iterator_pair |
A pair of the hashtable's const_iterators (convenience). | |
typedef graph_navigator < hashgraph, iterator_base, trivial > | navigator_base |
typedef graph_navigator < hashgraph, const_iterator_base, add_const > | const_navigator_base |
Protected Member Functions | |
void | _link (node_base *pos, node_base *new_node) |
pair< iterator, bool > | _insert (key_type const &key, const_reference v) |
pair< iterator, bool > | _insert_end (const_reference v) |
pair< iterator, bool > | _insert_begin (const_reference v) |
pair< iterator, bool > | _insert_rbegin (const_reference v) |
void | _move (node_base *pos, node_base *node) |
Protected Attributes | |
node_base | _self |
key_access | access_key |
hashtable_type | _M_Ht |
Related Functions | |
(Note that these are not member functions.) | |
template<typename V , typename K , class HF , class KA , class EK , class A , _ASH_HT_IMPL HT> | |
void | swap (hashlist< V, K, HF, KA, EK, A, HT > &x, hashlist< V, K, HF, KA, EK, A, HT > &y) |
Global swap. | |
template<class N , typename K , class HF , class KA , class EK , class A , _ASH_HT_IMPL HT> | |
void | swap (hashgraph< N, K, HF, KA, EK, A, HT > &x, hashgraph< N, K, HF, KA, EK, A, HT > &y) |
Global swap. | |
Insert/Delete | |
size_type | erase (key_type const &k) |
Erase an element. | |
void | clear () |
Erase all elements. | |
pair< iterator, bool > | insert (const_reference v) |
Insert an element into the container. |
A hashlist with dense_hashtable as a backend.
Key | The key type associated with values. Also defined as dense_hashlist::key_type. |
Data | The data type associated with a Key. Also defined as dense_hashlist::data_type. |
HashFx | The hash functor. |
EqualKey | Functor to test keys for equality. |
Alloc | The allocator type. Also defined as dense_hashlist::allocator_type. |
set_empty_key()
before inserting elements, unless you use the iterative constructor which takes it as as argument. set_deleted_key()
before deleting elements. typedef hashtable_type::const_iterator ash::hashgraph::_Ht_const_iterator [protected, inherited] |
The hashtable's const_iterator - we'll wrap it with our own.
typedef pair<_Ht_const_iterator, _Ht_const_iterator> ash::hashgraph::_Ht_const_iterator_pair [protected, inherited] |
A pair of the hashtable's const_iterators (convenience).
typedef hashtable_type::iterator ash::hashgraph::_Ht_iterator [protected, inherited] |
The hashtable's iterator - we'll wrap it with our own.
typedef pair<_Ht_iterator, _Ht_iterator> ash::hashgraph::_Ht_iterator_pair [protected, inherited] |
A pair of the hashtable's iterators (convenience).
typedef _Base::allocator_type ash::hashlist::allocator_type [inherited] |
Concept: stl::container
Reimplemented from ash::hashgraph.
typedef _Base::const_iterator ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::const_iterator |
The const type used to iterate through the contents of the container.
Concept: stl::reversible_container
Reimplemented from ash::hashlist.
typedef pair<const_iterator, const_iterator> ash::hashgraph::const_iterator_pair [inherited] |
A pair of const_iterators (convenience).
Reimplemented in ash::hashgrid.
typedef value_type const* ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::const_pointer |
The type that serves as a const pointer to value_type.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef value_type const& ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::const_reference |
The type that serves as a pointer to value_type.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef _Base::const_reverse_iterator ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::const_reverse_iterator |
A reverse_iterator adaptor for a const_iterator.
Concept: stl::reversible_container
Reimplemented from ash::hashlist.
typedef _Base::difference_type ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::difference_type |
The signed integral type used to represent the distance between iterators.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef _Base::hasher ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::hasher |
The functor type used to hash keys.
Concept: stl::hashed_associative_container
Reimplemented from ash::hashlist.
typedef table_node_allocator<allocator_type> ash::hashgraph::hashtable_allocator [protected, inherited] |
The hashtable's allocator.
typedef Ht< node_type, key_type, hasher, node_key_access, key_equal, hashtable_allocator > ash::hashgraph::hashtable_type [protected, inherited] |
The hashtable used as a backend.
Reimplemented in ash::hashgrid, ash::dense_hashgrid< Coord, Data, Alloc >, and ash::sparse_hashgrid< Coord, Data, Alloc >.
typedef _Base::iterator ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::iterator |
The type used to iterate through the contents of the container.
Concept: stl::reversible_container
Reimplemented from ash::hashlist.
typedef pair<iterator, iterator> ash::hashgraph::iterator_pair [inherited] |
A pair of iterators (convenience).
Reimplemented in ash::hashgrid.
typedef _Base::key_access ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::key_access |
Functor to access a key_type from a value_type.
Reimplemented from ash::hashlist.
typedef _Base::key_equal ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::key_equal |
Concept: stl::associative_container
Reimplemented from ash::hashlist.
typedef Key ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::key_type |
The type used to identify elements.
Concept: stl::associative_container
Reimplemented from ash::hashlist.
typedef f_access_node<Node, KeyAccess> ash::hashgraph::node_key_access [protected, inherited] |
Functor to get/set the key of a node (wrapper for key_access).
typedef _Base::node_type ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::node_type |
Concept: ash::hash_graph
Reimplemented from ash::hashlist.
typedef value_type* ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::pointer |
The type that serves as a pointer to value_type.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef value_type& ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::reference |
The type that serves as a reference to value_type.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef _Base::reverse_iterator ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::reverse_iterator |
A reverse_iterator adaptor for an iterator.
Concept: stl::reversible_container
Reimplemented from ash::hashlist.
typedef _Base::size_type ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::size_type |
The unsigned type used to represent the size of the container.
Concept: stl::container
Reimplemented from ash::hashlist.
typedef pair<const key_type, Data> ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::value_type |
The type of the object the container holds.
Must be Assignable .
Concept: stl::container
Reimplemented from ash::hashlist.
ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::dense_hashlist | ( | size_type | n = 0 , |
hasher const & | h = hasher() , |
||
key_equal const & | k = key_equal() |
||
) | [inline, explicit] |
Default constructor.
n | The number of expected elements. |
h | The hasher object to copy, if any. |
k | The key_equal object to copy, if any. |
ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::dense_hashlist | ( | InputIterator const & | f, |
InputIterator const & | l, | ||
key_type const & | empty_key, | ||
size_type | n = 0 , |
||
hasher const & | h = hasher() , |
||
key_equal const & | k = key_equal() |
||
) | [inline] |
Iterative constructor.
f | The beginning of the range of elements to insert. |
l | The end of the range of elements to insert. |
empty_key | The key to use for empty buckets. |
n | The number of expected elements. |
h | The hasher object to copy, if any. |
k | The key_equal object to copy, if any. |
ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::dense_hashlist | ( | dense_hashlist< Key, Data, HashFx, EqualKey, Alloc > const & | dhl | ) | [inline] |
Copy constructor.
reference ash::hashlist::back | ( | ) | [inline, inherited] |
Concept: stl::sequence
const_reference ash::hashlist::back | ( | ) | const [inline, inherited] |
Concept: stl::sequence
iterator ash::hashlist::begin | ( | ) | [inline, inherited] |
Get an iterator to the beginning.
Reimplemented from ash::hashgraph.
const_iterator ash::hashlist::begin | ( | ) | const [inline, inherited] |
Get an iterator to the beginning.
Reimplemented from ash::hashgraph.
local_iterator ash::hashgraph::begin | ( | size_type | i | ) | [inline, inherited] |
Concept: tr1::unordered_associative_container
const_local_iterator ash::hashgraph::begin | ( | size_type | i | ) | const [inline, inherited] |
Concept: tr1::unordered_associative_container
size_type ash::hashgraph::bucket | ( | key_type const & | key | ) | const [inline, inherited] |
Concept: tr1::unordered_associative_container
size_type ash::hashgraph::bucket_count | ( | ) | const [inline, inherited] |
Get the number of buckets the container has.
void ash::hashgraph::clear | ( | ) | [inline, inherited] |
Erase all elements.
Concept: stl::associative_container
void ash::dense_hashlist< Key, Data, HashFx, EqualKey, Alloc >::clear_no_resize | ( | ) | [inline] |
Clear the container without freeing memory.
size_type ash::hashgraph::count | ( | key_type const & | k | ) | const [inline, inherited] |
Count the number of elements with a given key.
key | The key to search for. |
key
. Because this is a Unique Associative Container , the return value will be 0 or 1. size_t ash::hashgraph::dynamic_memory | ( | ) | const [inline, inherited] |
Get the container's dynamic memory load.
bool ash::hashgraph::empty | ( | ) | const [inline, inherited] |
iterator ash::hashlist::end | ( | ) | [inline, inherited] |
Get an iterator to the end.
Reimplemented from ash::hashgraph.
const_iterator ash::hashlist::end | ( | ) | const [inline, inherited] |
Get an iterator to the end.
Reimplemented from ash::hashgraph.
local_iterator ash::hashgraph::end | ( | size_type | i | ) | [inline, inherited] |
Concept: tr1::unordered_associative_container
const_local_iterator ash::hashgraph::end | ( | size_type | i | ) | const [inline, inherited] |
Concept: tr1::unordered_associative_container
pair<iterator, iterator> ash::hashlist::equal_range | ( | key_type const & | k | ) | [inline, inherited] |
Find all elements matching a given key.
key | The key to search for. |
iterator
points to the element, or to the end() if not found. The second iterator
points to 1 past the first, or to the end(). Reimplemented from ash::hashgraph.
pair<const_iterator,const_iterator> ash::hashlist::equal_range | ( | key_type const & | k | ) | const [inline, inherited] |
Find all elements matching a given key.
key | The key to search for. |
const_iterator
points to the element, or to the end() if not found. The second const_iterator
points to 1 past the first, or to the end(). Reimplemented from ash::hashgraph.
void ash::hashlist::erase | ( | iterator | pos | ) | [inline, inherited] |
Erase an element.
itr | An iterator pointing to the element to erase. |
Reimplemented from ash::hashgraph.
void ash::hashlist::erase | ( | iterator | first, |
iterator const & | last | ||
) | [inline, inherited] |
Erase a range of elements.
f | The beginning of the range to erase. |
l | The end of the range to erase. |
Reimplemented from ash::hashgraph.
size_type ash::hashgraph::erase | ( | key_type const & | k | ) | [inline, inherited] |
Erase an element.
key | The key of the element to erase. |
iterator ash::hashlist::find | ( | key_type const & | key | ) | [inline, inherited] |
Find an element.
key | The key of the element to search for. |
Reimplemented from ash::hashgraph.
const_iterator ash::hashlist::find | ( | key_type const & | key | ) | const [inline, inherited] |
Find an element.
key | The key of the element to search for. |
Reimplemented from ash::hashgraph.
reference ash::hashlist::front | ( | ) | [inline, inherited] |
Get the first element.
const_reference ash::hashlist::front | ( | ) | const [inline, inherited] |
Get the first element.
hasher ash::hashgraph::hash_funct | ( | ) | const [inline, inherited] |
Get the hash functor used by the container.
hasher
object. hasher ash::hashgraph::hash_function | ( | ) | const [inline, inherited] |
Get the hash functor used by the container.
hasher
object. pair<iterator, bool> ash::hashlist::insert | ( | iterator | pos, |
const_reference | v | ||
) | [inline, inherited] |
Insert an element.
p | An iterator to the element after the location to insert. |
v | The object to insert. |
iterator
and a bool
. The iterator
points to the inserted element, or to another with the same key if one is already in the container. The bool
is true if the element was inserted, and false in the case of a duplicate key. void ash::hashlist::insert | ( | iterator | pos, |
InputIterator | f, | ||
InputIterator const & | l | ||
) | [inline, inherited] |
Range insert.
p | An iterator to the element after the location to insert. |
f | The beginning of the range to insert. |
t | The end of the range to insert. |
pair<iterator, bool> ash::hashgraph::insert | ( | const_reference | v | ) | [inline, protected, inherited] |
Insert an element into the container.
obj | The element to insert. |
iterator
and a bool
. The iterator
points to the inserted element, or to another with the same key if one is already in the container. The bool
is true if the element was inserted, and false in the case of a duplicate key. Reimplemented in ash::hashgrid.
key_equal ash::hashgraph::key_eq | ( | ) | const [inline, inherited] |
Get the key comparison functor used by the container.
key_equal
object. float ash::hashgraph::load_factor | ( | ) | const [inline, inherited] |
Concept: tr1::unordered_associative_container
float ash::hashgraph::max_load_factor | ( | ) | const [inline, inherited] |
Concept: tr1::unordered_associative_container
float ash::hashgraph::max_load_factor | ( | size_type | new_grow | ) | [inline, inherited] |
Concept: tr1::unordered_associative_container
size_type ash::hashgraph::max_size | ( | ) | const [inline, inherited] |
Get the maximum size of the container.
size_t ash::hashlist::memory | ( | ) | const [inline, inherited] |
Get the container's total memory load.
Reimplemented from ash::hashgraph.
float ash::hashgraph::min_load_factor | ( | ) | const [inline, inherited] |
Get the min load factor.
float ash::hashgraph::min_load_factor | ( | size_type | new_shrink | ) | [inline, inherited] |
Set the min load factor.
new_shrink | The min load factor before the container shrinks. |
void ash::hashlist::pop_back | ( | ) | [inline, inherited] |
Erase the element at the back of the container.
Concept: stl::back_insertion_sequence
void ash::hashlist::pop_front | ( | ) | [inline, inherited] |
Erase the element at the front of the container.
Concept: stl::front_insertion_sequence
pair<iterator, bool> ash::hashlist::push_back | ( | const_reference | v | ) | [inline, inherited] |
Insert an object at the back of the container.
v | The object to insert. |
pair<iterator, bool> ash::hashlist::push_front | ( | const_reference | v | ) | [inline, inherited] |
Insert an element at the front of the container.
v | The object to insert. |
iterator
and a bool
. The iterator
points to the inserted element, or to another with the same key if one is already in the container. The bool
is true if the element was inserted, and false in the case of a duplicate key. reverse_iterator ash::hashlist::rbegin | ( | ) | [inline, inherited] |
Get an iterator to the reverse beginning.
const_reverse_iterator ash::hashlist::rbegin | ( | ) | const [inline, inherited] |
Get an iterator to the reverse beginning.
void ash::hashgraph::rehash | ( | size_type | n | ) | [inline, inherited] |
Concept: tr1::unordered_associative_container
reverse_iterator ash::hashlist::rend | ( | ) | [inline, inherited] |
Get an iterator to the reverse end.
const_reverse_iterator ash::hashlist::rend | ( | ) | const [inline, inherited] |
Get an iterator to the reverse beginning.
void ash::hashgraph::resize | ( | size_type | n | ) | [inline, inherited] |
Resize the container to hold at least n elements.
n | The number of elements the container is expected to hold. |
void ash::hashlist::reverse | ( | ) | [inline, inherited] |
Reverse the order of elements.
Concept: stl::list
size_type ash::hashgraph::size | ( | ) | const [inline, inherited] |
Get the size of the container.
void ash::hashlist::sort | ( | BinaryPredicate | comp | ) | [inline, inherited] |
void ash::hashlist::sort | ( | ) | [inline, inherited] |
Sort elements according to operator<
.
Concept: stl::list
void ash::hashlist::swap | ( | hashlist & | hl | ) | [inline, inherited] |
Swap method.
Concept: stl::container
void ash::hashgraph::swap | ( | hashgraph & | hg | ) | [inline, inherited] |
Swap method.
Concept: stl::container
© 2012 | Licensed under | Hosted by | Generated by 1.7.4 |