Public Types | Public Member Functions | Related Functions
concept::ash::hash_matrix Class Reference

Hash-Matrix concept. More...

#include <dox/tag/concept/hash_matrix.hpp>

Inheritance diagram for concept::ash::hash_matrix:
Inheritance graph
[legend]

List of all members.

Public Types

typedef binary_predicate key_equal
 The functor used to compare keys for equality.
Basic Types
typedef morton key_type
 The type of key associated with objects in the container.
typedef void data_type
 The type of data associated with keys/coords.
typedef std::pair< const
key_type, data_type
value_type
 The type of object stored in the container.
typedef value_typepointer
 The type that serves as a pointer to value_type.
typedef value_typereference
 The type that serves as a reference to value_type.
typedef value_type const * const_pointer
 The type that serves as a const pointer to value_type.
typedef value_type const & const_reference
 The type that serves as a pointer to value_type.
typedef size_t size_type
 The type used to represent the size of the container.
typedef pcoord pcoord_type
 The type used to represent a coordinate.
typedef morton morton_type
 The type used to represent a hashed/interleaved coordinate.
typedef point point_type
 The type used to represent a floating-point coordinate.
Iterators/Navigators
typedef matrix_navigator navigator
 The type used to move around the matrix in an arbitrary manner.
typedef matrix_navigator const_navigator
 The const type used to move around the matrix in an arbitrary manner.
typedef stl::bidirectional_iterator range_iterator
 The type used to iterate through a group of contiguous objects.
typedef stl::bidirectional_iterator const_range_iterator
 The const type used to iterate through a group of contiguous objects.
typedef stl::bidirectional_iterator path_iterator
 The type used to iterate through a group of objects along a path.
typedef stl::bidirectional_iterator const_path_iterator
 The const type used to iterate through a group of objects along a path.
Functors
typedef stl::hash_function hasher
 The hash functor used by the container.
Iterator Types
typedef forward_iterator iterator
 The type used to iterate through the contents of the container.
typedef forward_iterator const_iterator
 The const type used to iterate through the contents of the container.
Basic Types
typedef ptrdiff_t difference_type
 The signed integral type used to represent the distance between iterators.

Public Member Functions

hasher hash_funct () const
 Get the hash functor used by the container.
key_equal key_eq () const
 Get the key comparison functor used by the container.
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.
size_type erase (key_type const &key)
 Erase an element.
void erase (iterator itr)
 Erase an element.
void erase (iterator f, iterator l)
 Erase a range of elements.
void clear ()
 Erase all elements.
iterator find (key_type const &key)
 Find an element.
const_iterator find (key_type const &key) const
 Find an element.
size_type count (key_type const &key) const
 Count the number of elements with a given key.
size_type count (key_type const &key) const
 Count the number of elements with a given key.
std::pair< iterator, iteratorequal_range (key_type const &key)
 Find all elements matching a given key.
std::pair< const_iterator,
const_iterator
equal_range (key_type const &key) const
 Find all elements matching a given key.
std::pair< iterator, iteratorequal_range (key_type const &key)
 Find all elements matching a given key.
std::pair< const_iterator,
const_iterator
equal_range (key_type const &key) const
 Find all elements matching a given key.
std::pair< iterator, bool > insert (const_reference obj)
 Insert an element into the container.
void insert (input_iterator f, input_iterator l)
 Insert a range of elements [f,l) into the container.
Constructors/Destructors
 hash_matrix (size_type n=0, hasher const &h=hasher(), key_equal const &k=key_equal())
 Default constructor.
 hash_matrix (hash_matrix const &obj)
 Copy constructor.
template<class InputIterator >
 hash_matrix (InputIterator const &f, InputIterator const &l, size_type n=0, hasher const &h=hasher(), key_equal const &k=key_equal())
 Iterative constructor.
 ~hash_matrix ()
 Destructor.
void swap (hash_matrix const &obj)
 Swap contents with another container.
Range Iterator Methods
range_iterator range_begin (key_type const &pos, size_type range)
 Get an iterator to go through all elements in a given range.
const_range_iterator range_begin (key_type const &pos, size_type range) const
 Get an iterator to go through all elements in a given range.
range_iterator range_begin (pcoord_type const &low, pcoord_type const &high)
 Get an iterator to go through all elements within a given box.
const_range_iterator range_begin (pcoord_type const &low, pcoord_type const &high) const
 Get an iterator to go through all elements within a given box.
Path Iterator Methods
path_iterator path_begin (point_type const &pa, point_type const &pb)
 Get an iterator from point A to point B.
const_path_iterator path_begin (point_type const &pa, point_type const &pb) const
 Get an iterator from point A to point B.
Lookup Methods
data_typeoperator[] (key_type const &key)
 Element access.
Comparison Methods
bool operator== (equality_comparable const &e)
 Equality operator.
Comparison Methods
bool operator< (less_than_comparable const &l)
 Less-than operator.
Constructors/Destructors
void swap (container &c)
 Swap method.
Iterator 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.
Size Methods
size_type size () const
 Get the size of the container.
