concurrent_unordered_map 类
concurrent_unordered_map 类是控制 std::pair<const _Key_type, _Element_type> 类型的元素的长短不一序列的并发安全容器。 序列以某种方式显示,该方式支持并发安全追加、元素访问、迭代器访问和迭代器遍历操作。
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> >;
参数
_Key_type
键类型。_Element_type
映射类型。_Hasher
哈希函数对象类型。 该参数是可选的并且默认值为 std::tr1::hash<_Key_type**>**。_Key_equality
相等比较函数对象类型。 该参数是可选的并且默认值为 std::equal_to<_Key_type**>**。_Allocator_type
表示存储分配器对象的类型,该对象封装有关为并发无序映射分配和解除分配内存的详细信息。 该参数是可选的并且默认值为 std::allocator<std::pair<_Key_type, _Element_type**>>**。
成员
公共 Typedefs
名称 |
描述 |
---|---|
allocator_type |
用于管理存储的分配器的类型。 |
const_iterator |
受控序列的常量迭代器的类型。 |
const_local_iterator |
受控序列的常量存储桶迭代器的类型。 |
const_pointer |
元素的常量指针的类型。 |
const_reference |
元素的常量引用的类型。 |
difference_type |
两个元素间的带符号距离的类型。 |
hasher |
哈希函数的类型。 |
iterator |
受控序列的迭代器的类型。 |
key_equal |
比较函数的类型。 |
key_type |
排序键的类型。 |
local_iterator |
受控序列的存储桶迭代器的类型。 |
mapped_type |
与每个键关联的映射值的类型。 |
pointer |
元素的指针的类型。 |
reference |
元素的引用的类型。 |
size_type |
两个元素间的无符号距离的类型。 |
value_type |
元素的类型。 |
公共构造函数
名称 |
描述 |
---|---|
已重载。 构造并发无序的映射。 |
公共方法
名称 |
描述 |
---|---|
已重载。 在 concurrent_unordered_map 中查找具有指定键值的元素。 此方法是并发安全方法。 |
|
获取存储的哈希函数对象。 |
|
已重载。 将元素添加到 concurrent_unordered_map 对象。 |
|
获取存储的相等比较函数对象。 |
|
交换两个 concurrent_unordered_map 对象的内容。 此方法不是并发安全方法。 |
|
已重载。 移除指定位置处的 concurrent_unordered_map 元素。 此方法不是并发安全方法。 |
公共运算符
名称 |
描述 |
---|---|
已重载。 查找或插入具有指定键的元素。 此方法是并发安全方法。 |
|
已重载。 将另一 concurrent_unordered_map 对象的内容分配到此对象中。 此方法不是并发安全方法。 |
备注
有关 concurrent_unordered_map 类的详细信息,请参见 并行容器和对象。
继承层次结构
_Traits
_Concurrent_hash
concurrent_unordered_map
要求
**头文件:**concurrent_unordered_map.h
**命名空间:**并发