|
dispenso 1.4.1
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 158 of file concurrent_vector.h.
|
inline |
Default construct the ConcurrentVector.
Definition at line 183 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 190 of file concurrent_vector.h.
|
inlineexplicit |
Sizing constructor with default initialization.
Definition at line 203 of file concurrent_vector.h.
|
inline |
Sizing constructor with specified default value.
Definition at line 214 of file concurrent_vector.h.
|
inline |
Constructor taking an iterator range.
Definition at line 227 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 236 of file concurrent_vector.h.
|
inline |
Construct via initializer list
Definition at line 246 of file concurrent_vector.h.
|
inline |
Copy constructor
Definition at line 252 of file concurrent_vector.h.
|
inline |
Move constructor
Definition at line 258 of file concurrent_vector.h.
|
inline |
Destruct the vector.
Definition at line 463 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 333 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 313 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 791 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 773 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 969 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 978 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 807 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 832 of file concurrent_vector.h.
|
inline |
The current capacity of the vector. Not concurrency safe.
Definition at line 403 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 857 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 869 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 418 of file concurrent_vector.h.
|
inline |
The default capacity of this vector.
Definition at line 395 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 614 of file concurrent_vector.h.
|
inline |
Checks if the vector contains any elements. Concurrency safe.
Definition at line 926 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 819 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 844 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 568 of file concurrent_vector.h.
|
inline |
Erase one element. Not concurrency safe.
| pos | The point of erasure. |
Definition at line 543 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 952 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 960 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 683 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 664 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 653 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 694 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 639 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 704 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 719 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 475 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 520 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 500 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 533 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 487 of file concurrent_vector.h.
|
inlineconstexprnoexcept |
Get the maximum size a vector of this type can theoretically have. Concurrency safe (constexpr).
Definition at line 935 of file concurrent_vector.h.
|
inline |
Pop the last element off the vector. Not concurrency safe.
Definition at line 730 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 595 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 604 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 883 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 906 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 894 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 917 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 346 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 355 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 376 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 441 of file concurrent_vector.h.
|
inline |
Get the size of the vector. Concurrency safe.
Definition at line 944 of file concurrent_vector.h.