17 #ifndef __TBB_concurrent_vector_H    18 #define __TBB_concurrent_vector_H    20 #define __TBB_concurrent_vector_H_include_area    32 #include __TBB_STD_SWAP_HEADER    38 #if _MSC_VER==1500 && !__INTEL_COMPILER    40     #pragma warning( push )    41     #pragma warning( disable: 4985 )    44 #if _MSC_VER==1500 && !__INTEL_COMPILER    45     #pragma warning( pop )    48 #if __TBB_INITIALIZER_LISTS_PRESENT    49     #include <initializer_list>    52 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)    54     #pragma warning (push)    56     #pragma warning (disable: 4267)    58     #pragma warning (disable: 4127) //warning C4127: conditional expression is constant    63 template<
typename T, 
class A = cache_aligned_allocator<T> >
    69     template<
typename Container, 
typename Value>
    78         std::memset( static_cast<void*>(array), 0, n_of_elements * 
sizeof( T ) );
   114             template<
typename argument_type>
   118             T* 
pointer()
 const {  
return static_cast<T*>(const_cast<void*>(
array)); }
   138                 tbb::internal::swap<relaxed>(
array, rhs.
array);
   146             template<memory_semantics M>
   149             template<memory_semantics M>
   154             template<memory_semantics M>
   160             template<memory_semantics M>
   163                      "other overloads of store should be used for marking segment as not_used or allocation_failed" );
   164                 array.store<M>(allocated_segment_pointer);
   237             __TBB_ASSERT(element_index, 
"there should be no need to call "   238                                         "is_first_element_in_segment for 0th element" );
   279         template<
typename Container, 
typename Value>
   293     template<
typename Container, 
typename Value>
   306         template<
typename C, 
typename T>
   309         template<
typename C, 
typename T, 
typename U>
   312         template<
typename C, 
typename T, 
typename U>
   315         template<
typename C, 
typename T, 
typename U>
   318         template<
typename C, 
typename U>
   321 #if !__TBB_TEMPLATE_FRIENDS_BROKEN   322         template<
typename T, 
class A>
   329             my_vector(const_cast<Container*>(&vector)),
   331             my_item(static_cast<Value*>(ptr))
   399             __TBB_ASSERT( 
my_index>0, 
"operator--() applied to iterator already at beginning of concurrent_vector" );
   436     template<
typename Container, 
typename T>
   441     template<
typename Container, 
typename T, 
typename U>
   446     template<
typename Container, 
typename T, 
typename U>
   451     template<
typename Container, 
typename T, 
typename U>
   456     template<
typename Container, 
typename T, 
typename U>
   461     template<
typename Container, 
typename T, 
typename U>
   466     template<
typename Container, 
typename T, 
typename U>
   471     template<
typename Container, 
typename T, 
typename U>
   476     template<
typename T, 
class A>
   549 template<
typename T, 
class A>
   550 class concurrent_vector: 
protected internal::allocator_base<T, A>,
   567     template<
typename C, 
typename U>
   587 #if !defined(_MSC_VER) || _CPPLIB_VER>=300   616 #if __TBB_INITIALIZER_LISTS_PRESENT   631 #endif //# __TBB_INITIALIZER_LISTS_PRESENT   647 #if __TBB_CPP11_RVALUE_REF_PRESENT   663         if (a == source.my_allocator) {
   737         if( 
this != &vector )
   742 #if __TBB_CPP11_RVALUE_REF_PRESENT   746         __TBB_ASSERT(
this != &other, 
"Move assignment to itself is prohibited ");
   763         if( static_cast<void*>( 
this ) != static_cast<const void*>( &vector ) )
   769 #if __TBB_INITIALIZER_LISTS_PRESENT   776 #endif //#if __TBB_INITIALIZER_LISTS_PRESENT   796         typename std::iterator_traits<I>::difference_type delta = std::distance(
first, 
last);
   802 #if __TBB_INITIALIZER_LISTS_PRESENT   805         return grow_by( init_list.begin(), init_list.end() );
   807 #endif //#if __TBB_INITIALIZER_LISTS_PRESENT   838         push_back_helper prolog(*
this);
   839         new(prolog.internal_push_back_result()) T(item);
   840         return prolog.return_iterator_and_dismiss();
   843 #if    __TBB_CPP11_RVALUE_REF_PRESENT   848         push_back_helper prolog(*
this);
   849         new(prolog.internal_push_back_result()) T(
std::move(item));
   850         return prolog.return_iterator_and_dismiss();
   852 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT   855     template<
typename... Args>
   858         push_back_helper prolog(*
this);
   859         new(prolog.internal_push_back_result()) T(std::forward<Args>(args)...);
   860         return prolog.return_iterator_and_dismiss();
   862 #endif //__TBB_CPP11_VARIADIC_TEMPLATES_PRESENT   863 #endif //__TBB_CPP11_RVALUE_REF_PRESENT   902         return cp < sz ? cp : sz;
   967         return (segment_value.template 
pointer<T>())[0];
  1000 #if __TBB_INITIALIZER_LISTS_PRESENT  1001     void assign(std::initializer_list<T> init_list) {
  1005 #endif //# __TBB_INITIALIZER_LISTS_PRESENT  1083 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT  1086 #endif //__TBB_MOVE_IF_NO_EXCEPT_PRESENT  1088 #if __TBB_CPP11_RVALUE_REF_PRESENT  1095     template<
typename Iterator>
  1113         static T* 
as_pointer(
const void *src) { 
return static_cast<T*>(const_cast<void *>(src)); }
  1121 #if __TBB_CPP11_RVALUE_REF_PRESENT  1125 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT  1126         void move_construct_if_noexcept(
const void *src)    { 
for(; 
i < 
n; ++
i) 
new( &
array[
i] ) T( std::move_if_noexcept(
as_pointer(src)[
i]) ); }
  1127 #endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT  1130         template<
class I> 
void iterate(I &src) { 
for(; 
i < 
n; ++
i, ++src) 
new( &
array[
i] ) T( *src ); }
  1169 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT  1171 template<
typename I,
  1172          typename T = 
typename std::iterator_traits<I>::value_type,
  1173          typename A = cache_aligned_allocator<T>
  1174 > concurrent_vector(I, I, 
const A& = A())
  1175 -> concurrent_vector<T, A>;
  1178 template<
typename T, 
typename A1, 
typename A2>
  1179 concurrent_vector(
const concurrent_vector<T, A1> &, 
const A2 &)
  1180 -> concurrent_vector<T, A2>;
  1183 template<
typename T, 
typename A = cache_aligned_allocator<T>
  1184 > concurrent_vector(std::initializer_list<T>, 
const A& = A())
  1185 -> concurrent_vector<T, A>;
  1188 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)  1189 #pragma warning (push)  1190 #pragma warning (disable: 4701) // potentially uninitialized local variable "old"  1192 template<
typename T, 
class A>
  1196         internal_array_op2 copy_or_move_array =
  1197 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT  1198                 &move_array_if_noexcept
  1203         if( internal_compact( 
sizeof(T), &old, &destroy_array, copy_or_move_array ) )
  1204             internal_free_segments( old.
table, pointers_per_long_table, old.
first_block ); 
  1211 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)  1212 #pragma warning (pop)  1213 #endif // warning 4701 is back  1215 template<
