Partager via


concurrent_unordered_map Class

The concurrent_unordered_map class is a concurrency-safe container that controls a varying-length sequence of elements of type std::pair<const _Key_type, _Element_type>. The sequence is represented in a way that enables concurrency-safe append, element access, iterator access, and iterator traversal operations.

template <
   typename _Key_type,
   typename _Element_type,
   typename _Hasher = std::tr1::hash<_Key_type>,
   typename _Key_equality = std::equal_to<_Key_type>,
   typename _Allocator_type = std::allocator<std::pair<const _Key_type,
   _Element_type> >
>
, typename _Key_equality = std::equal_to<_Key_type>, typename _Allocator_type = std::allocator<std::pair<const _Key_type, _Element_type> > > class concurrent_unordered_map : public details::_Concurrent_hash< details::_Concurrent_unordered_map_traits<_Key_type, _Element_type, details::_Hash_compare<_Key_type, _Hasher, _Key_equality>, _Allocator_type, false> >;

Parameters

  • _Key_type
    The key type.

  • _Element_type
    The mapped type.

  • _Hasher
    The hash function object type. This argument is optional and the default value is std::tr1::hash<_Key_type**>**.

  • _Key_equality
    The equality comparison function object type. This argument is optional and the default value is std::equal_to<_Key_type**>**.

  • _Allocator_type
    The type that represents the stored allocator object that encapsulates details about the allocation and deallocation of memory for the concurrent unordered map. This argument is optional and the default value is std::allocator<std::pair<_Key_type, _Element_type**>>**.

Members

Public Typedefs

Name

Description

allocator_type

The type of an allocator for managing storage.

const_iterator

The type of a constant iterator for the controlled sequence.

const_local_iterator

The type of a constant bucket iterator for the controlled sequence.

const_pointer

The type of a constant pointer to an element.

const_reference

The type of a constant reference to an element.

difference_type

The type of a signed distance between two elements.

hasher

The type of the hash function.

iterator

The type of an iterator for the controlled sequence.

key_equal

The type of the comparison function.

key_type

The type of an ordering key.

local_iterator

The type of a bucket iterator for the controlled sequence.

mapped_type

The type of a mapped value associated with each key.

pointer

The type of a pointer to an element.

reference

The type of a reference to an element.

size_type

The type of an unsigned distance between two elements.

value_type

The type of an element.

Public Constructors

Name

Description

concurrent_unordered_map::concurrent_unordered_map Constructor

Overloaded. Constructs a concurrent unordered map.

Public Methods

Name

Description

concurrent_unordered_map::at Method

Overloaded. Finds an element in a concurrent_unordered_map with a specified key value.. This method is concurrency-safe.

concurrent_unordered_map::hash_function Method

Gets the stored hash function object.

concurrent_unordered_map::insert Method

Overloaded. Adds elements to the concurrent_unordered_map object.

concurrent_unordered_map::key_eq Method

Gets the stored equality comparison function object.

concurrent_unordered_map::swap Method

Swaps the contents of two concurrent_unordered_map objects. This method is not concurrency-safe.

concurrent_unordered_map::unsafe_erase Method

Overloaded. Removes elements from the concurrent_unordered_map at specified positions. This method is not concurrency-safe.

Public Operators

Name

Description

concurrent_unordered_map::operator[] Operator

Overloaded. Finds or inserts an element with the specified key. This method is concurrency-safe.

concurrent_unordered_map::operator= Operator

Overloaded. Assigns the contents of another concurrent_unordered_map object to this one. This method is not concurrency-safe.

Remarks

For detailed information on the concurrent_unordered_map class, see Parallel Containers and Objects.

Inheritance Hierarchy

_Traits

_Concurrent_hash

concurrent_unordered_map

Requirements

Header: concurrent_unordered_map.h

Namespace: concurrency

See Also

Reference

concurrency Namespace

Concepts

Parallel Containers and Objects