utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal > Class Template Reference
[Hash function based containers]

Hashing based table. More...

#include <utilmm/hash/bits/table.hh>

List of all members.

Public Types

typedef Value value_type
 Value type for cells.
typedef Key key_type
 Key type.
typedef size_t size_type
 Size type.
typedef arg_traits
< value_type >::type 
value_arg
typedef arg_traits
< key_type >::type 
key_arg
typedef iter< Key,
Value, Extract,
Hash, Equal > 
iterator
 iterator type
typedef const_iter
< Key, Value,
Extract, Hash,
Equal > 
const_iterator
 const iterator type

Public Member Functions

 table ()
 Default constructor.
 table (table const &)
 Copy constructor.
 ~table ()
 Copy destructor.
void swap (table &other)
 swapping values function
tableoperator= (table const &other)
 Copy operator.
size_type size () const
 element count
size_type max_size () const
 max elmement number
bool empty () const
 Emptyness test.
iterator begin ()
 Beginning of table.
iterator end ()
 End of table.
const_iterator begin () const
 Beginning of table.
const_iterator end () const
 End of table.
std::pair< iterator,
iterator
equal_range (key_arg key)
 equality range
std::pair
< const_iterator,
const_iterator
equal_range (key_arg key) const
 equality range.
void erase (iterator const &first, iterator const &last)
 Remove elements.
std::pair< iterator,
bool > 
insert_unique (value_arg v)
 Unique key insertion.
iterator insert_multiple (value_arg v)
 multiple insertion
void clear ()
 remove all elements

Friends

class iter
class const_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>

Member Typedef Documentation

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef Value utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::value_type

Value type for cells.

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef Key utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::key_type

Key type.

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef size_t utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::size_type

Size type.

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef arg_traits<value_type>::type utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::value_arg

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef arg_traits<key_type>::type utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::key_arg

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef iter<Key, Value, Extract, Hash, Equal> utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::iterator

iterator type

The type used to iterate through and manipulate this class

template<typename Key, typename Value, class Extract, class Hash, class Equal>
typedef const_iter<Key, Value, Extract, Hash, Equal> utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::const_iterator

const iterator type

The type used to iterate through this class without any modification


Constructor & Destructor Documentation

template<typename Key, typename Value, class Extract, class Hash, class Equal>
utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::table (  ) 

Default constructor.

Create an empty table

template<typename Key, typename Value, class Extract, class Hash, class Equal>
utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::table ( table< Key, Value, Extract, Hash, Equal > const &   ) 

Copy constructor.

template<typename Key, typename Value, class Extract, class Hash, class Equal>
utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::~table (  ) 

Copy destructor.


Member Function Documentation

template<typename Key, typename Value, class Extract, class Hash, class Equal>
void utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::swap ( table< Key, Value, Extract, Hash, Equal > &  other  ) 

swapping values function

This function exchange the value of current instance with the value of another instance.

Parameters:
other The other instance

template<typename Key, typename Value, class Extract, class Hash, class Equal>
table& utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::operator= ( table< Key, Value, Extract, Hash, Equal > const &  other  ) 

Copy operator.

template<typename Key, typename Value, class Extract, class Hash, class Equal>
size_type utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::size (  )  const

element count

Returns:
the number of element present in current container

template<typename Key, typename Value, class Extract, class Hash, class Equal>
size_type utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::max_size (  )  const

max elmement number

Returns:
The maximum possible number of elements

template<typename Key, typename Value, class Extract, class Hash, class Equal>
bool utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::empty (  )  const

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>
iterator utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::begin (  ) 

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>
iterator utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::end (  ) 

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>
const_iterator utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::begin (  )  const

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>
const_iterator utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::end (  )  const

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>
std::pair<iterator, iterator> utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::equal_range ( key_arg  key  ) 

equality range

Parameters:
key a Key
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>
std::pair< const_iterator, const_iterator > utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::equal_range ( key_arg  key  )  const

equality range.

equality range

Parameters:
key a Key
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>
void utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::erase ( iterator const &  first,
iterator const &  last 
)

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>
std::pair<iterator, bool> utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::insert_unique ( value_arg  v  ) 

Unique key insertion.

Parameters:
v The value to insert
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>
iterator utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::insert_multiple ( value_arg  v  ) 

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>
void utilmm::hash_toolbox::table< Key, Value, Extract, Hash, Equal >::clear (  ) 

remove all elements

This function is strictly equivelent to erase(begin(), end())


Friends And Related Function Documentation

template<typename Key, typename Value, class Extract, class Hash, class Equal>
friend class iter [friend]

template<typename Key, typename Value, class Extract, class Hash, class Equal>
friend class const_iter [friend]


The documentation for this class was generated from the following file:
Generated on Tue Feb 19 10:51:02 2008 for Util-- by doxygen 1.5.3
SourceForge.net Project Page