#include <stlsoft/containers/frequency_map.hpp>
T | The value type of the container | |
N | The count integer type. Defaults to uint32_t |
Public Types | |
typedef frequency_map< T, N > | class_type |
This type. | |
typedef map_type_::value_type | value_type |
The value type. | |
typedef map_type_::const_iterator | const_iterator |
The non-mutating (const) iterator type. | |
typedef map_type_::const_reference | const_reference |
The non-mutating (const) reference type. | |
typedef map_type_::key_type | key_type |
The key type. | |
typedef N | count_type |
The count type. | |
typedef size_t | size_type |
The size type. | |
typedef ss_ptrdiff_t | difference_type |
The difference type. | |
typedef bool | bool_type |
The boolean type. | |
Public Member Functions | |
frequency_map () | |
Creates an instance of the map. | |
count_type | push (key_type const &key) |
Pushes an entry onto the map. | |
void | clear () |
Removes all entries from the map. | |
class_type & | merge (class_type const &rhs) |
Merges in all entries from the given map. | |
void | swap (class_type &rhs) throw () |
Swaps the state of the given instance with this instance. | |
const_iterator | find (key_type const &key) const |
Returns an iterator for the entry representing the given key, or end() if no such entry exists. | |
count_type | operator[] (key_type const &key) const |
Returns the count associated with the entry representing the given key, or 0 if no such entry exists. | |
count_type | count (key_type const &key) const |
Returns the count associated with the entry representing the given key, or 0 if no such entry exists. | |
bool_type | empty () const |
Indicates whether the map is empty. | |
size_type | size () const |
The number of entries in the map. | |
const_iterator | begin () const |
A non-mutating (const) iterator representing the start of the sequence. | |
const_iterator | end () const |
A non-mutating (const) iterator representing the end-point of the sequence. |
typedef frequency_map<T, N> class_type |
This type.
typedef map_type_::value_type value_type |
The value type.
typedef map_type_::const_iterator const_iterator |
The non-mutating (const) iterator type.
typedef map_type_::const_reference const_reference |
The non-mutating (const) reference type.
typedef map_type_::key_type key_type |
The key type.
typedef N count_type |
The count type.
typedef ss_ptrdiff_t difference_type |
The difference type.
frequency_map | ( | ) | [inline] |
count_type push | ( | key_type const & | key | ) | [inline] |
Pushes an entry onto the map.
If the entry already exists in the map, its count will be increased by 1. If it does not previously exist, it will be added with an initial count of one
References ss_typename_param_k.
void clear | ( | ) | [inline] |
Removes all entries from the map.
class_type& merge | ( | class_type const & | rhs | ) | [inline] |
Merges in all entries from the given map.
References frequency_map::begin(), frequency_map::end(), frequency_map::m_map, and frequency_map::swap().
void swap | ( | class_type & | rhs | ) | throw () [inline] |
Swaps the state of the given instance with this instance.
References stlsoft::std_swap().
Referenced by frequency_map::merge().
const_iterator find | ( | key_type const & | key | ) | const [inline] |
Returns an iterator for the entry representing the given key, or end()
if no such entry exists.
count_type operator[] | ( | key_type const & | key | ) | const [inline] |
Returns the count associated with the entry representing the given key, or 0 if no such entry exists.
References frequency_map::count().
count_type count | ( | key_type const & | key | ) | const [inline] |
Returns the count associated with the entry representing the given key, or 0 if no such entry exists.
Referenced by frequency_map::operator[]().
bool_type empty | ( | ) | const [inline] |
Indicates whether the map is empty.
size_type size | ( | ) | const [inline] |
const_iterator begin | ( | ) | const [inline] |
A non-mutating (const) iterator representing the start of the sequence.
Referenced by frequency_map::merge().
const_iterator end | ( | ) | const [inline] |
A non-mutating (const) iterator representing the end-point of the sequence.
Referenced by frequency_map::merge().