The container combines hashmap and list together. Used in the case that we want iter a hashmap in order. Thread Safe. More...
#include <LinkedUnorderedMap.h>
Public Member Functions | |
| linked_unordered_map () | |
| Constructor Function. | |
| virtual | ~linked_unordered_map ()=default |
| Destructor Function. | |
| bool | has_equal_size () |
| Determine whether the container's element size is same. | |
| void | clear () |
| Clear this container's data. | |
| size_t | size () |
| The container's element size. | |
| void | push_back (const K &key, const V &value) |
| Add a element to this container. | |
| V * | find_value (const K &key) |
| Find the value by key. | |
| bool | has_key (const K &key) |
| Determine whether the key is in the container. | |
| void | erase (const K &key) |
| Remove a element inside the container if founded by key. | |
| template<typename F > | |
| void | for_each (F &fn) |
| Iter the container in order. | |
| template<typename F > | |
| void | for_each (F &&fn) |
| Iter the container in order. | |
| V * | prev_value (const K &key) |
| Get the previous element by the key. | |
| V * | next_value (const K &key) |
| Get the next element by the key. | |
| V * | first () |
| Get the first element of this container. | |
| V * | end () |
| Get the end element of this container. | |
| K * | end_k () |
Private Attributes | |
| std::list< K > | m_Keys |
| The container keeps iter in order. | |
| std::unordered_map< K, V > | m_Map |
| std::shared_mutex | m_Mutex |
| Mutex for this container. | |
| std::atomic_int | m_Size |
| This container size. | |
The container combines hashmap and list together. Used in the case that we want iter a hashmap in order. Thread Safe.
Definition at line 23 of file LinkedUnorderedMap.h.