mCRL2
Loading...
Searching...
No Matches
mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable > Class Template Reference

A set that assigns each element an unique index. More...

#include <indexed_set.h>

Inheritance diagram for mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >:
atermpp::indexed_set< state, mcrl2::utilities::detail::GlobalThreadSafe > atermpp::indexed_set< atermpp::aterm > atermpp::indexed_set< mcrl2::pbes_system::propositional_variable_instantiation, true > atermpp::indexed_set< mcrl2::pres_system::propositional_variable_instantiation > atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >

Public Types

typedef Key key_type
 
typedef std::size_t size_type
 
typedef std::pair< const key_type, size_typevalue_type
 
typedef Equals key_equal
 
typedef Hash hasher
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef KeyTable::iterator iterator
 
typedef KeyTable::const_iterator const_iterator
 
typedef KeyTable::reverse_iterator reverse_iterator
 
typedef KeyTable::const_reverse_iterator const_reverse_iterator
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

 indexed_set ()
 Constructor of an empty indexed set. Starts with a hashtable of size 128 and assumes one single thread.
 
 indexed_set (std::size_t number_of_threads)
 Constructor of an empty indexed set.
 
 indexed_set (std::size_t number_of_threads, std::size_t initial_hashtable_size, const hasher &hash=hasher(), const key_equal &equals=key_equal())
 Constructor of an empty index set. Starts with a hashtable of the indicated size.
 
size_type index (const key_type &key, std::size_t thread_index=0) const
 Returns a reference to the mapped value.
 
const key_typeat (const size_type index) const
 Returns a reference to the mapped value.
 
const key_typeoperator[] (const size_type index) const
 Operator that provides a const reference at the position indicated by index.
 
iterator begin (std::size_t thread_index=0)
 Forward iterator which runs through the elements from the lowest to the largest number.
 
iterator end (std::size_t thread_index=0)
 End of the forward iterator.
 
const_iterator begin (std::size_t thread_index=0) const
 Forward iterator which runs through the elements from the lowest to the largest number.
 
const_iterator end (std::size_t thread_index=0) const
 End of the forward iterator.
 
const_iterator cbegin (std::size_t thread_index=0) const
 const_iterator going through the elements in the set numbered from zero upwards.
 
const_iterator cend (std::size_t thread_index=0) const
 End of the forward const_iterator.
 
reverse_iterator rbegin (std::size_t thread_index=0)
 Reverse iterator going through the elements in the set from the largest to the smallest index.
 
reverse_iterator rend (std::size_t thread_index=0)
 End of the reverse iterator.
 
const_reverse_iterator crbegin (std::size_t thread_index=0) const
 Reverse const_iterator going through the elements from the highest to the lowest numbered element.
 
const_reverse_iterator crend (std::size_t thread_index=0) const
 End of the reverse const_iterator.
 
void clear (std::size_t thread_index=0)
 Clears the indexed set by removing all its elements. It is not guaranteed that the memory is released too.
 
std::pair< size_type, bool > insert (const key_type &key, std::size_t thread_index=0)
 Insert a key in the indexed set and return its index.
 
const_iterator find (const key_type &key, std::size_t thread_index=0) const
 Provides an iterator to the stored key in the indexed set.
 
size_type size (std::size_t thread_index=0) const
 The number of elements in the indexed set.
 

Static Public Attributes

static constexpr size_type npos = std::numeric_limits<std::size_t>::max()
 Value returned when an element does not exist in the set.
 

Private Member Functions

void reserve_indices (std::size_t thread_index)
 Reserve indices that can be used. Doing this infrequently prevents obtaining an exclusive lock for the indexed set too often. This operation requires a resize of m_keys.

 
std::size_t put_in_hashtable (const Key &key, std::size_t value, std::size_t &new_position)
 Inserts the given (key, n) pair into the indexed set.
 
void resize_hashtable ()
 Resizes the hash table to twice its current size.
 

Private Attributes

std::vector< detail::atomic_wrapper< std::size_t > > m_hashtable
 
KeyTable m_keys
 
std::shared_ptr< std::mutex > m_mutex
 Mutex for the m_hashtable and m_keys data structures.
 
std::vector< shared_mutexm_shared_mutexes
 
detail::atomic_wrapper< size_t > m_next_index
 m_next_index indicates the next index that
 
Hash m_hasher
 
Equals m_equals
 

Detailed Description

template<typename Key, bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
class mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >

A set that assigns each element an unique index.

Definition at line 32 of file indexed_set.h.

Member Typedef Documentation

◆ const_iterator

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef KeyTable::const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_iterator

Definition at line 75 of file indexed_set.h.

◆ const_pointer

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef const value_type* mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_pointer

Definition at line 72 of file indexed_set.h.

◆ const_reference

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef const value_type& mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_reference

Definition at line 70 of file indexed_set.h.

◆ const_reverse_iterator

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef KeyTable::const_reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_reverse_iterator

Definition at line 78 of file indexed_set.h.

◆ difference_type

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef std::ptrdiff_t mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::difference_type

Definition at line 80 of file indexed_set.h.

◆ hasher

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef Hash mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::hasher

Definition at line 67 of file indexed_set.h.

◆ iterator

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef KeyTable::iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::iterator

Definition at line 74 of file indexed_set.h.

◆ key_equal

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef Equals mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_equal

Definition at line 66 of file indexed_set.h.

◆ key_type

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef Key mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_type

Definition at line 63 of file indexed_set.h.

◆ pointer

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef value_type* mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::pointer

Definition at line 71 of file indexed_set.h.

◆ reference

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef value_type& mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::reference

Definition at line 69 of file indexed_set.h.

◆ reverse_iterator

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef KeyTable::reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::reverse_iterator

Definition at line 77 of file indexed_set.h.

◆ size_type

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef std::size_t mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::size_type

Definition at line 64 of file indexed_set.h.

◆ value_type

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
typedef std::pair<const key_type, size_type> mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::value_type

Definition at line 65 of file indexed_set.h.

Constructor & Destructor Documentation

◆ indexed_set() [1/3]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::indexed_set ( )

Constructor of an empty indexed set. Starts with a hashtable of size 128 and assumes one single thread.

◆ indexed_set() [2/3]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::indexed_set ( std::size_t  number_of_threads)

Constructor of an empty indexed set.

With a single thread it delivers contiguous values for states. With multiple threads some indices may be skipped. Each thread reserves numbers, which it hands out. If a thread does not have the opportunity to hand out all numbers, holes in the contiguous numbering can occur. The holes are always of limited size.

Parameters
number_of_threadsThe number of threads that use this index set. If the number is 1, it is treated as a sequential set. If this number is larger than 1, the threads must be numbered from 1 up and including number_of_threads. The number 0 cannot be used in that case.

◆ indexed_set() [3/3]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::indexed_set ( std::size_t  number_of_threads,
std::size_t  initial_hashtable_size,
const hasher hash = hasher(),
const key_equal equals = key_equal() 
)

Constructor of an empty index set. Starts with a hashtable of the indicated size.

With one thread the numbering is contiguous. With multiple threads limited size holes can occur in the numbering.

Parameters
number_of_threadsThe number of threads that use this index set. This number is either 1, and then the implementation assumes that the thread has number 0, or it is larger than 1, and it is assumed that threads are numbered from 1 upwards.
initial_hashtable_sizeThe initial size of the hashtable.
hashThe hash function.
equalsThe comparison function for its elements.

Member Function Documentation

◆ at()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const key_type & mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::at ( const size_type  index) const

Returns a reference to the mapped value.

Returns an out_of_range exception if there is no element with the given key.

Parameters
indexThe position in the indexed set.
Returns
The value at position index.

◆ begin() [1/2]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::begin ( std::size_t  thread_index = 0)
inline

Forward iterator which runs through the elements from the lowest to the largest number.

Complexity is constant per operation.

Definition at line 132 of file indexed_set.h.

◆ begin() [2/2]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::begin ( std::size_t  thread_index = 0) const
inline

Forward iterator which runs through the elements from the lowest to the largest number.

Complexity is constant per operation.

Definition at line 149 of file indexed_set.h.

◆ cbegin()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::cbegin ( std::size_t  thread_index = 0) const
inline

const_iterator going through the elements in the set numbered from zero upwards.

Definition at line 165 of file indexed_set.h.

◆ cend()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::cend ( std::size_t  thread_index = 0) const
inline

End of the forward const_iterator.

Definition at line 173 of file indexed_set.h.

◆ clear()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
void mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::clear ( std::size_t  thread_index = 0)

Clears the indexed set by removing all its elements. It is not guaranteed that the memory is released too.

◆ crbegin()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::crbegin ( std::size_t  thread_index = 0) const
inline

