proxygen
folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt > Struct Template Reference

#include <AtomicHashMap-inl.h>

Inheritance diagram for folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >:

Public Member Functions

 ahm_iterator ()
 
template<class OtherContT , class OtherVal , class OtherSubIt >
 ahm_iterator (const ahm_iterator< OtherContT, OtherVal, OtherSubIt > &o, typename std::enable_if< std::is_convertible< OtherSubIt, SubIt >::value >::type *=nullptr)
 
uint32_t getIndex () const
 

Private Member Functions

 ahm_iterator (ContT *ahm, uint32_t subMap, const SubIt &subIt)
 
void increment ()
 
bool equal (const ahm_iterator &other) const
 
IterVal & dereference () const
 
bool isEnd () const
 
void checkAdvanceToNextSubmap ()
 

Private Attributes

ContT * ahm_
 
uint32_t subMap_
 
SubIt subIt_
 

Friends

class AtomicHashMap
 

Detailed Description

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
struct folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >

Definition at line 561 of file AtomicHashMap-inl.h.

Constructor & Destructor Documentation

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::ahm_iterator ( )
inlineexplicit

Definition at line 573 of file AtomicHashMap-inl.h.

573 : ahm_(nullptr) {}
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
template<class OtherContT , class OtherVal , class OtherSubIt >
folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::ahm_iterator ( const ahm_iterator< OtherContT, OtherVal, OtherSubIt > &  o,
typename std::enable_if< std::is_convertible< OtherSubIt, SubIt >::value >::type = nullptr 
)
inline
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::ahm_iterator ( ContT *  ahm,
uint32_t  subMap,
const SubIt &  subIt 
)
inlineexplicitprivate

Member Function Documentation

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
void folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::checkAdvanceToNextSubmap ( )
inlineprivate

Definition at line 627 of file AtomicHashMap-inl.h.

References folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::begin(), and folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::end().

627  {
628  if (isEnd()) {
629  return;
630  }
631 
632  SubMap* thisMap = ahm_->subMaps_[subMap_].load(std::memory_order_relaxed);
633  while (subIt_ == thisMap->end()) {
634  // This sub iterator is done, advance to next one
635  if (subMap_ + 1 <
636  ahm_->numMapsAllocated_.load(std::memory_order_acquire)) {
637  ++subMap_;
638  thisMap = ahm_->subMaps_[subMap_].load(std::memory_order_relaxed);
639  subIt_ = thisMap->begin();
640  } else {
641  ahm_ = nullptr;
642  return;
643  }
644  }
645  }
AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn > SubMap
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
IterVal& folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::dereference ( ) const
inlineprivate

Definition at line 619 of file AtomicHashMap-inl.h.

619  {
620  return *subIt_;
621  }
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
bool folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::equal ( const ahm_iterator< ContT, IterVal, SubIt > &  other) const
inlineprivate
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
uint32_t folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::getIndex ( ) const
inline

Definition at line 589 of file AtomicHashMap-inl.h.

Referenced by TEST().

589  {
590  CHECK(!isEnd());
591  return ahm_->encodeIndex(subMap_, subIt_.getIndex());
592  }
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
void folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::increment ( )
inlineprivate

Definition at line 601 of file AtomicHashMap-inl.h.

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
bool folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::isEnd ( ) const
inlineprivate

Friends And Related Function Documentation

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
friend class AtomicHashMap
friend

Definition at line 595 of file AtomicHashMap-inl.h.

Member Data Documentation

template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
ContT* folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::ahm_
private
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
SubIt folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::subIt_
private
template<class KeyT, class ValueT, class HashFcn, class EqualFcn, class Allocator, class ProbeFcn, class KeyConvertFcn>
template<class ContT, class IterVal, class SubIt>
uint32_t folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::ahm_iterator< ContT, IterVal, SubIt >::subMap_
private

The documentation for this struct was generated from the following file: