|
mCRL2
|
A set that assigns each element an unique index, and protects its internal terms en masse. More...
#include <indexed_set.h>
Public Types | |
| using | key_type = typename super::key_type |
| using | size_type = typename super::size_type |
| using | value_type = typename super::value_type |
| using | hasher = typename super::hasher |
| using | key_equal = typename super::key_equal |
| using | iterator = typename super::iterator |
| using | const_iterator = typename super::const_iterator |
| using | reverse_iterator = typename super::reverse_iterator |
| using | const_reverse_iterator = typename super::const_reverse_iterator |
Public Member Functions | |
| indexed_set ()=default | |
| Constructor of an empty indexed set. Starts with a hashtable of size 128. | |
| indexed_set (std::size_t number_of_threads) | |
| Constructor of an empty indexed set. Starts with a hashtable of size 128. | |
| indexed_set (std::size_t number_of_threads, std::size_t initial_hashtable_size, const typename super::hasher &hash=typename super::hasher(), const typename super::key_equal &equals=typename super::key_equal()) | |
| Constructor of an empty index set. Starts with a hashtable of the indicated size. | |
| void | clear (std::size_t thread_index=0) |
| Clears the indexed set. | |
| std::pair< size_type, bool > | insert (const Key &key, std::size_t thread_index=0) |
| Insert a key in the indexed set and return its index. | |
| size_type | index (const key_type &key, std::size_t thread_index=0) const |
| bool | contains (const key_type &key, std::size_t thread_index=0) const |
| const_iterator | find (const key_type &key, std::size_t thread_index=0) const |
| const key_type & | at (size_type index) const |
| const key_type & | operator[] (size_type index) const |
| size_type | size (std::size_t thread_index=0) const |
| iterator | begin (std::size_t thread_index=0) |
| iterator | end (std::size_t thread_index=0) |
| const_iterator | begin (std::size_t thread_index=0) const |
| const_iterator | end (std::size_t thread_index=0) const |
| const_iterator | cbegin (std::size_t thread_index=0) const |
| const_iterator | cend (std::size_t thread_index=0) const |
| reverse_iterator | rbegin (std::size_t thread_index=0) |
| reverse_iterator | rend (std::size_t thread_index=0) |
| const_reverse_iterator | crbegin (std::size_t thread_index=0) const |
| const_reverse_iterator | crend (std::size_t thread_index=0) const |
Static Public Attributes | |
| static constexpr size_type | npos = super::npos |
| Value returned when an element does not exist in the set. | |
Protected Types | |
| using | super = mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable > |
Protected Attributes | |
| super | m_set |
A set that assigns each element an unique index, and protects its internal terms en masse.
The API of a mcrl2::utilities::indexed_set is exposed by explicit forwarding (composition) instead of inheritance, such that every operation that touches aterms is guaranteed to acquire the shared lock that keeps the garbage collector out of the underlying key table while it is being accessed.
Definition at line 33 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_iterator = typename super::const_iterator |
Definition at line 47 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::const_reverse_iterator = typename super::const_reverse_iterator |
Definition at line 49 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::hasher = typename super::hasher |
Definition at line 44 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::iterator = typename super::iterator |
Definition at line 46 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_equal = typename super::key_equal |
Definition at line 45 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_type = typename super::key_type |
Definition at line 41 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::reverse_iterator = typename super::reverse_iterator |
Definition at line 48 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::size_type = typename super::size_type |
Definition at line 42 of file indexed_set.h.
|
protected |
Definition at line 36 of file indexed_set.h.
| using atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::value_type = typename super::value_type |
Definition at line 43 of file indexed_set.h.
|
default |
Constructor of an empty indexed set. Starts with a hashtable of size 128.
|
inline |
Constructor of an empty indexed set. Starts with a hashtable of size 128.
Definition at line 58 of file indexed_set.h.
|
inline |
Constructor of an empty index set. Starts with a hashtable of the indicated size.
| initial_hashtable_size | The initial size of the hashtable. |
| hash | The hash function. |
| equals | The comparison function for its elements. |
Definition at line 66 of file indexed_set.h.
|
inline |
Definition at line 112 of file indexed_set.h.
|
inline |
Definition at line 131 of file indexed_set.h.
|
inline |
Definition at line 134 of file indexed_set.h.
|
inline |
Definition at line 137 of file indexed_set.h.
|
inline |
Definition at line 138 of file indexed_set.h.
|
inline |
Clears the indexed set.
Definition at line 74 of file indexed_set.h.
|
inline |
Performs the lookup under a single guard such that a concurrent insert cannot invalidate the answer halfway through the check.
Definition at line 98 of file indexed_set.h.
|
inline |
Definition at line 143 of file indexed_set.h.
|
inline |
Definition at line 144 of file indexed_set.h.
|
inline |
Definition at line 132 of file indexed_set.h.
|
inline |
Definition at line 135 of file indexed_set.h.
|
inline |
Definition at line 105 of file indexed_set.h.
|
inline |
Definition at line 89 of file indexed_set.h.
|
inline |
Insert a key in the indexed set and return its index.
Definition at line 82 of file indexed_set.h.
|
inline |
Definition at line 119 of file indexed_set.h.
|
inline |
Definition at line 140 of file indexed_set.h.
|
inline |
Definition at line 141 of file indexed_set.h.
|
inline |
Definition at line 126 of file indexed_set.h.
|
protected |
Definition at line 38 of file indexed_set.h.
|
staticconstexpr |
Value returned when an element does not exist in the set.
Definition at line 52 of file indexed_set.h.