typename T, 
class A>
  1218     while( k > first_block ) {
  1223             this->my_allocator.deallocate( (segment_value.
pointer<T>()), segment_size(k) );
  1229         this->my_allocator.deallocate( (segment_value.
pointer<T>()), segment_size(first_block) );
  1233 template<
typename T, 
class A>
  1236     __TBB_ASSERT( index < my_early_size, 
"index out of bounds" );
  1239     __TBB_ASSERT( my_segment.load<
acquire>() != my_storage || k < pointers_per_short_table, 
"index is being allocated" );
  1244     segment_value_t segment_value =  my_segment[k].template load<relaxed>();
  1247     return (( segment_value.
pointer<T>()))[j];
  1250 template<
typename T, 
class A>
  1252     if( index >= my_early_size )
  1257     if( my_segment.load<
acquire>() == my_storage && k >= pointers_per_short_table )
  1263     segment_value_t segment_value =  my_segment[k].template load<relaxed>();
  1265     return (segment_value.
pointer<T>())[j];
  1268 template<
typename T, 
class A> 
template<
class I>
  1273     internal_reserve(n, 
sizeof(T), max_size());
  1277     size_type sz = segment_size( my_first_block );
  1279         internal_loop_guide loop(sz, my_segment[k].
template load<relaxed>().
template pointer<void>());
  1280         loop.iterate(
first);
  1282         if( !k ) k = my_first_block;
  1283         else { ++k; sz <<= 1; }
  1285     internal_loop_guide loop(n, my_segment[k].
template load<relaxed>().
template pointer<void>());
  1286     loop.iterate(
first);
  1289 template<
typename T, 
class A>
  1291     internal_loop_guide loop(n, 
begin); loop.init();
  1294 template<
typename T, 
class A>
  1296     internal_loop_guide loop(n, 
begin); loop.init(src);
  1299 template<
typename T, 
class A>
  1301     internal_loop_guide loop(n, dst); loop.copy(src);
  1304 #if __TBB_CPP11_RVALUE_REF_PRESENT  1305 template<
typename T, 
class A>
  1307     internal_loop_guide loop(n, dst); loop.move_construct(src);
  1309 template<
typename T, 
class A>
  1311     internal_loop_guide loop(n, dst); loop.move_assign(src);
  1315 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT  1316 template<
typename T, 
class A>
  1318     internal_loop_guide loop(n, dst); loop.move_construct_if_noexcept(src);
  1320 #endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT  1322 template<
typename T, 
class A>
  1323 template<
typename I>
  1325     internal_loop_guide loop(n, dst);
  1326     loop.iterate( *(static_cast<I*>(const_cast<void*>(p_type_erased_iterator))) );
  1329 template<
typename T, 
class A>
  1331     internal_loop_guide loop(n, dst); loop.assign(src);
  1334 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)  1336     #pragma warning (push)  1337     #pragma warning (disable: 4189)  1339 template<
typename T, 
class A>
  1341     T* array = static_cast<T*>(
begin);
  1345 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)  1346     #pragma warning (pop)  1347 #endif // warning 4189 is back  1350 template<
typename T, 
class A1, 
class A2>
  1354     if(a.size() != b.size()) 
return false;
  1357     for(; i != a.end(); ++i, ++j)
  1358         if( !(*i == *j) ) 
return false;
  1362 template<
typename T, 
class A1, 
class A2>
  1364 {    
return !(a == b); }
  1366 template<
typename T, 
class A1, 
class A2>
  1368 {    
return (std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end())); }
  1370 template<
typename T, 
class A1, 
class A2>
  1374 template<
typename T, 
class A1, 
class A2>
  1376 {    
return !(b < a); }
  1378 template<
typename T, 
class A1, 
class A2>
  1380 {    
return !(a < b); }
  1382 template<
typename T, 
class A>
  1388 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)  1389     #pragma warning (pop)  1390 #endif // warning 4267,4127 are back  1393 #undef __TBB_concurrent_vector_H_include_area void resize(size_type n)
Resize the vector. Not thread-safe.
 
const_reverse_iterator crend() const
reverse end const iterator
 
reference back()
the last item
 
void __TBB_EXPORTED_METHOD internal_reserve(size_type n, size_type element_size, size_type max_size)
 
