Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor Class Reference

Combines data access, locking, and garbage collection. More...

#include <concurrent_hash_map.h>

Inheritance diagram for tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor:
Collaboration diagram for tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor:

Public Member Functions

bool empty () const
 True if result is empty. More...
 
void release ()
 Set to null. More...
 
const_reference operator* () const
 Return reference to associated value in hash table. More...
 
const_pointer operator-> () const
 Return pointer to associated value in hash table. More...
 
 const_accessor ()
 Create empty result. More...
 
 ~const_accessor ()
 Destroy result after releasing the underlying reference. More...
 

Public Attributes

const typedef concurrent_hash_map::value_type value_type
 Type of value. More...
 

Protected Member Functions

bool is_writer ()
 

Protected Attributes

nodemy_node
 
hashcode_t my_hash
 

Friends

class concurrent_hash_map< Key, T, HashCompare, Allocator >
 
class accessor
 

Detailed Description

template<typename Key, typename T, typename HashCompare, typename Allocator>
class tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor

Combines data access, locking, and garbage collection.

Definition at line 769 of file concurrent_hash_map.h.

Constructor & Destructor Documentation

◆ const_accessor()

template<typename Key , typename T , typename HashCompare , typename Allocator >
tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::const_accessor ( )
inline

Create empty result.

Definition at line 799 of file concurrent_hash_map.h.

799 : my_node(NULL) {}

◆ ~const_accessor()

template<typename Key , typename T , typename HashCompare , typename Allocator >
tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::~const_accessor ( )
inline

Destroy result after releasing the underlying reference.

Definition at line 802 of file concurrent_hash_map.h.

802  {
803  my_node = NULL; // scoped lock's release() is called in its destructor
804  }

References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node.

Member Function Documentation

◆ empty()

template<typename Key , typename T , typename HashCompare , typename Allocator >
bool tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::empty ( ) const
inline

True if result is empty.

Definition at line 777 of file concurrent_hash_map.h.

777 { return !my_node; }

References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node.

◆ is_writer()

template<typename Key , typename T , typename HashCompare , typename Allocator >
bool tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::is_writer ( )
inlineprotected

Definition at line 806 of file concurrent_hash_map.h.

806 { return node::scoped_t::is_writer; }

Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::exclude().

Here is the caller graph for this function:

◆ operator*()

template<typename Key , typename T , typename HashCompare , typename Allocator >
const_reference tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::operator* ( ) const
inline

Return reference to associated value in hash table.

Definition at line 788 of file concurrent_hash_map.h.

788  {
789  __TBB_ASSERT( my_node, "attempt to dereference empty accessor" );
790  return my_node->value();
791  }

References __TBB_ASSERT, tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node, and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::node::value().

Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::operator->().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator->()

template<typename Key , typename T , typename HashCompare , typename Allocator >
const_pointer tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::operator-> ( ) const
inline

Return pointer to associated value in hash table.

Definition at line 794 of file concurrent_hash_map.h.

794  {
795  return &operator*();
796  }

References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::operator*().

Here is the call graph for this function:

◆ release()

template<typename Key , typename T , typename HashCompare , typename Allocator >
void tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::release ( )
inline

Set to null.

Definition at line 780 of file concurrent_hash_map.h.

780  {
781  if( my_node ) {
783  my_node = 0;
784  }
785  }

References tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_node, and tbb::release.

Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::exclude(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::find(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::insert().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ accessor

template<typename Key , typename T , typename HashCompare , typename Allocator >
friend class accessor
friend

Definition at line 771 of file concurrent_hash_map.h.

◆ concurrent_hash_map< Key, T, HashCompare, Allocator >

template<typename Key , typename T , typename HashCompare , typename Allocator >
friend class concurrent_hash_map< Key, T, HashCompare, Allocator >
friend

Definition at line 770 of file concurrent_hash_map.h.

Member Data Documentation

◆ my_hash

template<typename Key , typename T , typename HashCompare , typename Allocator >
hashcode_t tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::my_hash
protected

◆ my_node

◆ value_type

template<typename Key , typename T , typename HashCompare , typename Allocator >
const typedef concurrent_hash_map::value_type tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::const_accessor::value_type

Type of value.

Definition at line 774 of file concurrent_hash_map.h.


The documentation for this class was generated from the following file:
tbb::interface5::concurrent_hash_map::node::value
value_type & value()
Definition: concurrent_hash_map.h:620
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::interface5::concurrent_hash_map::const_accessor::operator*
const_reference operator*() const
Return reference to associated value in hash table.
Definition: concurrent_hash_map.h:788
tbb::release
@ release
Release.
Definition: atomic.h:59
tbb::interface5::concurrent_hash_map::const_accessor::my_node
node * my_node
Definition: concurrent_hash_map.h:807

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.