SpiecsEngine
 
Loading...
Searching...
No Matches

◆ push_back()

template<typename K , typename V >
void scl::linked_unordered_map< K, V >::push_back ( const K & key,
const V & value )
inline

Add a element to this container.

Parameters
[in]keyK the key.
[in]valueV the value.

Definition at line 180 of file LinkedUnorderedMap.h.

181 {
182 bool hasKey = has_key(key);
183
184 std::unique_lock<std::shared_mutex> lock(m_Mutex);
185
186 if (!hasKey)
187 {
188 m_Keys.push_back(key);
189
190 ++m_Size;
191 }
192
193 m_Map[key] = value;
194 }
std::shared_mutex m_Mutex
Mutex for this container.
std::unordered_map< K, V > m_Map
bool has_key(const K &key)
Determine whether the key is in the container.
std::list< K > m_Keys
The container keeps iter in order.
std::atomic_int m_Size
This container size.

References scl::linked_unordered_map< K, V >::has_key().