Wiselib
|
Container for key-based access to it's elements. More...
Inherits concepts::Container_concept.
Inherited by concepts::SortedAssociativeContainer_concept, and concepts::UniqueAssociativeContainer_concept.
Public Types | |
typedef mapped_type size_type | erase (const key_type &k) |
Type of values indexed by keys. | |
Public Member Functions | |
iterator | find (const key_type &k) |
Return an iterator to the element associated to the given key. | |
size_type | count (const key_type &) |
Return number of elements associated with the given key. | |
value_type & | operator[] (const key_type &k) |
Access the element identified by the given key. | |
iterator | begin () |
Return an iterator that points at the first element. | |
iterator | end () |
Return an iterator that points "after" the last element. | |
size_type | size () |
Return number of elements in the container. | |
size_type | max_size () |
Return maximum number of elements in the container. | |
bool | empty () |
Return true if the container is empty. | |
Public Attributes | |
typedef | key_type |
Type of keys of this container. | |
typedef | value_type |
Type of elements of the container. | |
typedef | iterator |
Type of the iterators returned by begin() and end(). | |
typedef | size_type |
Type of the element-counts returned by size() and maxsize(). |
Container for key-based access to it's elements.
A container that allows access to values by keys of arbitrary type. Note that the value_type is usually *not* the mapped_type (type of the values indexed by the keys) but a pair of key type and the mapped_type. In case multiple values can be associated to a single key, value_type should be something that can contain all of them plus the key.
typedef mapped_type size_type concepts::AssociativeContainer_concept::erase(const key_type &k) |
Type of values indexed by keys.
Erase value associated to the given key
iterator concepts::Container_concept::begin | ( | ) | [inherited] |
Return an iterator that points at the first element.
Return number of elements associated with the given key.
bool concepts::Container_concept::empty | ( | ) | [inline, inherited] |
Return true if the container is empty.
iterator concepts::Container_concept::end | ( | ) | [inherited] |
Return an iterator that points "after" the last element.
I.e. dereferencing this iterator does not need to work, but (equality) comparison to any iterator that has finished iterating over all elements of the container should yield true
Return an iterator to the element associated to the given key.
size_type concepts::Container_concept::max_size | ( | ) | [inherited] |
Return maximum number of elements in the container.
If the container is not limited in size, return 0.
value_type& concepts::AssociativeContainer_concept::operator[] | ( | const key_type & | k | ) |
Access the element identified by the given key.
size_type concepts::Container_concept::size | ( | ) | [inherited] |
Return number of elements in the container.
typedef concepts::Container_concept::iterator [inherited] |
Type of keys of this container.
typedef concepts::Container_concept::size_type [inherited] |
Type of the element-counts returned by size() and maxsize().
Usually an (unsigned) integer type.
typedef concepts::Container_concept::value_type [inherited] |
Type of elements of the container.