Hashing based table.
More...
#include <table.hh>
List of all members.
Public Types |
typedef const_iter< Key, Value,
Extract, Hash, Equal > | const_iterator |
| const iterator type
|
typedef iter< Key, Value,
Extract, Hash, Equal > | iterator |
| iterator type
|
typedef arg_traits< key_type >
::type | key_arg |
typedef Key | key_type |
| Key type.
|
typedef size_t | size_type |
| Size type.
|
typedef arg_traits< value_type >
::type | value_arg |
typedef Value | value_type |
| Value type for cells.
|
Public Member Functions |
const_iterator | begin () const |
| Beginning of table.
|
iterator | begin () |
| Beginning of table.
|
void | clear () |
| remove all elements
|
bool | empty () const |
| Emptyness test.
|
const_iterator | end () const |
| End of table.
|
iterator | end () |
| End of table.
|
std::pair< const_iterator,
const_iterator > | equal_range (key_arg key) const |
| equality range.
|
std::pair< iterator, iterator > | equal_range (key_arg key) |
| equality range
|
void | erase (iterator const &first, iterator const &last) |
| Remove elements.
|
iterator | insert_multiple (value_arg v) |
| multiple insertion
|
std::pair< iterator, bool > | insert_unique (value_arg v) |
| Unique key insertion.
|
size_type | max_size () const |
| max elmement number
|
table & | operator= (table const &other) |
| Copy operator.
|
size_type | size () const |
| element count
|
void | swap (table &other) |
| swapping values function
|
| table (table const &) |
| Copy constructor.
|
| table () |
| Default constructor.
|
| ~table () |
| Copy destructor.
|
Private Types |
typedef std::vector< node_type * > | bucket_type |
typedef node< value_type > | node_type |
Private Member Functions |
node_type * | find_node (key_arg k) const |
node_type ** | find_node (key_arg k) |
size_t | hash_node (value_arg v) |
node_type * | insert (node_type **helper, value_arg v) |
void | resize (size_type size) |
Static Private Member Functions |
static bucket_type | copy_bucket (bucket_type const &other) |
static key_type const & | get_key (value_arg v) |
static size_t | hash_key (key_arg k, size_type mod) |
static size_t | hash_node (value_arg v, size_type mod) |
Private Attributes |
size_type | avg_bucket_count |
bucket_type | bucket |
size_type | node_count |
Friends |
class | const_iter |
class | iter |
Detailed Description
template<typename Key, typename Value, class Extract, class Hash, class Equal>
class utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >
Hashing based table.
This class is used as internal basis for all hashing based containers presented here. It is mainly insdpired on SGI STL implementation
- Parameters:
-
| Key | the entry type for this table |
| Value | The value type for cells in table |
| Extract | Key extractor from Value |
| Hash | hashing functor for Key |
| Equal | equality functor for Key |
- See also:
- utilmm::hash
- Author:
- Frédéric Py <fpy@laas.fr>
Definition at line 46 of file table.hh.
Member Typedef Documentation
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
const iterator type
The type used to iterate through this class without any modification
Definition at line 73 of file table.hh.
template<typename Key, typename Value, class Extract, class Hash, class Equal>
iterator type
The type used to iterate through and manipulate this class
Definition at line 67 of file table.hh.
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Size type.
Definition at line 53 of file table.hh.
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Value type for cells.
Definition at line 49 of file table.hh.
Constructor & Destructor Documentation
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Default constructor.
Create an empty table
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Member Function Documentation
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Beginning of table.
- Returns:
- a const iterator pointing to the beginning of the container
- See also:
- end() const
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Beginning of table.
- Returns:
- an iterator pointing to the beginning of the container
- See also:
- end()
template<typename Key, typename Value, class Extract, class Hash, class Equal>
remove all elements
This function is strictly equivelent to erase
(begin(), end())
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Emptyness test.
- Return values:
-
| true | if this instance has no element |
| false | else |
- See also:
- size() const
template<typename Key, typename Value, class Extract, class Hash, class Equal>
End of table.
- Returns:
- a const iterator pointing to the end of the container
- See also:
- begin() const
template<typename Key, typename Value, class Extract, class Hash, class Equal>
End of table.
- Returns:
- an iterator pointing to the end of the container
- See also:
- begin()
template<typename Key, typename Value, class Extract, class Hash, class Equal>
equality range.
equality range
- Parameters:
-
This function tries to fuind all the elements of this table with a key equal to key
- Returns:
- a pair where [first, second[ corresponds to all the elements whose key is equal to key
template<typename Key, typename Value, class Extract, class Hash, class Equal>
equality range
- Parameters:
-
This function tries to fuind all the elements of this table with a key equal to key
- Returns:
- a pair where [first, second[ corresponds to all the elements whose key is equal to key
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Remove elements.
- Parameters:
-
| first | an iterator |
| last | an iterator |
removes all the element of the table in the range [first, last [
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
multiple insertion
param v The value to insert
Thsi function insert v in table
- Returns:
- an iterator pointing to the position where v was inserted
template<typename Key, typename Value, class Extract, class Hash, class Equal>
Unique key insertion.
- Parameters:
-
This function tries to insert v in the table except if there's already an element whose keys is equal to the key of v
- Returns:
- a pair where
first
is an iterator pointing to the element whose key is equal to the key of v and second
is true if we have inserted v
template<typename Key, typename Value, class Extract, class Hash, class Equal>
max elmement number
- Returns:
- The maximum possible number of elements
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
element count
- Returns:
- the number of element present in current container
template<typename Key, typename Value, class Extract, class Hash, class Equal>
swapping values function
This function exchange the value of current instance with the value of another instance.
- Parameters:
-
Friends And Related Function Documentation
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
friend class iter [friend] |
Member Data Documentation
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
template<typename Key, typename Value, class Extract, class Hash, class Equal>
The documentation for this class was generated from the following file: