concurrent_vector Class
The concurrent_vector class is a sequence container class that allows random access to any element. It enables concurrency-safe append, element access, iterator access and iterator traversal operations.
template<
typename _Ty,
class _Ax
>
class concurrent_vector: protected details::_Allocator_base<_Ty, _Ax>, private details::_Concurrent_vector_base_v4;
Parameters
_Ty
The data type of the elements to be stored in the vector._Ax
The type that represents the stored allocator object that encapsulates details about the allocation and deallocation of memory for the concurrent vector. This argument is optional and the default value is allocator<_Ty**>**.
Members
Public Typedefs
Name |
Description |
---|---|
allocator_type |
A type that represents the allocator class for the concurrent vector. |
const_iterator |
A type that provides a random-access iterator that can read a const element in a concurrent vector. |
const_pointer |
A type that provides a pointer to a const element in a concurrent vector. |
const_reference |
A type that provides a reference to a const element stored in a concurrent vector for reading and performing const operations. |
const_reverse_iterator |
A type that provides a random-access iterator that can read any const element in the concurrent vector. |
difference_type |
A type that provides the signed distance between two elements in a concurrent vector. |
iterator |
A type that provides a random-access iterator that can read any element in a concurrent vector. Modification of an element using the iterator is not concurrency-safe. |
pointer |
A type that provides a pointer to an element in a concurrent vector. |
reference |
A type that provides a reference to an element stored in a concurrent vector. |
reverse_iterator |
A type that provides a random-access iterator that can read any element in a reversed concurrent vector. Modification of an element using the iterator is not concurrency-safe. |
size_type |
A type that counts the number of elements in a concurrent vector. |
value_type |
A type that represents the data type stored in a concurrent vector. |
Public Constructors
Name |
Description |
---|---|
Overloaded. Constructs a concurrent vector. |
|
Erases all elements and destroys this concurrent vector. |
Public Methods
Name |
Description |
---|---|
Overloaded. Erases the elements of the concurrent vector and assigns to it either _N copies of _Item, or values specified by the iterator range [_Begin, _End). This method is not concurrency-safe. |
|
Overloaded. Provides access to the element at the given index in the concurrent vector. This method is concurrency-safe for read operations, and also while growing the vector, as long as you have ensured that the value _Index is less than the size of the concurrent vector. |
|
Overloaded. Returns a reference or a const reference to the last element in the concurrent vector. If the concurrent vector is empty, the return value is undefined. This method is concurrency-safe. |
|
Overloaded. Returns an iterator of type iterator or const_iterator to the beginning of the concurrent vector. This method is concurrency-safe. |
|
Returns the maximum size to which the concurrent vector can grow without having to allocate more memory. This method is concurrency-safe. |
|
Returns an iterator of type const_iterator to the beginning of the concurrent vector. This method is concurrency-safe. |
|
Returns an iterator of type const_iterator to the end of the concurrent vector. This method is concurrency-safe. |
|
Erases all elements in the concurrent vector. This method is not concurrency-safe. |
|
Returns an iterator of type const_reverse_iterator to the beginning of the concurrent vector. This method is concurrency-safe. |
|
Returns an iterator of type const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe. |
|
Tests if the concurrent vector is empty at the time this method is called. This method is concurrency-safe. |
|
Overloaded. Returns an iterator of type iterator or const_iterator to the end of the concurrent vector. This method is concurrency-safe. |
|
Overloaded. Returns a reference or a const reference to the first element in the concurrent vector. If the concurrent vector is empty, the return value is undefined. This method is concurrency-safe. |
|
Returns a copy of the allocator used to construct the concurrent vector. This method is concurrency-safe. |
|
Overloaded. Grows this concurrent vector by _Delta elements. This method is concurrency-safe. |
|
Grows this concurrent vector until it has at least _N elements. This method is concurrency-safe. |
|
Returns the maximum number of elements the concurrent vector can hold. This method is concurrency-safe. |
|
Appends the given item to the end of the concurrent vector. This method is concurrency-safe. |
|
Overloaded. Returns an iterator of type reverse_iterator or const_reverse_iterator to the beginning the concurrent vector. This method is concurrency-safe. |
|
Overloaded. Returns an iterator of type reverse_iterator or const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe. |
|
Allocates enough space to grow the concurrent vector to size _N without having to allocate more memory later. This method is not concurrency-safe. |
|
Overloaded. Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe. |
|
Compacts the internal representation of the concurrent vector to reduce fragmentation and optimize memory usage. |
|
Returns the number of elements in the concurrent vector. This method is concurrency-safe. |
|
Swaps the contents of two concurrent vectors. This method is not concurrency-safe. |
Public Operators
Name |
Description |
---|---|
Overloaded. Provides access to the element at the given index in the concurrent vector. This method is concurrency-safe for read operations, and also while growing the vector, as long as the you have ensured that the value _Index is less than the size of the concurrent vector. |
|
Overloaded. Assigns the contents of another concurrent_vector object to this one. This method is not concurrency-safe. |
Remarks
For detailed information on the concurrent_vector class, see Parallel Containers and Objects.
Inheritance Hierarchy
_Allocator_base
_Concurrent_vector_base_v4
Requirements
Header: concurrent_vector.h
Namespace: Concurrency