|
typedef Key | key_type |
|
typedef T | mapped_type |
|
typedef std::pair< const Key, T > | value_type |
|
typedef hash_map_base::size_type | size_type |
|
typedef ptrdiff_t | difference_type |
|
typedef value_type * | pointer |
|
typedef const value_type * | const_pointer |
|
typedef value_type & | reference |
|
typedef const value_type & | const_reference |
|
typedef internal::hash_map_iterator< concurrent_hash_map, value_type > | iterator |
|
typedef internal::hash_map_iterator< concurrent_hash_map, const value_type > | const_iterator |
|
typedef internal::hash_map_range< iterator > | range_type |
|
typedef internal::hash_map_range< const_iterator > | const_range_type |
|
typedef Allocator | allocator_type |
|
|
| concurrent_hash_map (const allocator_type &a=allocator_type()) |
| Construct empty table.
|
|
| concurrent_hash_map (size_type n, const allocator_type &a=allocator_type()) |
| Construct empty table with n preallocated buckets. This number serves also as initial concurrency level.
|
|
| concurrent_hash_map (const concurrent_hash_map &table, const allocator_type &a=allocator_type()) |
| Copy constructor.
|
|
template<typename I > |
| concurrent_hash_map (I first, I last, const allocator_type &a=allocator_type()) |
| Construction with copying iteration range and given allocator instance.
|
|
concurrent_hash_map & | operator= (const concurrent_hash_map &table) |
| Assignment.
|
|
void | rehash (size_type n=0) |
| Rehashes and optionally resizes the whole table. More...
|
|
void | clear () |
| Clear table.
|
|
| ~concurrent_hash_map () |
| Clear table and destroy it.
|
|
range_type | range (size_type grainsize=1) |
|
const_range_type | range (size_type grainsize=1) const |
|
iterator | begin () |
|
iterator | end () |
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
std::pair< iterator, iterator > | equal_range (const Key &key) |
|
std::pair< const_iterator, const_iterator > | equal_range (const Key &key) const |
|
size_type | size () const |
| Number of items in table.
|
|
bool | empty () const |
| True if size()==0.
|
|
size_type | max_size () const |
| Upper bound on size.
|
|
size_type | bucket_count () const |
| Returns the current number of buckets.
|
|
allocator_type | get_allocator () const |
| return allocator object
|
|
void | swap (concurrent_hash_map &table) |
| swap two instances. Iterators are invalidated
|
|
size_type | count (const Key &key) const |
| Return count of items (0 or 1)
|
|
bool | find (const_accessor &result, const Key &key) const |
| Find item and acquire a read lock on the item. More...
|
|
bool | find (accessor &result, const Key &key) |
| Find item and acquire a write lock on the item. More...
|
|
bool | insert (const_accessor &result, const Key &key) |
| Insert item (if not already present) and acquire a read lock on the item. More...
|
|
bool | insert (accessor &result, const Key &key) |
| Insert item (if not already present) and acquire a write lock on the item. More...
|
|
bool | insert (const_accessor &result, const value_type &value) |
| Insert item by copying if there is no such key present already and acquire a read lock on the item. More...
|
|
bool | insert (accessor &result, const value_type &value) |
| Insert item by copying if there is no such key present already and acquire a write lock on the item. More...
|
|
bool | insert (const value_type &value) |
| Insert item by copying if there is no such key present already. More...
|
|
template<typename I > |
void | insert (I first, I last) |
| Insert range [first, last)
|
|
bool | erase (const Key &key) |
| Erase item. More...
|
|
bool | erase (const_accessor &item_accessor) |
| Erase item by const_accessor. More...
|
|
bool | erase (accessor &item_accessor) |
| Erase item by accessor. More...
|
|
|
void | delete_node (node_base *n) |
|
node * | search_bucket (const key_type &key, bucket *b) const |
|
void | rehash_bucket (bucket *b_new, const hashcode_t h) |
|
bool | lookup (bool op_insert, const Key &key, const T *t, const_accessor *result, bool write, node *(*allocate_node)(node_allocator_type &, const Key &, const T *), node *tmp_n=0) |
| Insert or find item and optionally acquire a lock on the item.
|
|
bool | exclude (const_accessor &item_accessor) |
| delete item by accessor
|
|
template<typename I > |
std::pair< I, I > | internal_equal_range (const Key &key, I end) const |
| Returns an iterator for an item defined by the key, or for the next item after it (if upper==true)
|
|
void | internal_copy (const concurrent_hash_map &source) |
| Copy "source" to *this, where *this must start out empty.
|
|
template<typename I > |
void | internal_copy (I first, I last) |
|
const_pointer | internal_fast_find (const Key &key) const |
| Fast find when no concurrent erasure is used. For internal use inside TBB only! More...
|
|
template<typename Key, typename T, typename HashCompare, typename Allocator>
class tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >
Unordered map from Key to T.
concurrent_hash_map is associative container with concurrent access.
- Compatibility
- The class meets all Container Requirements from C++ Standard (See ISO/IEC 14882:2003(E), clause 23.1).
- Exception Safety
- Hash function is not permitted to throw an exception. User-defined types Key and T are forbidden from throwing an exception in destructors.
- If exception happens during insert() operations, it has no effect (unless exception raised by HashCompare::hash() function during grow_segment).
- If exception happens during operator=() operation, the container can have a part of source items, and methods size() and empty() can return wrong results.
- Changes since TBB 2.1
- Replaced internal algorithm and data structure. Patent is pending.
- Added buckets number argument for constructor
- Changes since TBB 2.0
- Fixed exception-safety
- Added template argument for allocator
- Added allocator argument in constructors
- Added constructor from a range of iterators
- Added several new overloaded insert() methods
- Added get_allocator()
- Added swap()
- Added count()
- Added overloaded erase(accessor &) and erase(const_accessor&)
- Added equal_range() [const]
- Added [const_]pointer, [const_]reference, and allocator_type types
- Added global functions: operator==(), operator!=(), and swap()
template<typename Key, typename T, typename HashCompare, typename Allocator>
Fast find when no concurrent erasure is used. For internal use inside TBB only!
Return pointer to item with given key, or NULL if no such item exists. Must not be called concurrently with erasure operations.