Reverse const_iterator going through the elements from the highest to the lowest numbered element.

Definition at line 197 of file indexed_set.h.

◆ crend()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::crend ( std::size_t  thread_index = 0) const
inline

End of the reverse const_iterator.

Definition at line 205 of file indexed_set.h.

◆ end() [1/2]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::end ( std::size_t  thread_index = 0)
inline

End of the forward iterator.

Definition at line 140 of file indexed_set.h.

◆ end() [2/2]

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::end ( std::size_t  thread_index = 0) const
inline

End of the forward iterator.

Definition at line 157 of file indexed_set.h.

◆ find()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::find ( const key_type key,
std::size_t  thread_index = 0 
) const

Provides an iterator to the stored key in the indexed set.

Parameters
keyThe key that is sought.
Returns
An iterator to the key, otherwise end().

◆ index()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
size_type mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::index ( const key_type key,
std::size_t  thread_index = 0 
) const

Returns a reference to the mapped value.

Returns an invalid value, larger or equal than the size of the indexed set, if there is no element with the given key.

◆ insert()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
std::pair< size_type, bool > mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::insert ( const key_type key,
std::size_t  thread_index = 0 
)

Insert a key in the indexed set and return its index.

If the element was already in the set, the resulting bool is true, and the existing index is returned. Otherwise, the key is inserted in the set, and the next available index is assigned to it.

Parameters
keyThe key to be inserted in the set.
Returns
The index of the key and a boolean indicating whether the element was actually inserted.

threadsafe

◆ operator[]()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
const key_type & mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::operator[] ( const size_type  index) const

Operator that provides a const reference at the position indicated by index.

Parameters
indexThe position in the indexed set.
Returns
The value at position index. \threadsafe

◆ put_in_hashtable()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
std::size_t mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::put_in_hashtable ( const Key &  key,
std::size_t  value,
std::size_t &  new_position 
)
private

Inserts the given (key, n) pair into the indexed set.

◆ rbegin()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::rbegin ( std::size_t  thread_index = 0)
inline

Reverse iterator going through the elements in the set from the largest to the smallest index.

Definition at line 181 of file indexed_set.h.

◆ rend()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
reverse_iterator mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::rend ( std::size_t  thread_index = 0)
inline

End of the reverse iterator.

Definition at line 189 of file indexed_set.h.

◆ reserve_indices()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
void mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::reserve_indices ( std::size_t  thread_index)
private

Reserve indices that can be used. Doing this infrequently prevents obtaining an exclusive lock for the indexed set too often. This operation requires a resize of m_keys.

◆ resize_hashtable()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
void mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::resize_hashtable ( )
inlineprivate

Resizes the hash table to twice its current size.

◆ size()

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
size_type mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::size ( std::size_t  thread_index = 0) const
inline

The number of elements in the indexed set.

Returns
The number of elements in the indexed set.

threadsafe

Definition at line 231 of file indexed_set.h.

Member Data Documentation

◆ m_equals

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
Equals mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_equals
private

Definition at line 48 of file indexed_set.h.

◆ m_hasher

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
Hash mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_hasher
private

Definition at line 47 of file indexed_set.h.

◆ m_hashtable

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
std::vector<detail::atomic_wrapper<std::size_t> > mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_hashtable
private

Definition at line 35 of file indexed_set.h.

◆ m_keys

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
KeyTable mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_keys
private

Definition at line 36 of file indexed_set.h.

◆ m_mutex

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
std::shared_ptr<std::mutex> mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_mutex
mutableprivate

Mutex for the m_hashtable and m_keys data structures.

Definition at line 39 of file indexed_set.h.

◆ m_next_index

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
detail::atomic_wrapper<size_t> mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_next_index
private

m_next_index indicates the next index that

Definition at line 45 of file indexed_set.h.

◆ m_shared_mutexes

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
std::vector<shared_mutex> mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::m_shared_mutexes
mutableprivate

Definition at line 40 of file indexed_set.h.

◆ npos

template<typename Key , bool ThreadSafe = false, typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = std::allocator<Key>, typename KeyTable = std::deque< Key, Allocator >>
constexpr size_type mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::npos = std::numeric_limits<std::size_t>::max()
staticconstexpr

Value returned when an element does not exist in the set.

Returns
Value indicating non existing element, equal to std::numeric_limits<std::size_t>::max().

Definition at line 84 of file indexed_set.h.


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