libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
#include <multimap.hpp>
Public Types | |
typedef _Cont | base_container |
typedef base_container::allocator_type | allocator_type |
typedef _Key | key_type |
typedef _Val | mapped_type |
typedef _Pred | key_compare |
typedef std::pair< const key_type, mapped_type > | value_type |
typedef base_container::difference_type | difference_type |
typedef base_container::reference | reference |
typedef base_container::const_reference | const_reference |
typedef base_container::size_type | size_type |
typedef base_container::const_iterator | const_iterator |
typedef base_container::iterator | iterator |
typedef base_container::reverse_iterator | reverse_iterator |
typedef base_container::const_reverse_iterator | const_reverse_iterator |
typedef std::pair< iterator, bool > | InsertItr_ |
This collection implementation is efficient when the inserts()
to the collection come in blocks, then the lookups (find()
or operator[]()
) in blocks, then the inserts(...)
again. This is because the collection only sorts itself when it is unsorted and a lookup occurs. Non-unique keys are allowed, and the groups of non-unique keys are adjacent (after sorting) then the range of the "unique" key is multiple values.
The complexity is (assuming default container of std::vector
, which affects these complexities):
std::vector
or std:list
. The choice will affect the complexities above. The advantage of std::vector
over std::list
is locality of reference: The data elements are guaranteed to be local to each other, unlike std::list
. Alternatively std:list
has better complexity than std::vector
for some of the operations. Choose wisely. Definition at line 44 of file multimap.hpp.
typedef base_container::allocator_type jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::allocator_type |
Definition at line 47 of file multimap.hpp.
typedef _Cont jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::base_container |
Definition at line 46 of file multimap.hpp.
typedef base_container::const_iterator jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::const_iterator |
Definition at line 56 of file multimap.hpp.
typedef base_container::const_reference jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::const_reference |
Definition at line 54 of file multimap.hpp.
typedef base_container::const_reverse_iterator jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::const_reverse_iterator |
Definition at line 59 of file multimap.hpp.
typedef base_container::difference_type jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::difference_type |
Definition at line 52 of file multimap.hpp.
typedef std::pair<iterator,bool> jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::InsertItr_ |
Definition at line 60 of file multimap.hpp.
typedef base_container::iterator jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::iterator |
Definition at line 57 of file multimap.hpp.
typedef _Pred jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::key_compare |
Definition at line 50 of file multimap.hpp.
typedef _Key jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::key_type |
Definition at line 48 of file multimap.hpp.
typedef _Val jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::mapped_type |
Definition at line 49 of file multimap.hpp.
typedef base_container::reference jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::reference |
Definition at line 53 of file multimap.hpp.
typedef base_container::reverse_iterator jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::reverse_iterator |
Definition at line 58 of file multimap.hpp.
typedef base_container::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::size_type |
Definition at line 55 of file multimap.hpp.
typedef std::pair<const key_type,mapped_type> jmmcg::LIBJMMCG_VER_NAMESPACE::rapid_insert_lookup::multimap< _Key, _Val, _Pred, _Cont >::value_type |
Definition at line 51 of file multimap.hpp.
|
inlineexplicit |
Definition at line 24 of file multimap_impl.hpp.
|
inline |
Definition at line 29 of file multimap_impl.hpp.
|
inline |
Definition at line 34 of file multimap_impl.hpp.
|
inline |
Definition at line 39 of file multimap_impl.hpp.
|
inline |
Definition at line 44 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 67 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 75 of file multimap_impl.hpp.
|
inline |
Definition at line 146 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 141 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 99 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 107 of file multimap_impl.hpp.
|
inline |
Erase: O(n).
Definition at line 197 of file multimap_impl.hpp.
|
inline |
Erase: O(n).
Definition at line 202 of file multimap_impl.hpp.
|
inline |
Erase: O(nlog(n)). All keys with same value are erased. Collection remains sorted.
Definition at line 233 of file multimap_impl.hpp.
|
inline |
Lookup: O(log(n)+(complexity of sorting a vector)), if unsorted, O(log(n)) if sorted, irrespective if the element is in the multimap or not. Are guaranteed to return the first key if they are not unique in the multimap.
Definition at line 261 of file multimap_impl.hpp.
|
inline |
Lookup: O(log(n)+(complexity of sorting a vector)), if unsorted, O(log(n)) if sorted, irrespective if the element is in the multimap or not. Are guaranteed to return the first key if they are not unique in the multimap.
Definition at line 275 of file multimap_impl.hpp.
|
inline |
Definition at line 168 of file multimap_impl.hpp.
|
inline |
Insert: (with insert()
) constant time. (But unsorts the multimap.) Allows the insertion of multiple keys with the same value, but different referents.
Definition at line 190 of file multimap_impl.hpp.
|
inline |
Insert: (with insert()
) constant time. (But unsorts the multimap.) Allows the insertion of multiple keys with the same value, but different referents.
Definition at line 182 of file multimap_impl.hpp.
|
inline |
Insert: (with insert()
) constant time. (But unsorts the multimap.) Allows the insertion of multiple keys with the same value, but different referents.
Definition at line 173 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 136 of file multimap_impl.hpp.
|
inline |
Definition at line 48 of file multimap_impl.hpp.
|
inline |
Lookup: O(log(n)+(complexity of sorting a vector)), if unsorted, O(log(n)) if sorted, irrespective if the element is in the multimap or not. Will only insert the key if it is not in the map, i.e. it will ensure keys are unique, but will be slower. Are guaranteed to return the first key if they are not unique in the multimap.
Definition at line 247 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 83 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 91 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 115 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 123 of file multimap_impl.hpp.
|
inline |
Definition at line 160 of file multimap_impl.hpp.
|
inline |
Definition at line 152 of file multimap_impl.hpp.
|
inlinenoexcept |
Definition at line 131 of file multimap_impl.hpp.