friend bool operator==(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
 
T & internal_subscript_with_exceptions(size_type index) const
Get reference to element at given index with errors checks.
 
size_type __TBB_EXPORTED_METHOD internal_grow_to_at_least_with_result(size_type new_size, size_type element_size, internal_array_op2 init, const void *src)
 
const_reference operator[](size_type index) const
Get const reference to element at given index.
 
friend bool operator==(segment_value_t const &lhs, segment_allocation_failed)
 
void assign(size_type n, const_reference t)
assign n items by copying t item
 
concurrent_vector_base_v3 concurrent_vector_base
 
friend bool operator==(segment_value_t const &lhs, segment_allocated)
 
concurrent_vector_base_v3()
 
static void __TBB_EXPORTED_FUNC copy_range(void *dst, const void *p_type_erased_iterator, size_type n)
Copy-construct n instances of T, starting at "dst" by iterator range of [p_type_erased_iterator,...
 
const_range_type range(size_t grainsize=1) const
Get const range for iterating with parallel algorithms.
 
void move_assign(const void *src)
 
bool operator<=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
iterator end()
end iterator
 
range_type range(size_t grainsize=1)
Get range for iterating with parallel algorithms.
 
const_iterator begin() const
start const iterator
 
ptrdiff_t difference_type
 
void allocator_swap(MyAlloc &my_allocator, OtherAlloc &other_allocator, traits_true_type)
 
vector_iterator & operator=(const vector_iterator< Container, typename Container::value_type > &other)
 
vector_iterator & operator+=(ptrdiff_t offset)
 
void __TBB_EXPORTED_METHOD internal_swap(concurrent_vector_base_v3 &v)
 
concurrent_vector(I first, I last, const allocator_type &a=allocator_type())
Construction with copying iteration range and given allocator instance.
 
static size_type segment_size(segment_index_t k)
 
atomic< size_type > my_early_size
Requested size of vector.
 
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t new_size
 
const T & const_reference
 
static void __TBB_EXPORTED_FUNC move_array(void *dst, const void *src, size_type n)
Move-construct n instances of T, starting at "dst" by copying according element of src array.
 
generic_range_type< iterator > range_type
 
Value & operator[](ptrdiff_t k) const
 
Value & operator *() const
 
allocator_type my_allocator
 
Concurrent vector container.
 
bool operator>(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
 
iterator grow_by(size_type delta)
Grow by "delta" elements.
 
friend void enforce_segment_allocated(segment_value_t const &s, internal::exception_id exception=eid_bad_last_alloc)
 
size_t my_index
Index into the vector.
 
T & internal_subscript(size_type index) const
Get reference to element at given index.
 
const_reverse_iterator rend() const
reverse end const iterator
 
vector_iterator< Container, T > operator+(ptrdiff_t offset, const vector_iterator< Container, T > &v)
 
segment_index_t __TBB_EXPORTED_METHOD internal_clear(internal_array_op1 destroy)
 
void swap(segment_t &rhs)
 
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp begin
 
void swap(concurrent_hash_map< Key, T, HashCompare, A > &a, concurrent_hash_map< Key, T, HashCompare, A > &b)
 
static segment_index_t segment_index_of(size_type index)
 
void allocator_move_assignment(MyAlloc &my_allocator, OtherAlloc &other_allocator, traits_true_type)
 
internal::concurrent_vector_base_v3::size_type size_type
 
static segment_index_t segment_base(segment_index_t k)
 
static bool is_first_element_in_segment(size_type element_index)
 
std::reverse_iterator< iterator > reverse_iterator
 
const_iterator cend() const
end const iterator
 
vector_iterator & operator-=(ptrdiff_t offset)
 
segment_t(segment_t const &rhs)
 
const_iterator end() const
end const iterator
 
segment_t & operator=(segment_t const &rhs)
 
concurrent_vector(const allocator_type &a=allocator_type())
Construct empty vector.
 
concurrent_vector(size_type n)
Construction with initial size specified by argument n.
 
Base class of concurrent vector implementation.
 
iterator begin()
start iterator
 
segment_t table[pointers_per_long_table]
 
static T * as_pointer(const void *src)
 
vector_iterator()
Default constructor.
 
size_type capacity() const
Maximum size to which array can grow without allocating more memory. Concurrent allocations are not i...
 
bool operator>=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
size_type max_size() const
Upper bound on argument to reserve.
 
static void __TBB_EXPORTED_FUNC assign_array(void *dst, const void *src, size_type n)
Assign (using operator=) n instances of T, starting at "dst" by assigning according element of src ar...
 
void(__TBB_EXPORTED_FUNC * internal_array_op2)(void *dst, const void *src, size_type n)
An operation on n-element destination array and n-element source array.
 
bool empty() const
Return false if vector is not empty or has elements under construction at least.
 
const_iterator cbegin() const
start const iterator
 
auto last(Container &c) -> decltype(begin(c))
 
bool operator<(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
void assign(const void *src)
 
void store(segment_not_used)
 
void __TBB_EXPORTED_METHOD internal_grow_to_at_least(size_type new_size, size_type element_size, internal_array_op2 init, const void *src)
Deprecated entry point for backwards compatibility to TBB 2.1.
 
void init(const void *src)
 
allocator_traits< Alloc >::template rebind_alloc< T >::other type
 
segment_value_t load() const
 
bool operator>=(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
 
void internal_assign_range(I first, I last, is_integer_tag< true > *)
assign integer items by copying when arguments are treated as iterators. See C++ Standard 2003 23....
 
void shrink_to_fit()
Optimize memory usage and fragmentation.
 
vector_iterator operator--(int)
Post decrement.
 
bool operator!=(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
 
iterator grow_by(I first, I last)
 
pointer internal_push_back_result()
 
void handle_unconstructed_elements(T *array, size_t n_of_elements)
Exception helper function.
 
tbb::internal::allocator_rebind< A, T >::type allocator_type
 
size_type grainsize() const
The grain size for this range.
 
void internal_assign_n(size_type n, const_pointer p)
assign n items by copying t
 
void copy(const void *src)
 
static void *const vector_allocation_error_flag
Bad allocation marker.
 
const_reference back() const
the last item const
 
size_type __TBB_EXPORTED_METHOD internal_grow_by(size_type delta, size_type element_size, internal_array_op2 init, const void *src)
 
void internal_assign_range(I first, I last, is_integer_tag< false > *)
inline proxy assign by iterators
 
__TBB_EXPORTED_METHOD ~concurrent_vector_base_v3()
 
friend ptrdiff_t operator-(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
 
segment_index_t first_block
 
void move_construct(const void *src)
 
Exception-aware helper class for filling a segment by exception-danger operators of user class.
 
void internal_grow(size_type start, size_type finish, size_type element_size, internal_array_op2 init, const void *src)
 
#define __TBB_NOEXCEPT(expression)
 
bool operator<(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
 
static void * internal_allocator(internal::concurrent_vector_base_v3 &vb, size_t k)
Allocate k items.
 
static const T * as_const_pointer(const void *ptr)
 
friend bool operator!=(segment_value_t const &lhs, argument_type arg)
 
const_iterator begin() const
Beginning of range.
 
size_type size() const
Return size of vector. It may include elements under construction.
 
void internal_free_segments(segment_t table[], segment_index_t k, segment_index_t first_block)
Free k segments from table.
 
const internal::concurrent_vector_base_v3 & internal_vector_base() const
 
iterator emplace_back(Args &&... args)
Push item, create item "in place" with provided arguments.
 
concurrent_vector(const concurrent_vector &vector, const allocator_type &a=allocator_type())
Copying constructor.
 
size_type __TBB_EXPORTED_METHOD internal_capacity() const
 
void __TBB_EXPORTED_METHOD internal_copy(const concurrent_vector_base_v3 &src, size_type element_size, internal_array_op2 copy)
 
segment_t my_storage[pointers_per_short_table]
embedded storage of segment pointers
 
generic_range_type(const generic_range_type< U > &r)
 
void const char const char int ITT_FORMAT __itt_group_sync p
 
allocator_type get_allocator() const
return allocator object
 
bool is_power_of_two_at_least(argument_integer_type arg, power2_integer_type power2)
A function to determine if arg is a power of 2 at least as big as another power of 2.
 
#define __TBB_EXPORTED_FUNC
 
push_back_helper(concurrent_vector &vector)
 
Meets requirements of a forward iterator for STL and a Value for a blocked_range.*/.
 
~element_construction_guard()
 
Value * my_item
Caches my_vector->internal_subscript(my_index)
 
Container * my_vector
concurrent_vector over which we are iterating.
 
bool operator>(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
vector_iterator & operator--()
Pre decrement.
 
iterator push_back(const_reference item)
Push item.
 
std::reverse_iterator< const_iterator > const_reverse_iterator
 
iterator push_back(T &&item)
Push item, move-aware.
 
generic_range_type(I begin_, I end_, size_t grainsize_=1)
 
void clear()
Clear container while keeping memory allocated.
 
iterator return_iterator_and_dismiss()
 
iterator grow_by(std::initializer_list< T > init_list)
 
const_reference at(size_type index) const
Get const reference to element at given index. Throws exceptions on errors.
 
static void __TBB_EXPORTED_FUNC destroy_array(void *begin, size_type n)
Destroy n instances of T, starting at "begin".
 
void swap(concurrent_vector &vector)
swap two instances
 
void store(segment_allocation_failed)
 
ptrdiff_t difference_type
 
Dummy type that distinguishes splitting constructor from copy constructor.
 
std::random_access_iterator_tag iterator_category
 
bool operator==(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
__TBB_DEPRECATED concurrent_vector & operator=(const concurrent_vector< T, M > &vector)
Assignment for vector with different allocator type.
 
Base class for types that should not be copied or assigned.
 
ptrdiff_t operator-(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
const_reverse_iterator crbegin() const
reverse start const iterator
 
friend bool operator==(segment_value_t const &lhs, segment_not_used)
 
internal_loop_guide(size_type ntrials, void *ptr)
 
concurrent_vector & operator=(const concurrent_vector &vector)
Assignment.
 
vector_iterator operator+(ptrdiff_t offset) const
 
auto first(Container &c) -> decltype(begin(c))
 
void internal_assign_iterators(I first, I last)
assign by iterators
 
concurrent_vector(concurrent_vector &&source, const allocator_type &a)
 
internal::vector_iterator< concurrent_vector, const T > const_iterator
 
void reserve(size_type n)
Allocate enough space to grow to size n without having to allocate more memory later.
 
static void __TBB_EXPORTED_FUNC move_assign_array(void *dst, const void *src, size_type n)
Move-assign (using operator=) n instances of T, starting at "dst" by assigning according element of s...
 
~concurrent_vector()
Clear and destroy vector.
 
void assign(I first, I last)
assign range [first, last)
 
void swap(atomic< T > &lhs, atomic< T > &rhs)
 
internal::allocator_base< T, A >::allocator_type allocator_type
 
generic_range_type(generic_range_type &r, split)
 
allocator_base(const allocator_type &a=allocator_type())
 
iterator grow_to_at_least(size_type n)
Append minimal sequence of elements such that size()>=n.
 
True/false function override helper.
 
void store(void *allocated_segment_pointer) __TBB_NOEXCEPT(true)
 
void const char const char int ITT_FORMAT __itt_group_sync s
 
vector_iterator operator++(int)
Post increment.
 
Class for determining type of std::allocator<T>::value_type.
 
intptr_t __TBB_Log2(uintptr_t x)
 
reverse_iterator rbegin()
reverse start iterator
 
void resize(size_type n, const_reference t)
Resize the vector, copy t for new elements. Not thread-safe.
 
internal::vector_iterator< concurrent_vector, T > iterator
 
Internal structure for compact()
 
friend vector_iterator< C, T > operator+(ptrdiff_t offset, const vector_iterator< C, T > &v)
 
A range over which to iterate.
 
Number of slots for segment pointers inside the class.
 
#define __TBB_EXPORTED_METHOD
 
void __TBB_EXPORTED_METHOD internal_resize(size_type n, size_type element_size, size_type max_size, const void *src, internal_array_op1 destroy, internal_array_op2 init)
 
atomic< size_type > my_first_block
count of segments in the first block
 
concurrent_vector(concurrent_vector &&source)
Move constructor.
 
void *__TBB_EXPORTED_METHOD internal_push_back(size_type element_size, size_type &index)
 
void(__TBB_EXPORTED_FUNC * internal_array_op1)(void *begin, size_type n)
An operation on an n-element array starting at begin.
 
concurrent_vector(size_type n, const_reference t, const allocator_type &a=allocator_type())
Construction with initial size specified by argument n, initialization by copying of t,...
 
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
 
element_construction_guard g
 
element_construction_guard(pointer an_element)
 
concurrent_vector & operator=(concurrent_vector &&other)
Move assignment.
 
const_reference front() const
the first item const
 
void __TBB_EXPORTED_METHOD internal_assign(const concurrent_vector_base_v3 &src, size_type element_size, internal_array_op1 destroy, internal_array_op2 assign, internal_array_op2 copy)
 
const_reverse_iterator rbegin() const
reverse start const iterator
 
static void __TBB_EXPORTED_FUNC copy_array(void *dst, const void *src, size_type n)
Copy-construct n instances of T by copying single element pointed to by src, starting at "dst".
 
static void __TBB_EXPORTED_FUNC initialize_array(void *begin, const void *, size_type n)
Construct n instances of T, starting at "begin".
 
iterator grow_to_at_least(size_type n, const_reference t)
 
const_iterator end() const
One past last value in range.
 
void *(* vector_allocator_ptr)(concurrent_vector_base_v3 &, size_t)
allocator function pointer
 
void *__TBB_EXPORTED_METHOD internal_compact(size_type element_size, void *table, internal_array_op1 destroy, internal_array_op2 copy)
 
reference at(size_type index)
Get reference to element at given index. Throws exceptions on errors.
 
generic_range_type< const_iterator > const_range_type
 
friend void swap(segment_t &, segment_t &) __TBB_NOEXCEPT(true)
 
ptrdiff_t difference_type
 
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
 
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
 
vector_iterator & operator++()
Pre increment.
 
friend bool operator<(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
 
bool operator<=(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
 
Value * operator->() const
 
reverse_iterator rend()
reverse end iterator
 
iterator grow_by(size_type delta, const_reference t)
Grow by "delta" elements using copying constructor.
 
atomic< segment_t * > my_segment
Pointer to the segments table.
 
__TBB_DEPRECATED concurrent_vector(const concurrent_vector< T, M > &vector, const allocator_type &a=allocator_type())
Copying constructor for vector with different allocator type.
 
void __TBB_EXPORTED_METHOD internal_throw_exception(size_type) const
Obsolete.
 
bool operator!=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
 
static segment_index_t segment_base_index_of(segment_index_t &index)
 
vector_iterator(const Container &vector, size_t index, void *ptr=0)
 
const T & const_reference
 
static void __TBB_EXPORTED_FUNC initialize_array_by(void *begin, const void *src, size_type n)
Copy-construct n instances of T, starting at "begin".
 
vector_iterator(const vector_iterator< Container, typename Container::value_type > &other)
 
reference operator[](size_type index)
Get reference to element at given index.
 
reference front()
the first item
 
bool operator==(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
 
void move(tbb_thread &t1, tbb_thread &t2)
 
segment_value_t(void *an_array)
 
vector_iterator operator-(ptrdiff_t offset) const