mCRL2
|
This essentially implements the std::forward_list, with the difference that it does not own the nodes in the list. It just keeps track of the list next pointers. More...
#include <bucket_list.h>
Classes | |
class | key_iterator |
Iterator over all keys in a bucket list. More... | |
class | node |
The nodes of the bucket list. More... | |
class | node_base |
The nodes of the bucket list without carrying any additional informations. Used to make no different between the head and the tail of the list. More... | |
Public Types | |
using | Bucket = bucket_list< Key, Allocator > |
using | iterator = key_iterator< false > |
using | const_iterator = key_iterator< true > |
using | NodeAllocator = typename std::allocator_traits< Allocator >::template rebind_alloc< Bucket::node > |
Rebind the passed to allocator to a bucket list node allocator. | |
Public Member Functions | |
Key & | front () |
const Key & | front () const |
iterator | begin () |
iterator | end () |
iterator | before_begin () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_iterator | before_begin () const |
bool | empty () const |
void | clear (NodeAllocator &allocator) |
Empties the bucket list. | |
template<typename ... Args> | |
void | emplace_front (NodeAllocator &allocator, Args &&...args) |
Constructs an element using the allocator with the given arguments and insert it in the front. | |
template<typename ... Args, typename Equals > | |
std::pair< iterator, bool > | emplace_front_unique (NodeAllocator &allocator, const Equals &equals, Args &&...args) |
Constructs an element using the allocator with the given arguments and insert it in the front of the bucket iff it does not already exist. | |
iterator | erase_after (NodeAllocator &allocator, const_iterator it) |
Removes the element after the given iterator from the list. The returned iterator. | |
void | splice_after (const_iterator pos, bucket_list &other) |
Moves the elements from other into this bucket after the given position. | |
void | splice_front (const_iterator pos, bucket_list &other) |
Moves the first node from the given bucket into this bucket after the given position. | |
Private Member Functions | |
bool | contains (node *node) |
Private Attributes | |
node_base | m_head |
The first node in the bucket list. | |
This essentially implements the std::forward_list, with the difference that it does not own the nodes in the list. It just keeps track of the list next pointers.
Definition at line 47 of file bucket_list.h.
using mcrl2::utilities::detail::bucket_list< Key, Allocator >::Bucket = bucket_list<Key, Allocator> |
Definition at line 179 of file bucket_list.h.
using mcrl2::utilities::detail::bucket_list< Key, Allocator >::const_iterator = key_iterator<true> |
Definition at line 181 of file bucket_list.h.
using mcrl2::utilities::detail::bucket_list< Key, Allocator >::iterator = key_iterator<false> |
Definition at line 180 of file bucket_list.h.
using mcrl2::utilities::detail::bucket_list< Key, Allocator >::NodeAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<Bucket::node> |
Rebind the passed to allocator to a bucket list node allocator.
Definition at line 184 of file bucket_list.h.
|
inline |
Definition at line 195 of file bucket_list.h.
|
inline |
Definition at line 205 of file bucket_list.h.
|
inline |
Definition at line 191 of file bucket_list.h.
|
inline |
Definition at line 198 of file bucket_list.h.
|
inline |
Definition at line 201 of file bucket_list.h.
|
inline |
Definition at line 202 of file bucket_list.h.
|
inline |
Empties the bucket list.
Definition at line 211 of file bucket_list.h.
|
inlineprivate |
Definition at line 355 of file bucket_list.h.
|
inline |
Constructs an element using the allocator with the given arguments and insert it in the front.
Definition at line 221 of file bucket_list.h.
|
inline |
Constructs an element using the allocator with the given arguments and insert it in the front of the bucket iff it does not already exist.
Definition at line 239 of file bucket_list.h.
|
inline |
Definition at line 208 of file bucket_list.h.
|
inline |
Definition at line 192 of file bucket_list.h.
|
inline |
Definition at line 199 of file bucket_list.h.
|
inline |
Removes the element after the given iterator from the list. The returned iterator.
Definition at line 276 of file bucket_list.h.
|
inline |
Definition at line 187 of file bucket_list.h.
|
inline |
Definition at line 188 of file bucket_list.h.
|
inline |
Moves the elements from other into this bucket after the given position.
Definition at line 296 of file bucket_list.h.
|
inline |
Moves the first node from the given bucket into this bucket after the given position.
This is a non-standard addition to ensure efficient splicing (instead of splice_after(pos, other, other.begin(), ++other.begin()).
Definition at line 331 of file bucket_list.h.
|
private |
The first node in the bucket list.
Definition at line 372 of file bucket_list.h.