#include <concurrent_vector.h>
Public Types | |
| using | value_type = T |
| using | reference = T& |
| using | const_reference = const T& |
| using | size_type = size_t |
| using | difference_type = ssize_t |
| using | reference_type = T& |
| using | const_reference_type = const T& |
| using | pointer = T* |
| using | const_pointer = const T* |
| using | iterator |
| using | const_iterator |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
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) | |
| ConcurrentVector & | operator= (const ConcurrentVector &other) |
| ConcurrentVector & | operator= (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 & | operator[] (size_type index) const |
| T & | operator[] (size_type index) |
| 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 |
| void | swap (ConcurrentVector &oth) |
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 157 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::const_iterator |
Definition at line 172 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::const_pointer = const T* |
Definition at line 167 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::const_reference = const T& |
Definition at line 161 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::const_reference_type = const T& |
Definition at line 165 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 177 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::difference_type = ssize_t |
Definition at line 163 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::iterator |
Definition at line 168 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::pointer = T* |
Definition at line 166 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::reference = T& |
Definition at line 160 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::reference_type = T& |
Definition at line 164 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 176 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::size_type = size_t |
Definition at line 162 of file concurrent_vector.h.
| using dispenso::ConcurrentVector< T, Traits, SizeTraits >::value_type = T |
Definition at line 159 of file concurrent_vector.h.
|
inline |
Default construct the ConcurrentVector.
Definition at line 182 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 189 of file concurrent_vector.h.
|
inlineexplicit |
Sizing constructor with default initialization.
Definition at line 202 of file concurrent_vector.h.
|
inline |
Sizing constructor with specified default value.
Definition at line 213 of file concurrent_vector.h.
|
inline |
Constructor taking an iterator range.
Definition at line 226 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 235 of file concurrent_vector.h.
|
inline |
Construct via initializer list
Definition at line 245 of file concurrent_vector.h.
|
inline |
Copy constructor
Definition at line 251 of file concurrent_vector.h.
|
inline |
Move constructor
Definition at line 257 of file concurrent_vector.h.
|
inline |
Destruct the vector.
Definition at line 462 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 332 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 312 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 790 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 772 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 968 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 977 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 806 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 831 of file concurrent_vector.h.
|
inline |
The current capacity of the vector. Not concurrency safe.
Definition at line 402 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 856 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 868 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 417 of file concurrent_vector.h.
|
inline |
The default capacity of this vector.
Definition at line 394 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 613 of file concurrent_vector.h.
|
inline |
Checks if the vector contains any elements. Concurrency safe.
Definition at line 925 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 818 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 843 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 567 of file concurrent_vector.h.
|
inline |
Erase one element. Not concurrency safe.
| pos | The point of erasure. |
Definition at line 542 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 951 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 959 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 682 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 663 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 652 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 693 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 638 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 703 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 718 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 474 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 519 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 499 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 532 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 486 of file concurrent_vector.h.
|
inlineconstexprnoexcept |
Get the maximum size a vector of this type can theoretically have. Concurrency safe (constexpr).
Definition at line 934 of file concurrent_vector.h.
|
inline |
Move assignment operator. This is not concurrency safe.
Definition at line 289 of file concurrent_vector.h.
|
inline |
Copy assignment operator. This is not concurrency safe.
Definition at line 273 of file concurrent_vector.h.
|
inline |
Access an element of the vector. Concurrency safe.
| index | The index of the element to access. |
Definition at line 757 of file concurrent_vector.h.
|
inline |
Access an element of the vector. Concurrency safe.
| index | The index of the element to access. |
Definition at line 743 of file concurrent_vector.h.
|
inline |
Pop the last element off the vector. Not concurrency safe.
Definition at line 729 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 594 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 603 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 882 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 905 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 893 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 916 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 345 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 354 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 375 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 440 of file concurrent_vector.h.
|
inline |
Get the size of the vector. Concurrency safe.
Definition at line 943 of file concurrent_vector.h.
|
inline |
Swap the contents (and iterators, and element references) of the current vector with oth.
| oth | The vector to swap with. |
Definition at line 985 of file concurrent_vector.h.
|
friend |
Definition at line 1087 of file concurrent_vector.h.
|
friend |
Definition at line 1087 of file concurrent_vector.h.
|
friend |
Definition at line 1087 of file concurrent_vector.h.