#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 = std::conditional_t< Traits::kIteratorPreferSpeed, cv::ConcurrentVectorIterator< ConcurrentVector< T, Traits >, T, false >, cv::CompactCVecIterator< ConcurrentVector< T, Traits >, T, false > > |
using | const_iterator = std::conditional_t< Traits::kIteratorPreferSpeed, cv::ConcurrentVectorIterator< ConcurrentVector< T, Traits >, T, true >, cv::CompactCVecIterator< ConcurrentVector< T, Traits >, T, true > > |
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 = std::conditional_t< Traits::kIteratorPreferSpeed, cv::ConcurrentVectorIterator<ConcurrentVector<T, Traits>, T, true>, cv::CompactCVecIterator<ConcurrentVector<T, Traits>, T, true> > |
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 = std::conditional_t< Traits::kIteratorPreferSpeed, cv::ConcurrentVectorIterator<ConcurrentVector<T, Traits>, T, false>, cv::CompactCVecIterator<ConcurrentVector<T, Traits>, T, false> > |
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 201 of file concurrent_vector.h.
|
inline |
Sizing constructor with specified default value.
Definition at line 212 of file concurrent_vector.h.
|
inline |
Constructor taking an iterator range.
Definition at line 225 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 234 of file concurrent_vector.h.
|
inline |
Construct via initializer list
Definition at line 244 of file concurrent_vector.h.
|
inline |
Copy constructor
Definition at line 250 of file concurrent_vector.h.
|
inline |
Move constructor
Definition at line 256 of file concurrent_vector.h.
|
inline |
Destruct the vector.
Definition at line 461 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 331 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 311 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 789 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 771 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 967 of file concurrent_vector.h.
|
inline |
Get the last element of the vector. Concurrency safe.
Definition at line 976 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 805 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 830 of file concurrent_vector.h.
|
inline |
The current capacity of the vector. Not concurrency safe.
Definition at line 401 of file concurrent_vector.h.
|
inline |
Get an iterator to the start of the vector. Concurrency safe.
Definition at line 855 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 867 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 416 of file concurrent_vector.h.
|
inline |
The default capacity of this vector.
Definition at line 393 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 612 of file concurrent_vector.h.
|
inline |
Checks if the vector contains any elements. Concurrency safe.
Definition at line 924 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 817 of file concurrent_vector.h.
|
inline |
Get an iterator to the end of the vector. Concurrency safe.
Definition at line 842 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 566 of file concurrent_vector.h.
|
inline |
Erase one element. Not concurrency safe.
pos | The point of erasure. |
Definition at line 541 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 950 of file concurrent_vector.h.
|
inline |
Get the front element of the vector. Concurrency safe.
Definition at line 958 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 681 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 662 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 651 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 692 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 637 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 702 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 717 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 473 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 518 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 498 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 531 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 485 of file concurrent_vector.h.
|
inlineconstexprnoexcept |
Get the maximum size a vector of this type can theoretically have. Concurrency safe (constexpr).
Definition at line 933 of file concurrent_vector.h.
|
inline |
Move assignment operator. This is not concurrency safe.
Definition at line 288 of file concurrent_vector.h.
|
inline |
Copy assignment operator. This is not concurrency safe.
Definition at line 272 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 756 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 742 of file concurrent_vector.h.
|
inline |
Pop the last element off the vector. Not concurrency safe.
Definition at line 728 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 593 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 602 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 881 of file concurrent_vector.h.
|
inline |
Get a starting reverse iterator to the vector. Concurrency safe.
Definition at line 904 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 892 of file concurrent_vector.h.
|
inline |
Get an ending reverse iterator to the vector. Concurrency safe.
Definition at line 915 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 344 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 353 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 374 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 439 of file concurrent_vector.h.
|
inline |
Get the size of the vector. Concurrency safe.
Definition at line 942 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 984 of file concurrent_vector.h.
|
friend |
Definition at line 1086 of file concurrent_vector.h.
|
friend |
Definition at line 1086 of file concurrent_vector.h.
|
friend |
Definition at line 1086 of file concurrent_vector.h.