mCRL2
Loading...
Searching...
No Matches
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant > Class Template Reference

An iterator over all elements in the unordered set. More...

#include <unordered_set.h>

Inheritance diagram for mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >:

Public Types

using value_type = Key
 
using reference = typename std::conditional< Constant, const Key &, Key & >::type
 
using pointer = typename std::conditional< Constant, const Key *, Key * >::type
 
using difference_type = std::ptrdiff_t
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 unordered_set_iterator ()=default
 
 operator unordered_set_iterator< Bucket, true > () const
 
unordered_set_iteratoroperator++ ()
 
unordered_set_iterator operator++ (int)
 
reference operator* () const
 
pointer operator-> () const
 
bool operator!= (const unordered_set_iterator &other) const
 
bool operator== (const unordered_set_iterator &other) const
 

Private Types

using bucket_it = typename std::vector< Bucket >::const_iterator
 
using key_it_type = typename Bucket::const_iterator
 

Private Member Functions

 unordered_set_iterator (bucket_it it, bucket_it end, key_it_type before_it, key_it_type key)
 Construct an iterator over all keys passed in this bucket and all remaining buckets.
 
 unordered_set_iterator (bucket_it it, bucket_it end)
 Construct the begin iterator (over all elements).
 
 unordered_set_iterator (bucket_it it)
 Construct the end iterator.
 
 operator unordered_set_iterator< Bucket, false > () const
 
key_it_typekey_before_it ()
 
key_it_typekey_it ()
 
bucket_itget_bucket_it ()
 
void goto_next_bucket ()
 Iterate to the next non-empty bucket.
 

Private Attributes

bucket_it m_bucket_it
 
bucket_it m_bucket_end
 
key_it_type m_key_before_it
 
key_it_type m_key_it
 

Friends

class unordered_set
 
template<typename Key_ , typename T , typename Hash_ , typename KeyEqual , typename Allocator_ , bool ThreadSafe_, bool Resize_>
class unordered_map
 

Detailed Description

template<typename Key, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket, bool Constant>
class mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >

An iterator over all elements in the unordered set.

Definition at line 91 of file unordered_set.h.

Member Typedef Documentation

◆ bucket_it

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::bucket_it = typename std::vector<Bucket>::const_iterator
private

Definition at line 99 of file unordered_set.h.

◆ difference_type

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::difference_type = std::ptrdiff_t

Definition at line 106 of file unordered_set.h.

◆ iterator_category

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::iterator_category = std::forward_iterator_tag

Definition at line 107 of file unordered_set.h.

◆ key_it_type

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::key_it_type = typename Bucket::const_iterator
private

Definition at line 100 of file unordered_set.h.

◆ pointer

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::pointer = typename std::conditional<Constant, const Key*, Key*>::type

Definition at line 105 of file unordered_set.h.

◆ reference

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::reference = typename std::conditional<Constant, const Key&, Key&>::type

Definition at line 104 of file unordered_set.h.

◆ value_type

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
using mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::value_type = Key

Definition at line 103 of file unordered_set.h.

Constructor & Destructor Documentation

◆ unordered_set_iterator() [1/4]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::unordered_set_iterator ( )
default

◆ unordered_set_iterator() [2/4]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::unordered_set_iterator ( bucket_it  it,
bucket_it  end,
key_it_type  before_it,
key_it_type  key 
)
inlineprivate

Construct an iterator over all keys passed in this bucket and all remaining buckets.

Definition at line 153 of file unordered_set.h.

◆ unordered_set_iterator() [3/4]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::unordered_set_iterator ( bucket_it  it,
bucket_it  end 
)
inlineprivate

Construct the begin iterator (over all elements).

Definition at line 158 of file unordered_set.h.

◆ unordered_set_iterator() [4/4]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::unordered_set_iterator ( bucket_it  it)
inlineexplicitprivate

Construct the end iterator.

Definition at line 165 of file unordered_set.h.

Member Function Documentation

◆ get_bucket_it()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
bucket_it & mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::get_bucket_it ( )
inlineprivate
Returns
A reference to the bucket iterator.

Definition at line 181 of file unordered_set.h.

◆ goto_next_bucket()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
void mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::goto_next_bucket ( )
inlineprivate

Iterate to the next non-empty bucket.

Definition at line 184 of file unordered_set.h.

◆ key_before_it()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
key_it_type & mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::key_before_it ( )
inlineprivate
Returns
A reference to the before key iterator.

Definition at line 175 of file unordered_set.h.

◆ key_it()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
key_it_type & mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::key_it ( )
inlineprivate
Returns
A reference to the key iterator.

Definition at line 178 of file unordered_set.h.

◆ operator unordered_set_iterator< Bucket, false >()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator unordered_set_iterator< Bucket, false > ( ) const
inlineprivate

Definition at line 169 of file unordered_set.h.

◆ operator unordered_set_iterator< Bucket, true >()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator unordered_set_iterator< Bucket, true > ( ) const
inline

Definition at line 111 of file unordered_set.h.

◆ operator!=()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
bool mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator!= ( const unordered_set_iterator< Bucket, Constant > &  other) const
inline

Definition at line 141 of file unordered_set.h.

◆ operator*()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
reference mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator* ( ) const
inline

Definition at line 131 of file unordered_set.h.

◆ operator++() [1/2]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
unordered_set_iterator & mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator++ ( )
inline

Definition at line 116 of file unordered_set.h.

◆ operator++() [2/2]

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
unordered_set_iterator mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator++ ( int  )
inline

Definition at line 124 of file unordered_set.h.

◆ operator->()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
pointer mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator-> ( ) const
inline

Definition at line 136 of file unordered_set.h.

◆ operator==()

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
bool mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::operator== ( const unordered_set_iterator< Bucket, Constant > &  other) const
inline

Definition at line 146 of file unordered_set.h.

Friends And Related Symbol Documentation

◆ unordered_map

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
template<typename Key_ , typename T , typename Hash_ , typename KeyEqual , typename Allocator_ , bool ThreadSafe_, bool Resize_>
friend class unordered_map
friend

Definition at line 97 of file unordered_set.h.

◆ unordered_set

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
friend class unordered_set
friend

Definition at line 94 of file unordered_set.h.

Member Data Documentation

◆ m_bucket_end

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
bucket_it mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::m_bucket_end
private

Definition at line 209 of file unordered_set.h.

◆ m_bucket_it

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
bucket_it mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::m_bucket_it
private

Definition at line 208 of file unordered_set.h.

◆ m_key_before_it

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
key_it_type mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::m_key_before_it
private

Definition at line 210 of file unordered_set.h.

◆ m_key_it

template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, bool ThreadSafe = false, bool Resize = true>
template<typename Bucket , bool Constant>
key_it_type mcrl2::utilities::unordered_set< Key, Hash, Equals, Allocator, ThreadSafe, Resize >::unordered_set_iterator< Bucket, Constant >::m_key_it
private

Definition at line 211 of file unordered_set.h.


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