size_type max_size () const
 Get the maximum size of the container.
bool empty () const
 Check if the container is empty.

Related Functions

(Note that these are not member functions.)

void swap (assignable &a1, assignable &a2)
 Global swap.

Detailed Description

Hash-Matrix concept.


Member Typedef Documentation

typedef forward_iterator concept::stl::forward_container::const_iterator [inherited]

The const type used to iterate through the contents of the container.

Reimplemented from concept::stl::container.

Reimplemented in concept::stl::list, concept::stl::reversible_container, concept::stl::sorted_associative_container, and concept::ash::hash_list.

The const type used to move around the matrix in an arbitrary manner.

This is conversion-constructable from a const_iterator, so any function which returns a const_iterator can also give you a const_navigator.

Reimplemented in concept::ash::hash_grid.

The const type used to iterate through a group of objects along a path.

This is just a wrapper for a const_navigator, and can cast to the wrapped const_navigator.

The type that serves as a const pointer to value_type.

Reimplemented from concept::stl::pair_associative_container.

The const type used to iterate through a group of contiguous objects.

Note:
The range is NOT Euclidian distance. It checks each axis individually.

This is just a wrapper for a const_navigator, and can cast to the wrapped const_navigator.

The type that serves as a pointer to value_type.

Reimplemented from concept::stl::pair_associative_container.

The type of data associated with keys/coords.

Reimplemented from concept::stl::pair_associative_container.

typedef ptrdiff_t concept::stl::container::difference_type [inherited]

The signed integral type used to represent the distance between iterators.

typedef stl::hash_function concept::ash::hash_matrix::hasher

The hash functor used by the container.

This could be trivial due to the automatic hashing with key_type. However, we provide a real hash functor, it's easy enough to do.

Reimplemented from concept::stl::hashed_associative_container.

typedef forward_iterator concept::stl::forward_container::iterator [inherited]
typedef binary_predicate concept::stl::hashed_associative_container::key_equal [inherited]

The functor used to compare keys for equality.

The type of key associated with objects in the container.

We use this type as the key for conversion convenience. Any method that takes a key_type as an argument may take any of the following:

  • pcoord_type
  • morton_type
  • size_type

In the case of a pcoord_type, conversion to key_type will hash it. Otherwise it is treated as a pre-hashed key.

Reimplemented from concept::stl::associative_container.

The type used to represent a hashed/interleaved coordinate.

Conversion-compatible with pcoord_type. Conversion-compatible with size_type.

See also:
MortonXY
MortonXYZ

The type used to move around the matrix in an arbitrary manner.

This is conversion-constructable from an iterator, so any function which returns an iterator can also give you a navigator.

Reimplemented in concept::ash::hash_grid.

The type used to iterate through a group of objects along a path.

This is just a wrapper for a navigator, and can cast to the wrapped navigator.

The type used to represent a coordinate.

Conversion-compatible with morton_type.

See also:
PCoordXY
PCoordXYZ

The type used to represent a floating-point coordinate.

Note:
You may change this in ash_config.h.

The type that serves as a pointer to value_type.

Reimplemented from concept::stl::pair_associative_container.

The type used to iterate through a group of contiguous objects.

Note:
The range is NOT Euclidian distance. It checks each axis individually.

This is just a wrapper for a navigator, and can cast to the wrapped navigator.

The type that serves as a reference to value_type.

Reimplemented from concept::stl::pair_associative_container.

The type used to represent the size of the container.

This is the same as the unsigned type underneath morton_type and pcoord_type. Obviously, we can't have a larger container than we have unique keys for.

Reimplemented from concept::stl::container.

The type of object stored in the container.

Reimplemented from concept::stl::pair_associative_container.


Constructor & Destructor Documentation

concept::ash::hash_matrix::hash_matrix ( size_type  n = 0,
hasher const &  h = hasher(),
key_equal const &  k = key_equal() 
) [explicit]

Default constructor.

Parameters:
nThe number of expected elements.
hThe hasher object to copy, if any.
kThe key_equal object to copy, if any.

Copy constructor.

Parameters:
objThe object to copy.
template<class InputIterator >
concept::ash::hash_matrix::hash_matrix ( InputIterator const &  f,
InputIterator const &  l,
size_type  n = 0,
hasher const &  h = hasher(),
key_equal const &  k = key_equal() 
)

Iterative constructor.

Parameters:
fThe beginning of the range of elements to insert.
lThe end of the range of elements to insert.
nThe number of expected elements.
hThe hasher object to copy, if any.
kThe key_equal object to copy, if any.

Destructor.


Member Function Documentation

Get an iterator to the beginning.

Returns:
An iterator to the beginning of the container.

Get an iterator to the beginning.

Returns:
A const_iterator to the beginning of the container.

Get the number of buckets the container has.

Returns:
The number of currently-allocated buckets.

Erase all elements.

Reimplemented in concept::tr1::unordered_associative_container.

Count the number of elements with a given key.

Parameters:
keyThe key to search for.
Returns:
The number of elements matching key.

Reimplemented in concept::stl::unique_associative_container.

Count the number of elements with a given key.

Parameters:
keyThe key to search for.
Returns:
The number of elements matching key. Because this is a Unique Associative Container , the return value will be 0 or 1.

Reimplemented from concept::stl::associative_container.

bool concept::stl::container::empty ( ) const [inherited]

Check if the container is empty.

Returns:
True if the container is empty.

Get an iterator to the end.

Returns:
An iterator to the end of the container.

Get an iterator to the end.

Returns:
A const_iterator to the end of the container.

Find all elements matching a given key.

Parameters:
keyThe key to search for.
Returns:
A pair of iterators for the range of elements [first,second).

Reimplemented in concept::stl::unique_associative_container, and concept::tr1::unordered_associative_container.

Find all elements matching a given key.

Parameters:
keyThe key to search for.
Returns:
A pair of const_iterators for the range of elements [first,second).

Reimplemented in concept::stl::unique_associative_container, and concept::tr1::unordered_associative_container.

Find all elements matching a given key.

Parameters:
keyThe key to search for.
Returns:
A pair of iterators for the range of elements [first,second). Because this is a Unique Associative Container , the first 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 concept::stl::associative_container.

Find all elements matching a given key.

Parameters:
keyThe key to search for.
Returns:
A pair of const_iterators for the range of elements [first,second). Because this is a Unique Associative Container , the first 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 concept::stl::associative_container.

Erase an element.

Parameters:
keyThe key of the element to erase.
Returns:
The number of erased elements.

Reimplemented in concept::tr1::unordered_associative_container.

Erase an element.

Parameters:
itrAn iterator pointing to the element to erase.

Reimplemented in concept::tr1::unordered_associative_container, and concept::tr1::unordered_associative_container.

Erase a range of elements.

Parameters:
fThe beginning of the range to erase.
lThe end of the range to erase.

Reimplemented in concept::tr1::unordered_associative_container, and concept::tr1::unordered_associative_container.

Find an element.

Parameters:
keyThe key of the element to search for.
Returns:
An iterator to the element, or to the end() if not found.

Reimplemented in concept::tr1::unordered_associative_container.

Find an element.

Parameters:
keyThe key of the element to search for.
Returns:
A const_iterator to the element, or to the end() if not found.

Reimplemented in concept::tr1::unordered_associative_container.

Get the hash functor used by the container.

Returns:
A copy of the container's hasher object.

Insert an element into the container.

Parameters:
objThe element to insert.
Returns:
An 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.

Insert a range of elements [f,l) into the container.

Parameters:
fThe beginning of the range to insert.
lThe end of the range to insert.

Elements with duplicate keys will be ignored.

Get the key comparison functor used by the container.

Returns:
A copy of the container's key_equal object.

Get the maximum size of the container.

Returns:
The maximum number of elements the container can hold.
bool concept::stl::less_than_comparable::operator< ( less_than_comparable const &  l) [inherited]

Less-than operator.

bool concept::stl::equality_comparable::operator== ( equality_comparable const &  e) [inherited]

Equality operator.

data_type& concept::ash::hash_matrix::operator[] ( key_type const &  key)

Element access.

Parameters:
keyThe key of the element to access.
Returns:
A reference to the corresponding data value. If an element with the key does not exist, it will be inserted.

Get an iterator from point A to point B.

Note:
There is no path_end(), use the normal end().
Parameters:
paPoint A.
pbPoint B.
Returns:
A path_iterator pointing to the beginning of the path.

Get an iterator from point A to point B.

Note:
There is no path_end(), use the normal end().
Parameters:
paPoint A.
pbPoint B.
Returns:
A const_path_iterator pointing to the beginning of the path.

Get an iterator to go through all elements in a given range.

Note:
There is no range_end(), use the normal end().
Parameters:
posThe center of the area.
rangeThe max 1-dimensional distance from pos.
Returns:
A range_iterator to go through all elements within range of pos.

Get an iterator to go through all elements in a given range.

Note:
There is no range_end(), use the normal end().
Parameters:
posThe center of the area.
rangeThe max 1-dimensional distance from pos.
Returns:
A const_range_iterator to go through all elements within range of pos.

Get an iterator to go through all elements within a given box.

Note:
There is no range_end(), use the normal end().
Parameters:
lowOne corner of the area.
highThe opposite corner of the area.
Returns:
A range_iterator to go through all elements in a box bounded by low and high.

Get an iterator to go through all elements within a given box.

Note:
There is no range_end(), use the normal end().
Parameters:
lowOne corner of the area.
highThe opposite corner of the area.
Returns:
A range_iterator to go through all elements in a box bounded by low and high.

Resize the container to hold at least n elements.

Parameters:
nThe number of elements the container is expected to hold.

Get the size of the container.

Returns:
The number of elements in the container.
void concept::stl::container::swap ( container c) [inherited]

Swap method.

Swap contents with another container.

Parameters:
objThe container to swap.

The documentation for this class was generated from the following file:


© 2012   AshTL
Licensed under  AGPLv3
Hosted by  Get AshTL at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated by  doxygen 1.7.4