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 的元素具有指定的键值。此方法是并发安全方法。 |
|
返回指向在并发容器的第一个元素的迭代器。此方法是并发安全方法。 |
|
返回指向在并发容器的第一个元素的 const 迭代器。此方法是并发安全方法。 |
|
返回指向位置的 const 迭代器成功最后一个元素在并发容器。此方法是并发安全方法。 |
|
清除在并发容器的所有元素。此功能不是并发安全方法。 |
|
计数与指定的键的元素的数目。此功能是并发安全方法。 |
|
测试组件是否不存在。此方法是并发安全方法。 |
|
返回指向位置的迭代器成功最后一个元素在并发容器。此方法是并发安全方法。 |
|
查找与指定的键的范围。此功能是并发安全方法。 |
|
查找与指定键匹配的元素。此功能是并发安全方法。 |
|
返回此并发容器的存储分配程序对象。此方法是并发安全方法。 |
|
获取存储的哈希函数对象。 |
|
已重载。将元素添加到 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
**命名空间:**并发