Lightweight c++11 dictionary map implementation.
More...
#include <mn_basic_light_map.hpp>
|
| basic_light_map (const size_type start_size=32) noexcept |
|
| ~basic_light_map () |
|
void | clear () |
|
template<class... Args> |
mn::container::pair< iterator, bool > | assign (const key_type &key, Args &&... args) |
|
mn::container::pair< iterator, bool > | assign (const value_type &vValue) |
|
template<class... Args> |
mn::container::pair< iterator, bool > | emplace (const key_type &key, Args &&... args) |
| Inserts a new element into the container constructed in-place with the given args if there is no element with the key in the container. More...
|
|
mn::container::pair< iterator, bool > | insert (const value_type &value) |
| Inserts value. More...
|
|
template<class... Args> |
void | insert_or_assign (const key_type &key, Args &&... args) |
|
bool | insert (const key_type &key, const mapped_type &value) |
| insert key_type key with mapped_type value. More...
|
|
bool | insert (key_type &&key, mapped_type &&value) |
| insert key_type key with mapped_type value. More...
|
|
iterator | erase (const_iterator pos) |
| Removes specified elements from the container. More...
|
|
iterator | erase (const_iterator first, const_iterator last) |
| Removes specified elements from the container. More...
|
|
size_type | erase (const key_type &tKey) |
| Removes the element with the key equivalent to tKey. More...
|
|
iterator | find (const key_type &tKey) noexcept |
| Finds an element with key equivalent to key. More...
|
|
const_iterator | find (const key_type &tKey) const noexcept |
| Finds an element with key equivalent to key. More...
|
|
constexpr bool | empty () const noexcept |
| Is the map empty. More...
|
|
constexpr size_type | size () const noexcept |
| Get the number of map-members. More...
|
|
size_type | count (const key_type &key) const |
| Returns the number of elements with key key. More...
|
|
void | swap (self_type &other) |
| Exchanges the contents of the container with those of other. More...
|
|
iterator | operator[] (const key_type &tKey) noexcept |
| Read value of map for given key. More...
|
|
const_iterator | operator[] (const key_type &tKey) const noexcept |
| Read value of map for given key. More...
|
|
template<class TKey, class TValue, class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
class mn::container::basic_light_map< TKey, TValue, TALLOCATOR, TPairType, TContainer >
Lightweight c++11 dictionary map implementation.
- Template Parameters
-
TKey | The type for the key. |
TValue | The type for the value. |
TPairType | The using type for the Key:Value-pair. |
TArrayType | The using type for holding the pairs. |
◆ const_iterator
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ const_pointer
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ const_reference
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ difference_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ iterator
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ key_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ mapped_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ pointer
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ reference
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ self_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ size_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ value_type
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ basic_light_map()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ ~basic_light_map()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ assign() [1/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
template<class... Args>
◆ assign() [2/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ clear()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
◆ count()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Returns the number of elements with key key.
- Parameters
-
key | Value of the elements to count. |
- Returns
- Number of elements with key that compares equivalent to key, which is either 1 or 0.
◆ emplace()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
template<class... Args>
Inserts a new element into the container constructed in-place with the given args if there is no element with the key in the container.
- Parameters
-
key | The key to emplace. |
args | arguments to forward to the constructor of the element. |
- Returns
- Returns a pair consisting of an iterator to the inserted element, and a bool denoting whether the insertion took place (true if insertion happened and false if not).
◆ empty()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Is the map empty.
- Returns
- If true then is the map empty and if false then not.
◆ erase() [1/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Removes the element with the key equivalent to tKey.
- Parameters
-
tKey | value of the elements to remove. |
- Returns
- Number of elements removed (0 or 1).
◆ erase() [2/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Removes specified elements from the container.
- Parameters
-
first | The start of the range of elements to remove. |
last | The end of the range of elements to remove. |
- Returns
- Return the the last removed iterator.
◆ erase() [3/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Removes specified elements from the container.
- Parameters
-
pos | Iterator to the element to remove. |
- Returns
- Return the the last removed iterator.
◆ find() [1/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Finds an element with key equivalent to key.
- Parameters
-
tKey | The key value of the element to search for. |
- Returns
- The associerte value with this key, when not exist then return the setted alternative value.
◆ find() [2/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Finds an element with key equivalent to key.
- Parameters
-
tKey | The key value of the element to search for. |
- Returns
- The associerte value with this key, when not exist then return the end();
◆ insert() [1/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
insert key_type key with mapped_type value.
- Returns
- True: The key doesn't exist, the data is added to the map
- False: The key already exists, no change is made
◆ insert() [2/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Inserts value.
- Parameters
-
value | The element value to insert. |
- Returns
- Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.
◆ insert() [3/3]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
insert key_type key with mapped_type value.
- Returns
- True: The key doesn't exist, the data is added to the map
- False: The key already exists, no change is made
◆ insert_or_assign()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
template<class... Args>
◆ operator[]() [1/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Read value of map for given key.
- Parameters
-
- Returns
- The associerte value with this key, when not exist then return the setted alternative value.
◆ operator[]() [2/2]
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Read value of map for given key.
- Parameters
-
- Returns
- The associerte value with this key, when not exist then return the setted alternative value.
◆ size()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Get the number of map-members.
- Returns
- The number of map entries.
◆ swap()
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
Exchanges the contents of the container with those of other.
- Parameters
-
other | Container to exchange the contents with. |
◆ m_ayKeyValue
template<class TKey , class TValue , class TALLOCATOR = memory::default_allocator, class TPairType = mn::container::pair<TKey, TValue>, class TContainer = mn::container::vector<TPairType, TALLOCATOR>>
The documentation for this class was generated from the following file: