|
dispenso 1.5.0
A library for task parallelism
|
#include <concurrent_vector.h>
Public Member Functions | |
| ConcurrentVector () | |
| ConcurrentVector (size_t startCapacity, ReserveTagS) | |
| ConcurrentVector (size_t startSize) | |
| ConcurrentVector (size_t startSize, const T &defaultValue) | |
| template<typename InIterator > | |
| ConcurrentVector (InIterator start, InIterator end) | |
| template<typename InIterator > | |
| ConcurrentVector (size_type startSize, InIterator start, InIterator end) | |
| ConcurrentVector (std::initializer_list< T > l) | |
| ConcurrentVector (const ConcurrentVector &other) | |
| ConcurrentVector (ConcurrentVector &&other) | |
| void | assign (size_type count, const T &value) |
| template<typename It , typename = typename std::iterator_traits<It>::difference_type, typename = typename std::iterator_traits<It>::pointer, typename = typename std::iterator_traits<It>::reference, typename = typename std::iterator_traits<It>::value_type, typename = typename std::iterator_traits<It>::iterator_category> | |
| void | assign (It start, It end) |
| void | reserve (difference_type capacity) |
| void | resize (difference_type len) |
| void | resize (difference_type len, const T &value) |
| size_type | default_capacity () const |
| size_type | capacity () const |
| void | clear () |
| void | shrink_to_fit () |
| ~ConcurrentVector () | |
| iterator | insert (const_iterator pos, const T &value) |
| iterator | insert (const_iterator pos, T &&value) |
| iterator | insert (const_iterator pos, size_type count, const T &value) |
| template<typename InputIt , typename = typename std::iterator_traits<InputIt>::difference_type, typename = typename std::iterator_traits<InputIt>::pointer, typename = typename std::iterator_traits<InputIt>::reference, typename = typename std::iterator_traits<InputIt>::value_type, typename = typename std::iterator_traits<InputIt>::iterator_category> | |
| iterator | insert (const_iterator pos, InputIt first, InputIt last) |
| iterator | insert (const_iterator pos, std::initializer_list< T > ilist) |
| iterator | erase (const_iterator pos) |
| iterator | erase (const_iterator first, const_iterator last) |
| iterator | push_back (const T &val) |
| iterator | push_back (T &&val) |
| template<typename... Args> | |
| iterator | emplace_back (Args &&... args) |
| template<typename Gen > | |
| iterator | grow_by_generator (size_type delta, Gen gen) |
| iterator | grow_by (size_type delta, const T &t) |
| iterator | grow_by (size_type delta) |
| template<typename It , typename = typename std::iterator_traits<It>::difference_type, typename = typename std::iterator_traits<It>::pointer, typename = typename std::iterator_traits<It>::reference, typename = typename std::iterator_traits<It>::value_type, typename = typename std::iterator_traits<It>::iterator_category> | |
| iterator | grow_by (It start, It end) |
| iterator | grow_by (std::initializer_list< T > initList) |
| iterator | grow_to_at_least (size_type n) |
| iterator | grow_to_at_least (size_type n, const T &t) |
| void | pop_back () |
| const T & | at (size_type index) const |
| T & | at (size_type index) |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| bool | empty () const |
| constexpr size_type | max_size () const noexcept |
| size_type | size () const |
| T & | front () |
| const T & | front () const |
| T & | back () |
| const T & | back () const |
A concurrent vector type. It is safe to call .push_back(), .emplace_back(), the various .grow_() functions, .begin(), .end(), .size(), .empty() concurrently, and existing iterators and references remain valid with these functions' use.
Definition at line 177 of file concurrent_vector.h.
|
inline |
Default construct the ConcurrentVector.
Definition at line 202 of file concurrent_vector.h.
|
inline |
The reserving constructor. By supplying a reasonable starting capacity, e.g. close to max expected vector size, this can often improve performance substantially by reducing allocations and increasing data coherency.
Definition at line 209 of file concurrent_vector.h.
|
inlineexplicit |
Sizing constructor with default initialization.
Definition at line 225 of file concurrent_vector.h.
|
inline |
Sizing constructor with specified default value.
Definition at line 236 of file concurrent_vector.h.
|
inline |
Constructor taking an iterator range.
Definition at line 249 of file concurrent_vector.h.
|
inline |
Sizing constructor taking an iterator range. If size is known in advance, this may be faster than just providing the iterator range, especially for input iterators that are not random access.
Definition at line 258 of file concurrent_vector.h.
|
inline |
Construct via initializer list
Definition at line 268 of file concurrent_vector.h.
|
inline |
Copy constructor
Definition at line 274 of file concurrent_vector.h.
|
inline |
Move constructor
Definition at line 280 of file concurrent_vector.h.
|
inline |
Destruct the vector.
Definition at line 491 of file concurrent_vector.h.
|
inline |
Assign the vector. Not concurrency safe.
| start | The beginning of the iterator range to assign into the vector |
| end | The end of the iterator range to assign into the vector |
Definition at line 359 of file concurrent_vector.h.
|
inline |
Assign the vector. Not concurrency safe.
| count | The number of elements to have in the vector |
| value | The value to copy into each element |
Definition at line 339 of file concurrent_vector.h.
|
inline |
Access an element of the vector. Out-of-boundes accesses generate an exception. Concurrency safe.
| index | The index of the element to access. |
Definition at line 819 of file concurrent_vector.h.
|
inline |
Access an element of the vector. Out-of-boundes accesses generate an exception. Concurrency safe.
| index | The index of the element to access. |
Definition at line 801 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 997 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 1006 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 835 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 860 of file concurrent_vector.h.
|
inline |
The current capacity of the vector. Not concurrency safe.
Definition at line 430 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 885 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 897 of file concurrent_vector.h.
|
inline |
Clear the vector. This does not deallocate buffers, but just ensures that all elements are destructed. Size will be zero after the call. Not concurrency safe.
Definition at line 445 of file concurrent_vector.h.
|
inline |
The default capacity of this vector.
Definition at line 422 of file concurrent_vector.h.
|
inline |
Push a value onto the end of the vector. Concurrency safe.
| args | The arg pack used to construct the new element. |
Definition at line 642 of file concurrent_vector.h.
|
inline |
Checks if the vector contains any elements. Concurrency safe.
Definition at line 954 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 847 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 872 of file concurrent_vector.h.
|
inline |
Erase a range of elements. Not concurrency safe.
| first | The starting point of erasure. |
| last | The ending point of erasure. |
Definition at line 596 of file concurrent_vector.h.
|
inline |
Erase one element. Not concurrency safe.
| pos | The point of erasure. |
Definition at line 571 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 980 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 988 of file concurrent_vector.h.
|
inline |
Grow the vector with an input iterator range. Concurrency safe.
| start | The start of the input iterator range. |
| end | The end of the input iterator range. |
Definition at line 711 of file concurrent_vector.h.
|
inline |
Grow the vector, default initializing new elements. Concurrency safe.
| delta | The number of elements to grow by. |
Definition at line 692 of file concurrent_vector.h.
|
inline |
Grow the vector, copying the provided value into new elements. Concurrency safe.
| delta | The number of elements to grow by. |
| t | The value to copy into all new elements. |
Definition at line 681 of file concurrent_vector.h.
|
inline |
Grow the vector with an initializer_list. Concurrency safe.
| initList | The initializer_list to use to initialize the newly added range. |
Definition at line 722 of file concurrent_vector.h.
|
inline |
Grow the vector, constructing new elements via a generator. Concurrency safe.
| delta | The number of elements to grow by. |
| gen | The generator to use to construct new elements. Must have operator()() and return a valid T. |
Definition at line 667 of file concurrent_vector.h.
|
inline |
Grow the vector to at least the desired size, default initializing new elements. Concurrency safe.
| n | The required length |
Definition at line 732 of file concurrent_vector.h.
|
inline |
Grow the vector to at least the desired size, copying the provided value into new elements. Concurrency safe.
| n | The required length |
| t | The value to copy into each new element. |
Definition at line 747 of file concurrent_vector.h.
|
inline |
Insert a value. Not concurrency safe.
| pos | The point of insertion. |
| value | The value to copy into the element at pos. |
Definition at line 503 of file concurrent_vector.h.
|
inline |
Insert a range of values. Not concurrency safe.
| pos | The point of insertion. |
| first | The start of the input iterator range. |
| last | The end of the input iterator range. |
Definition at line 548 of file concurrent_vector.h.
|
inline |
Insert a value. Not concurrency safe.
| pos | The point of insertion. |
| count | The number of elements to insert. |
| value | The value to copy into each inserted element starting at pos. |
Definition at line 528 of file concurrent_vector.h.
|
inline |
Insert an initializer_list. Not concurrency safe.
| pos | The point of insertion. |
| ilist | The initializer_list. |
Definition at line 561 of file concurrent_vector.h.
|
inline |
Insert a value. Not concurrency safe.
| pos | The point of insertion. |
| value | The value to move into the element at pos. |
Definition at line 515 of file concurrent_vector.h.
|
inlineconstexprnoexcept |
Get the maximum size a vector of this type can theoretically have. Concurrency safe (constexpr).
Definition at line 963 of file concurrent_vector.h.
|
inline |
Pop the last element off the vector. Not concurrency safe.
Definition at line 758 of file concurrent_vector.h.
|
inline |
Push a value onto the end of the vector. Concurrency safe.
| val | The value to copy into the new element. |
Definition at line 623 of file concurrent_vector.h.
|
inline |
Push a value onto the end of the vector. Concurrency safe.
| val | The value to move into the new element. |
Definition at line 632 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 911 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 934 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 922 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 945 of file concurrent_vector.h.
|
inline |
Reserve some capacity for the vector. Not concurrency safe.
| capacity | The amount of space to ensure is available to avoid further allocations. |
Definition at line 372 of file concurrent_vector.h.
|
inline |
Resize the vector, using default initialization for any new values. Not concurrency safe.
| len | The length of the vector after the resize. |
Definition at line 382 of file concurrent_vector.h.
|
inline |
Resize the vector, copying the provided value into any new elements. Not concurrency safe.
| len | The length of the vector after the resize. |
| value | The value to copy into any new elements. |
Definition at line 403 of file concurrent_vector.h.
|
inline |
Gets rid of extra capacity that is not needed to maintain preconditions. At least the default capacity will remain, even if the size of the vector is zero. Not concurrency safe.
Definition at line 468 of file concurrent_vector.h.
|
inline |
Get the size of the vector. Concurrency safe.
Definition at line 972 of file concurrent_vector.h.