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

A set that assigns each element an unique index, and protects its internal terms en masse. More...

#include <indexed_set.h>

Inheritance diagram for atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >:
mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >

Public Types

typedef super::size_type size_type
 
- Public Types inherited from mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >
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.
 
 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)
 
std::pair< size_type, bool > insert (const Key &key, std::size_t thread_index=0)
 
- Public Member Functions inherited from 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 (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.
 

Private Types

typedef mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable > super
 

Additional Inherited Members

- Static Public Attributes inherited from mcrl2::utilities::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >
static constexpr size_type npos = std::numeric_limits<std::size_t>::max()
 Value returned when an element does not exist in the set.
 

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 = atermpp::deque<Key >>
class atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >

A set that assigns each element an unique index, and protects its internal terms en masse.

Definition at line 29 of file indexed_set.h.

Member Typedef Documentation

◆ 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 = atermpp::deque<Key >>
typedef super::size_type atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::size_type

Definition at line 34 of file indexed_set.h.

◆ super

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

Definition at line 31 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 = atermpp::deque<Key >>
atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::indexed_set ( )
inline

Constructor of an empty indexed set. Starts with a hashtable of size 128.

Definition at line 37 of file indexed_set.h.

◆ 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 = atermpp::deque<Key >>
atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::indexed_set ( std::size_t  number_of_threads)
inline

Constructor of an empty indexed set. Starts with a hashtable of size 128.

Definition at line 41 of file indexed_set.h.

◆ 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 = atermpp::deque<Key >>
atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::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() 
)
inline

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

Parameters
initial_hashtable_sizeThe initial size of the hashtable.
hashThe hash function.
equalsThe comparison function for its elements.

Definition at line 50 of file indexed_set.h.

Member Function Documentation

◆ 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 = atermpp::deque<Key >>
void atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::clear ( std::size_t  thread_index = 0)
inline

Definition at line 57 of file indexed_set.h.

◆ 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 = atermpp::deque<Key >>
std::pair< size_type, bool > atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::insert ( const Key &  key,
std::size_t  thread_index = 0 
)
inline

Definition at line 63 of file indexed_set.h.


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