STLdoc
STLdocumentation
|
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.
More...
#include <concurrent_vector.h>
Classes | |
class | _Internal_loop_guide |
class | _Is_integer_tag |
Public Types | |
typedef details::_Concurrent_vector_base_v4::_Size_type | size_type |
A type that counts the number of elements in a concurrent vector. More... | |
typedef details::_Allocator_base< _Ty, _Ax >::_Allocator_type | allocator_type |
A type that represents the allocator class for the concurrent vector. More... | |
typedef _Ty | value_type |
A type that represents the data type stored in a concurrent vector. More... | |
typedef ptrdiff_t | difference_type |
A type that provides the signed distance between two elements in a concurrent vector. More... | |
typedef _Ty & | reference |
A type that provides a reference to an element stored in a concurrent vector. More... | |
typedef const _Ty & | const_reference |
A type that provides a reference to a const element stored in a concurrent vector for reading and performing const operations. More... | |
typedef _Ty * | pointer |
A type that provides a pointer to an element in a concurrent vector. More... | |
typedef const _Ty * | const_pointer |
A type that provides a pointer to a const element in a concurrent vector. More... | |
typedef details::_Vector_iterator< concurrent_vector, _Ty > | 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. More... | |
typedef details::_Vector_iterator< concurrent_vector, const _Ty > | const_iterator |
A type that provides a random-access iterator that can read a const element in a concurrent vector. More... | |
typedef std::reverse_iterator< iterator > | 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. More... | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
A type that provides a random-access iterator that can read any const element in the concurrent vector. More... | |
Public Member Functions | |
concurrent_vector (const allocator_type &_Al=allocator_type()) | |
Constructs a concurrent vector. More... | |
concurrent_vector (const concurrent_vector &_Vector) | |
Constructs a concurrent vector. More... | |
template<class M > | |
concurrent_vector (const concurrent_vector< _Ty, M > &_Vector, const allocator_type &_Al=allocator_type()) | |
Constructs a concurrent vector. More... | |
concurrent_vector (concurrent_vector &&_Vector) | |
Constructs a concurrent vector. More... | |
concurrent_vector (size_type _N) | |
Constructs a concurrent vector. More... | |
concurrent_vector (size_type _N, const_reference _Item, const allocator_type &_Al=allocator_type()) | |
Constructs a concurrent vector. More... | |
template<class _InputIterator > | |
concurrent_vector (_InputIterator _Begin, _InputIterator _End, const allocator_type &_Al=allocator_type()) | |
Constructs a concurrent vector. More... | |
concurrent_vector & | operator= (const concurrent_vector &_Vector) |
Assigns the contents of another concurrent_vector object to this one. This method is not concurrency-safe. More... | |
template<class M > | |
concurrent_vector & | operator= (const concurrent_vector< _Ty, M > &_Vector) |
Assigns the contents of another concurrent_vector object to this one. This method is not concurrency-safe. More... | |
concurrent_vector & | operator= (concurrent_vector &&_Vector) |
Assigns the contents of another concurrent_vector object to this one. This method is not concurrency-safe. More... | |
iterator | grow_by (size_type _Delta) |
Grows this concurrent vector by _Delta elements. This method is concurrency-safe. More... | |
iterator | grow_by (size_type _Delta, const_reference _Item) |
Grows this concurrent vector by _Delta elements. This method is concurrency-safe. More... | |
iterator | grow_to_at_least (size_type _N) |
Grows this concurrent vector until it has at least _N elements. This method is concurrency-safe. More... | |
iterator | push_back (const_reference _Item) |
Appends the given item to the end of the concurrent vector. This method is concurrency-safe. More... | |
iterator | push_back (_Ty &&_Item) |
Appends the given item to the end of the concurrent vector. This method is concurrency-safe. More... | |
reference | operator[] (size_type _Index) |
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. More... | |
const_reference | operator[] (size_type _Index) const |
Provides read access to 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. More... | |
reference | at (size_type _Index) |
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. More... | |
const_reference | at (size_type _Index) const |
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. More... | |
size_type | size () const |
Returns the number of elements in the concurrent vector. This method is concurrency-safe. More... | |
bool | empty () const |
Tests if the concurrent vector is empty at the time this method is called. This method is concurrency-safe. More... | |
size_type | capacity () const |
Returns the maximum size to which the concurrent vector can grow without having to allocate more memory. This method is concurrency-safe. More... | |
void | reserve (size_type _N) |
Allocates enough space to grow the concurrent vector to size _N without having to allocate more memory later. This method is not concurrency-safe. More... | |
void | shrink_to_fit () |
Compacts the internal representation of the concurrent vector to reduce fragmentation and optimize memory usage. This method is not concurrency-safe. More... | |
void | resize (size_type _N) |
Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe. More... | |
void | resize (size_type _N, const _Ty &_Val) |
Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe. More... | |
size_type | max_size () const |
Returns the maximum number of elements the concurrent vector can hold. This method is concurrency-safe. More... | |
iterator | begin () |
Returns an iterator of type iterator or const_iterator to the beginning of the concurrent vector. This method is concurrency-safe. More... | |
iterator | end () |
Returns an iterator of type iterator or const_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
const_iterator | begin () const |
Returns an iterator of type iterator or const_iterator to the beginning of the concurrent vector. This method is concurrency-safe. More... | |
const_iterator | end () const |
Returns an iterator of type iterator or const_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
reverse_iterator | rbegin () |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the beginning of the concurrent vector. This method is concurrency-safe. More... | |
reverse_iterator | rend () |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
const_reverse_iterator | rbegin () const |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the beginning the concurrent vector. This method is concurrency-safe. More... | |
const_reverse_iterator | rend () const |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
const_iterator | cbegin () const |
Returns an iterator of type const_iterator to the beginning of the concurrent vector. This method is concurrency-safe. More... | |
const_iterator | cend () const |
Returns an iterator of type const_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
const_reverse_iterator | crbegin () const |
Returns an iterator of type const_reverse_iterator to the beginning of the concurrent vector. This method is concurrency-safe. More... | |
const_reverse_iterator | crend () const |
Returns an iterator of type const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe. More... | |
reference | front () |
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. More... | |
const_reference | front () const |
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. More... | |
reference | back () |
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. More... | |
const_reference | back () const |
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. More... | |
allocator_type | get_allocator () const |
Returns a copy of the allocator used to construct the concurrent vector. This method is concurrency-safe. More... | |
void | assign (size_type _N, const_reference _Item) |
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. More... | |
template<class _InputIterator > | |
void | assign (_InputIterator _Begin, _InputIterator _End) |
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. More... | |
void | swap (concurrent_vector &_Vector) |
Swaps the contents of two concurrent vectors. This method is not concurrency-safe. More... | |
void | clear () |
Erases all elements in the concurrent vector. This method is not concurrency-safe. More... | |
~concurrent_vector () | |
Erases all elements and destroys this concurrent vector. More... | |
const ::Concurrency::details::_Concurrent_vector_base_v4 & | _Internal_vector_base () const |
::Concurrency::details::_Concurrent_vector_base_v4 & | _Internal_vector_base () |
Private Types | |
typedef concurrent_vector< _Ty, _Ax > | _Myt |
Private Types inherited from Concurrency::details::_Concurrent_vector_base_v4 | |
typedef size_t | _Segment_index_t |
typedef size_t | _Size_type |
typedef void(__cdecl * | _My_internal_array_op1) (void *_Begin, _Size_type _N) |
typedef void(__cdecl * | _My_internal_array_op2) (void *_Dst, const void *_Src, _Size_type _N) |
Static Private Member Functions | |
static void *__cdecl | _Internal_allocator (::Concurrency::details::_Concurrent_vector_base_v4 &_Vb, size_t _K) |
static void __cdecl | _Initialize_array (void *_Begin, const void *, size_type _N) |
static void __cdecl | _Initialize_array_by (void *_Begin, const void *_Src, size_type _N) |
static void __cdecl | _Copy_array (void *_Dst, const void *_Src, size_type _N) |
static void __cdecl | _Assign_array (void *_Dst, const void *_Src, size_type _N) |
static void __cdecl | _Destroy_array (void *_Begin, size_type _N) |
Static Private Member Functions inherited from Concurrency::details::_Concurrent_vector_base_v4 | |
static _CONCRTIMP _Segment_index_t __cdecl | _Segment_index_of (_Size_type _Index) |
static _Segment_index_t | _Segment_base (_Segment_index_t _K) |
static _Segment_index_t | _Segment_base_index_of (_Segment_index_t &_Index) |
static _Size_type | _Segment_size (_Segment_index_t _K) |
Friends | |
template<typename _C , typename _U > | |
class | details::_Vector_iterator |
Additional Inherited Members | |
Protected Types inherited from Concurrency::details::_Allocator_base< _Ty, _Ax > | |
typedef _Ax::template rebind< _Ty >::other | _Allocator_type |
Protected Member Functions inherited from Concurrency::details::_Allocator_base< _Ty, _Ax > | |
_Allocator_base () | |
_Allocator_base (const _Allocator_type &_Al) | |
Protected Attributes inherited from Concurrency::details::_Allocator_base< _Ty, _Ax > | |
_Allocator_type | _My_allocator |
Private Attributes inherited from Concurrency::details::_Concurrent_vector_base_v4 | |
_Segment_t | _My_storage [_Pointers_per_short_table] |
_Subatomic< _Size_type > | _My_first_block |
_Subatomic< _Size_type > | _My_early_size |
_Subatomic< _Segment_t * > | _My_segment |
Static Private Attributes inherited from Concurrency::details::_Concurrent_vector_base_v4 | |
static const _Segment_index_t | _Default_initial_segments = 1 |
static const _Segment_index_t | _Pointers_per_short_table = 3 |
static const _Segment_index_t | _Pointers_per_long_table = sizeof(_Segment_index_t) * 8 |
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.
_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 > . |
For detailed information on the concurrent_vector
class, see Parallel Containers and Objects.
|
private |
typedef details::_Allocator_base<_Ty, _Ax>::_Allocator_type Concurrency::concurrent_vector< _Ty, _Ax >::allocator_type |
A type that represents the allocator class for the concurrent vector.
typedef details::_Vector_iterator<concurrent_vector,const _Ty> Concurrency::concurrent_vector< _Ty, _Ax >::const_iterator |
A type that provides a random-access iterator that can read a const
element in a concurrent vector.
typedef const _Ty* Concurrency::concurrent_vector< _Ty, _Ax >::const_pointer |
A type that provides a pointer to a const
element in a concurrent vector.
typedef const _Ty& Concurrency::concurrent_vector< _Ty, _Ax >::const_reference |
A type that provides a reference to a const
element stored in a concurrent vector for reading and performing const
operations.
typedef std::reverse_iterator<const_iterator> Concurrency::concurrent_vector< _Ty, _Ax >::const_reverse_iterator |
A type that provides a random-access iterator that can read any const
element in the concurrent vector.
typedef ptrdiff_t Concurrency::concurrent_vector< _Ty, _Ax >::difference_type |
A type that provides the signed distance between two elements in a concurrent vector.
typedef details::_Vector_iterator<concurrent_vector,_Ty> Concurrency::concurrent_vector< _Ty, _Ax >::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.
typedef _Ty* Concurrency::concurrent_vector< _Ty, _Ax >::pointer |
A type that provides a pointer to an element in a concurrent vector.
typedef _Ty& Concurrency::concurrent_vector< _Ty, _Ax >::reference |
A type that provides a reference to an element stored in a concurrent vector.
typedef std::reverse_iterator<iterator> Concurrency::concurrent_vector< _Ty, _Ax >::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.
typedef details::_Concurrent_vector_base_v4::_Size_type Concurrency::concurrent_vector< _Ty, _Ax >::size_type |
A type that counts the number of elements in a concurrent vector.
typedef _Ty Concurrency::concurrent_vector< _Ty, _Ax >::value_type |
A type that represents the data type stored in a concurrent vector.
|
inlineexplicit |
Constructs a concurrent vector.
_Al | The allocator class to use with this object. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Constructs a concurrent vector.
_Vector | The source concurrent_vector object to copy or move elements from. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Constructs a concurrent vector.
M | The allocator type of the source vector. |
_Vector | The source concurrent_vector object to copy or move elements from. |
_Al | The allocator class to use with this object. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Constructs a concurrent vector.
_Vector | The source concurrent_vector object to copy or move elements from. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inlineexplicit |
Constructs a concurrent vector.
_N | The initial size of the concurrent_vector object. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Constructs a concurrent vector.
_N | The initial capacity of the concurrent_vector object. |
_Item | The value of elements in the constructed object. |
_Al | The allocator class to use with this object. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Constructs a concurrent vector.
_InputIterator | The type of the input iterator. |
_Begin | Position of the first element in the range of elements to be copied. |
_End | Position of the first element beyond the range of elements to be copied. |
_Al | The allocator class to use with this object. |
All constructors store an allocator object _Al and initialize the vector.
The first constructor specify an empty initial vector and explicitly specifies the allocator type. to be used.
The second and third constructors specify a copy of the concurrent vector _Vector .
The fourth constructor specifies a move of the concurrent vector _Vector .
The fifth constructor specifies a repetition of a specified number (_N ) of elements of the default value for class _Ty .
The sixth constructor specifies a repetition of (_N ) elements of value _Item .
The last constructor specifies values supplied by the iterator range [_Begin , _End ).
|
inline |
Erases all elements and destroys this concurrent vector.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
inlinestaticprivate |
|
private |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
inline |
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.
_N | The number of items to copy into the concurrent vector. |
_Item | Reference to a value used to fill the concurrent vector. |
assign
is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method.
|
inline |
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.
_InputIterator | The type of the specified iterator. |
_Begin | An iterator to the first element of the source range. |
_End | An iterator to one past the last element of the source range. |
assign
is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method.
|
inline |
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.
_Index | The index of the element to be retrieved. |
The version of the function at
that returns a non-const
reference cannot be used to concurrently write to the element from different threads. A different synchronization object should be used to synchronize concurrent read and write operations to the same data element.
The method throws out_of_range
if _Index is greater than or equal to the size of the concurrent vector, and range_error
if the index is for a broken portion of the vector. For details on how a vector can become broken, see Parallel Containers and Objects.
|
inline |
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.
_Index | The index of the element to be retrieved. |
const
reference to the item at the given index. The version of the function at
that returns a non-const
reference cannot be used to concurrently write to the element from different threads. A different synchronization object should be used to synchronize concurrent read and write operations to the same data element.
The method throws out_of_range
if _Index is greater than or equal to the size of the concurrent vector, and range_error
if the index is for a broken portion of the vector. For details on how a vector can become broken, see Parallel Containers and Objects.
|
inline |
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.
const
reference to the last element in the concurrent vector.
|
inline |
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.
const
reference to the last element in the concurrent vector.
|
inline |
Returns an iterator of type iterator or const_iterator to the beginning of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type iterator or const_iterator to the beginning of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns the maximum size to which the concurrent vector can grow without having to allocate more memory. This method is concurrency-safe.
Unlike an STL vector
, a concurrent_vector
object does not move existing elements if it allocates more memory.
|
inline |
Returns an iterator of type const_iterator to the beginning of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type const_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
Erases all elements in the concurrent vector. This method is not concurrency-safe.
clear
is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method. clear
does not free internal arrays. To free internal arrays, call the function shrink_to_fit
after clear
.
|
inline |
Returns an iterator of type const_reverse_iterator to the beginning of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
Tests if the concurrent vector is empty at the time this method is called. This method is concurrency-safe.
true
if the vector was empty at the moment the function was called, false
otherwise.
|
inline |
Returns an iterator of type iterator or const_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type iterator or const_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
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.
const
reference to the first element in the concurrent vector.
|
inline |
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.
const
reference to the first element in the concurrent_vector
object.
|
inline |
Returns a copy of the allocator used to construct the concurrent vector. This method is concurrency-safe.
concurrent_vector
object.
|
inline |
Grows this concurrent vector by _Delta elements. This method is concurrency-safe.
_Delta | The number of elements to append to the object. |
If _Item is not specified, the new elements are default constructed.
|
inline |
Grows this concurrent vector by _Delta elements. This method is concurrency-safe.
_Delta | The number of elements to append to the object. |
_Item | The value to initialize the new elements with. |
If _Item is not specified, the new elements are default constructed.
|
inline |
Grows this concurrent vector until it has at least _N elements. This method is concurrency-safe.
_N | The new minimum size for the concurrent_vector object. |
|
private |
|
inline |
Returns the maximum number of elements the concurrent vector can hold. This method is concurrency-safe.
concurrent_vector
object can hold.
|
inline |
Assigns the contents of another concurrent_vector
object to this one. This method is not concurrency-safe.
_Vector | The source concurrent_vector object. |
concurrent_vector
object.
|
inline |
Assigns the contents of another concurrent_vector
object to this one. This method is not concurrency-safe.
M | The allocator type of the source vector. |
_Vector | The source concurrent_vector object. |
concurrent_vector
object.
|
inline |
Assigns the contents of another concurrent_vector
object to this one. This method is not concurrency-safe.
_Vector | The source concurrent_vector object. |
concurrent_vector
object.
|
inline |
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.
_Index | The index of the element to be retrieved. |
The version of operator []
that returns a non-const
reference cannot be used to concurrently write to the element from different threads. A different synchronization object should be used to synchronize concurrent read and write operations to the same data element.
No bounds checking is performed to ensure that _Index is a valid index into the concurrent vector.
|
inline |
Provides read access to 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.
_Index | The index of the element to be retrieved. |
const
reference to the item at the given index. The version of operator []
that returns a non-const
reference cannot be used to concurrently write to the element from different threads. A different synchronization object should be used to synchronize concurrent read and write operations to the same data element.
No bounds checking is performed to ensure that _Index is a valid index into the concurrent vector.
|
inline |
Appends the given item to the end of the concurrent vector. This method is concurrency-safe.
_Item | The value to be appended. |
|
inline |
Appends the given item to the end of the concurrent vector. This method is concurrency-safe.
_Item | The value to be appended. |
|
inline |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the beginning of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the beginning the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
Returns an iterator of type reverse_iterator or const_reverse_iterator to the end of the concurrent vector. This method is concurrency-safe.
|
inline |
Allocates enough space to grow the concurrent vector to size _N without having to allocate more memory later. This method is not concurrency-safe.
_N | The number of elements to reserve space for. |
reserve
is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method. The capacity of the concurrent vector after the method returns may be bigger than the requested reservation.
|
inline |
Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe.
_N | The new size of the concurrent vector. |
If the size of the container is less than the requested size, elements are added to the vector until it reaches the requested size. If the size of the container is larger than the requested size, the elements closest to the end of the container are deleted until the container reaches the size _N . If the present size of the container is the same as the requested size, no action is taken.
resize
is not concurrency safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method.
|
inline |
Changes the size of the concurrent vector to the requested size, deleting or adding elements as necessary. This method is not concurrency-safe.
_N | The new size of the concurrent_vector. |
_Val | The value of new elements added to the vector if the new size is larger than the original size. If the value is omitted, the new objects are assigned the default value for their type. |
If the size of the container is less than the requested size, elements are added to the vector until it reaches the requested size. If the size of the container is larger than the requested size, the elements closest to the end of the container are deleted until the container reaches the size _N . If the present size of the container is the same as the requested size, no action is taken.
resize
is not concurrency safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this method.
void Concurrency::concurrent_vector< _Ty, _Ax >::shrink_to_fit | ( | ) |
Compacts the internal representation of the concurrent vector to reduce fragmentation and optimize memory usage. This method is not concurrency-safe.
Compacts the internal representation of the concurrent vector to reduce fragmentation and optimize memory usage.
This method will internally re-allocate memory move elements around, invalidating all the iterators. shrink_to_fit
is not concurrency-safe. You must ensure that no other threads are invoking methods on the concurrent vector when you call this function.
|
inline |
Returns the number of elements in the concurrent vector. This method is concurrency-safe.
concurrent_vector
object. The returned size is guaranteed to include all elements appended by calls to the function push_back
, or grow operations that have completed prior to invoking this method. However, it may also include elements that are allocated but still under construction by concurrent calls to any of the growth methods.
|
inline |
Swaps the contents of two concurrent vectors. This method is not concurrency-safe.
_Vector | The concurrent_vector object to swap contents with. |
|
friend |