21 #ifndef __TBB_concurrent_vector_H 22 #define __TBB_concurrent_vector_H 33 #include __TBB_STD_SWAP_HEADER 37 #if _MSC_VER==1500 && !__INTEL_COMPILER 39 #pragma warning( push ) 40 #pragma warning( disable: 4985 ) 43 #if _MSC_VER==1500 && !__INTEL_COMPILER 44 #pragma warning( pop ) 47 #if __TBB_INITIALIZER_LISTS_PRESENT 48 #include <initializer_list> 51 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 53 #pragma warning (push) 55 #pragma warning (disable: 4267) 57 #pragma warning (disable: 4127) //warning C4127: conditional expression is constant 62 template<
typename T,
class A = cache_aligned_allocator<T> >
68 template<
typename Container,
typename Value>
77 std::memset( static_cast<void*>(array), 0, n_of_elements *
sizeof( T ) );
113 template<
typename argument_type>
117 T*
pointer()
const {
return static_cast<T*>(const_cast<void*>(
array)); }
137 tbb::internal::swap<relaxed>(
array, rhs.
array);
145 template<memory_semantics M>
148 template<memory_semantics M>
153 template<memory_semantics M>
159 template<memory_semantics M>
162 "other overloads of store should be used for marking segment as not_used or allocation_failed" );
236 __TBB_ASSERT(element_index,
"there should be no need to call " 237 "is_first_element_in_segment for 0th element" );
278 template<
typename Container,
typename Value>
292 template<
typename Container,
typename Value>
305 template<
typename C,
typename T>
308 template<
typename C,
typename T,
typename U>
311 template<
typename C,
typename T,
typename U>
314 template<
typename C,
typename T,
typename U>
317 template<
typename C,
typename U>
320 #if !__TBB_TEMPLATE_FRIENDS_BROKEN 321 template<
typename T,
class A>
328 my_vector(const_cast<Container*>(&vector)),
330 my_item(static_cast<Value*>(ptr))
390 __TBB_ASSERT(
my_index>0,
"operator--() applied to iterator already at beginning of concurrent_vector" );
427 template<
typename Container,
typename T>
432 template<
typename Container,
typename T,
typename U>
437 template<
typename Container,
typename T,
typename U>
442 template<
typename Container,
typename T,
typename U>
447 template<
typename Container,
typename T,
typename U>
452 template<
typename Container,
typename T,
typename U>
457 template<
typename Container,
typename T,
typename U>
462 template<
typename Container,
typename T,
typename U>
467 template<
typename T,
class A>
470 typedef typename A::template
543 template<
typename T,
class A>
544 class concurrent_vector:
protected internal::allocator_base<T, A>,
561 template<
typename C,
typename U>
562 friend class internal::vector_iterator;
578 typedef internal::vector_iterator<concurrent_vector,T>
iterator;
581 #if !defined(_MSC_VER) || _CPPLIB_VER>=300 610 #if __TBB_INITIALIZER_LISTS_PRESENT 625 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 641 #if __TBB_CPP11_RVALUE_REF_PRESENT 657 if (a == source.my_allocator) {
731 if(
this != &vector )
736 #if __TBB_CPP11_RVALUE_REF_PRESENT 740 __TBB_ASSERT(
this != &other,
"Move assignment to itself is prohibited ");
759 if( static_cast<void*>(
this ) != static_cast<const void*>( &vector ) )
765 #if __TBB_INITIALIZER_LISTS_PRESENT 772 #endif //#if __TBB_INITIALIZER_LISTS_PRESENT 792 typename std::iterator_traits<I>::difference_type delta = std::distance(
first,
last);
798 #if __TBB_INITIALIZER_LISTS_PRESENT 801 return grow_by( init_list.begin(), init_list.end() );
803 #endif //#if __TBB_INITIALIZER_LISTS_PRESENT 834 push_back_helper prolog(*
this);
835 new(prolog.internal_push_back_result()) T(item);
836 return prolog.return_iterator_and_dismiss();
839 #if __TBB_CPP11_RVALUE_REF_PRESENT 844 push_back_helper prolog(*
this);
845 new(prolog.internal_push_back_result()) T(
std::move(item));
846 return prolog.return_iterator_and_dismiss();
848 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 851 template<
typename... Args>
854 push_back_helper prolog(*
this);
855 new(prolog.internal_push_back_result()) T(std::forward<Args>(args)...);
856 return prolog.return_iterator_and_dismiss();
858 #endif //__TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 859 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 898 return cp < sz ? cp : sz;
963 return (segment_value.template
pointer<T>())[0];
996 #if __TBB_INITIALIZER_LISTS_PRESENT 997 void assign(std::initializer_list<T> init_list) {
1001 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 1006 if(
this != &vector ) {
1073 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT 1076 #endif //__TBB_MOVE_IF_NO_EXCEPT_PRESENT 1078 #if __TBB_CPP11_RVALUE_REF_PRESENT 1085 template<
typename Iterator>
1103 static T*
as_pointer(
const void *src) {
return static_cast<T*>(const_cast<void *>(src)); }
1111 #if __TBB_CPP11_RVALUE_REF_PRESENT 1115 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT 1116 void move_construct_if_noexcept(
const void *src) {
for(;
i <
n; ++
i)
new( &
array[
i] ) T( std::move_if_noexcept(
as_pointer(src)[
i]) ); }
1117 #endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT 1120 template<
class I>
void iterate(I &src) {
for(;
i <
n; ++
i, ++src)
new( &
array[
i] ) T( *src ); }
1159 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 1161 template<
typename I,
1162 typename T =
typename std::iterator_traits<I>::value_type,
1163 typename A = cache_aligned_allocator<T>
1164 > concurrent_vector(I, I,
const A& = A())
1165 -> concurrent_vector<T, A>;
1168 template<
typename T,
typename A1,
typename A2>
1169 concurrent_vector(
const concurrent_vector<T, A1> &,
const A2 &)
1170 -> concurrent_vector<T, A2>;
1173 template<
typename T,
typename A = cache_aligned_allocator<T>
1174 > concurrent_vector(std::initializer_list<T>,
const A& = A())
1175 -> concurrent_vector<T, A>;
1178 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 1179 #pragma warning (push) 1180 #pragma warning (disable: 4701) // potentially uninitialized local variable "old" 1182 template<
typename T,
class A>
1186 internal_array_op2 copy_or_move_array =
1187 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT 1188 &move_array_if_noexcept
1193 if( internal_compact(
sizeof(T), &old, &destroy_array, copy_or_move_array ) )
1194 internal_free_segments( old.
table, pointers_per_long_table, old.
first_block );
1201 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 1202 #pragma warning (pop) 1203 #endif // warning 4701 is back 1205 template<
typename T,
class A>
1208 while( k > first_block ) {
1213 this->my_allocator.deallocate( (segment_value.
pointer<T>()), segment_size(k) );
1219 this->my_allocator.deallocate( (segment_value.
pointer<T>()), segment_size(first_block) );
1223 template<
typename T,
class A>
1226 __TBB_ASSERT( index < my_early_size,
"index out of bounds" );
1229 __TBB_ASSERT( my_segment.load<
acquire>() != my_storage || k < pointers_per_short_table,
"index is being allocated" );
1234 segment_value_t segment_value = my_segment[k].template load<relaxed>();
1237 return (( segment_value.
pointer<T>()))[j];
1240 template<
typename T,
class A>
1242 if( index >= my_early_size )
1247 if( my_segment.load<
acquire>() == my_storage && k >= pointers_per_short_table )
1253 segment_value_t segment_value = my_segment[k].template load<relaxed>();
1255 return (segment_value.
pointer<T>())[j];
1258 template<
typename T,
class A>
template<
class I>
1263 internal_reserve(n,
sizeof(T), max_size());
1267 size_type sz = segment_size( my_first_block );
1269 internal_loop_guide loop(sz, my_segment[k].
template load<relaxed>().
template pointer<void>());
1270 loop.iterate(
first);
1272 if( !k ) k = my_first_block;
1273 else { ++k; sz <<= 1; }
1275 internal_loop_guide loop(n, my_segment[k].
template load<relaxed>().
template pointer<void>());
1276 loop.iterate(
first);
1279 template<
typename T,
class A>
1281 internal_loop_guide loop(n,
begin); loop.init();
1284 template<
typename T,
class A>
1286 internal_loop_guide loop(n,
begin); loop.init(src);
1289 template<
typename T,
class A>
1291 internal_loop_guide loop(n, dst); loop.copy(src);
1294 #if __TBB_CPP11_RVALUE_REF_PRESENT 1295 template<
typename T,
class A>
1297 internal_loop_guide loop(n, dst); loop.move_construct(src);
1299 template<
typename T,
class A>
1301 internal_loop_guide loop(n, dst); loop.move_assign(src);
1305 #if __TBB_MOVE_IF_NOEXCEPT_PRESENT 1306 template<
typename T,
class A>
1308 internal_loop_guide loop(n, dst); loop.move_construct_if_noexcept(src);
1310 #endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT 1312 template<
typename T,
class A>
1313 template<
typename I>
1315 internal_loop_guide loop(n, dst);
1316 loop.iterate( *(static_cast<I*>(const_cast<void*>(p_type_erased_iterator))) );
1319 template<
typename T,
class A>
1321 internal_loop_guide loop(n, dst); loop.assign(src);
1324 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 1326 #pragma warning (push) 1327 #pragma warning (disable: 4189) 1329 template<
typename T,
class A>
1331 T* array = static_cast<T*>(
begin);
1335 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 1336 #pragma warning (pop) 1337 #endif // warning 4189 is back 1340 template<
typename T,
class A1,
class A2>
1344 if(a.size() != b.size())
return false;
1347 for(; i != a.end(); ++i, ++j)
1348 if( !(*i == *j) )
return false;
1352 template<
typename T,
class A1,
class A2>
1354 {
return !(a == b); }
1356 template<
typename T,
class A1,
class A2>
1358 {
return (std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end())); }
1360 template<
typename T,
class A1,
class A2>
1364 template<
typename T,
class A1,
class A2>
1366 {
return !(b < a); }
1368 template<
typename T,
class A1,
class A2>
1370 {
return !(a < b); }
1372 template<
typename T,
class A>
1378 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 1379 #pragma warning (pop) 1380 #endif // warning 4267,4127 are back iterator grow_by(size_type delta, const_reference t)
Grow by "delta" elements using copying constructor.
iterator grow_to_at_least(size_type n, const_reference t)
friend bool operator==(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
size_type __TBB_EXPORTED_METHOD internal_grow_by(size_type delta, size_type element_size, internal_array_op2 init, const void *src)
const_iterator cend() const
end const iterator
friend bool operator==(segment_value_t const &lhs, segment_allocated)
intptr_t __TBB_Log2(uintptr_t x)
friend bool operator<(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
const_reference operator[](size_type index) const
Get const reference to element at given index.
bool operator!=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
T & internal_subscript(size_type index) const
Get reference to element at given index.
A::template rebind< T >::other allocator_type
iterator end()
end iterator
void __TBB_EXPORTED_METHOD internal_reserve(size_type n, size_type element_size, size_type max_size)
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< false > *)
inline proxy assign by iterators
const_range_type range(size_t grainsize=1) const
Get const range for iterating with parallel algorithms.
iterator push_back(const_reference item)
Push item.
iterator begin()
start iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
vector_iterator()
Default constructor.
iterator grow_by(size_type delta)
Grow by "delta" elements.
size_type max_size() const
Upper bound on argument to reserve.
Specialization for atomic<void*>, for sake of not allowing arithmetic or operator->.
ptrdiff_t difference_type
iterator grow_by(std::initializer_list< T > init_list)
allocator_type get_allocator() const
return allocator object
#define __TBB_EXPORTED_FUNC
static void __TBB_EXPORTED_FUNC initialize_array(void *begin, const void *, size_type n)
Construct n instances of T, starting at "begin".
bool operator==(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
void store(void *allocated_segment_pointer) __TBB_NOEXCEPT(true)
void const char const char int ITT_FORMAT __itt_group_sync s
static size_type segment_size(segment_index_t k)
concurrent_vector(const allocator_type &a=allocator_type())
Construct empty vector.
concurrent_vector & operator=(const concurrent_vector &vector)
Assignment.
atomic< size_type > my_early_size
Requested size of vector.
void *(* vector_allocator_ptr)(concurrent_vector_base_v3 &, size_t)
allocator function pointer
void internal_free_segments(segment_t table[], segment_index_t k, segment_index_t first_block)
Free k segments from table.
concurrent_vector & operator=(concurrent_vector &&other)
Move assignment.
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...
const_reference back() const
the last item const
Dummy type that distinguishes splitting constructor from copy constructor.
const_iterator end() const
One past last value in range.
segment_index_t first_block
void store(value_type value)
Container * my_vector
concurrent_vector over which we are iterating.
void __TBB_EXPORTED_METHOD internal_swap(concurrent_vector_base_v3 &v)
auto last(Container &c) -> decltype(begin(c))
Exception-aware helper class for filling a segment by exception-danger operators of user class.
void resize(size_type n, const_reference t)
Resize the vector, copy t for new elements. Not thread-safe.
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.
void assign(const void *src)
Concurrent vector container.
void swap(concurrent_vector &vector)
swap two instances
internal::vector_iterator< concurrent_vector, const T > const_iterator
A range over which to iterate.
const_reverse_iterator crbegin() const
reverse start const iterator
concurrent_vector(const concurrent_vector &vector, const allocator_type &a=allocator_type())
Copying constructor.
void *__TBB_EXPORTED_METHOD internal_compact(size_type element_size, void *table, internal_array_op1 destroy, internal_array_op2 copy)
void *__TBB_EXPORTED_METHOD internal_push_back(size_type element_size, size_type &index)
const_iterator end() const
end const iterator
static segment_index_t segment_base(segment_index_t k)
#define __TBB_EXPORTED_METHOD
const T & const_reference
bool empty() const
Return false if vector is not empty or has elements under construction at least.
void internal_assign_n(size_type n, const_pointer p)
assign n items by copying t
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
auto first(Container &c) -> decltype(begin(c))
concurrent_vector_base_v3 concurrent_vector_base
segment_t table[pointers_per_long_table]
void const char const char int ITT_FORMAT __itt_group_sync p
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.
Class for determining type of std::allocator<T>::value_type.
static void * internal_allocator(internal::concurrent_vector_base_v3 &vb, size_t k)
Allocate k items.
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,...
friend void swap(segment_t &, segment_t &) __TBB_NOEXCEPT(true)
bool operator<=(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
void move_assign(const void *src)
const_iterator cbegin() const
start const iterator
Internal structure for compact()
segment_t & operator=(segment_t const &rhs)
void clear()
Clear container while keeping memory allocated.
size_type capacity() const
Maximum size to which array can grow without allocating more memory. Concurrent allocations are not i...
const internal::concurrent_vector_base_v3 & internal_vector_base() const
void __TBB_EXPORTED_METHOD internal_throw_exception(size_type) const
Obsolete.
void store(segment_allocation_failed)
bool operator<=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
internal_loop_guide(size_type ntrials, void *ptr)
vector_iterator operator-(ptrdiff_t offset) const
atomic< size_type > my_first_block
count of segments in the first block
iterator emplace_back(Args &&... args)
Push item, create item "in place" with provided arguments.
vector_iterator & operator-=(ptrdiff_t offset)
__TBB_EXPORTED_METHOD ~concurrent_vector_base_v3()
void move_construct(const void *src)
Value * operator->() const
Value & operator *() const
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".
reference front()
the first item
void reserve(size_type n)
Allocate enough space to grow to size n without having to allocate more memory later.
vector_iterator operator--(int)
Post decrement.
void internal_grow(size_type start, size_type finish, size_type element_size, internal_array_op2 init, const void *src)
Base class of concurrent vector implementation.
friend vector_iterator< C, T > operator+(ptrdiff_t offset, const vector_iterator< C, T > &v)
reverse_iterator rend()
reverse end iterator
pointer internal_push_back_result()
reference operator[](size_type index)
Get reference to element at given index.
void move(tbb_thread &t1, tbb_thread &t2)
~element_construction_guard()
segment_t(segment_t const &rhs)
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)
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".
iterator grow_by(I first, I last)
bool operator>(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
generic_range_type< iterator > range_type
~concurrent_vector()
Clear and destroy vector.
concurrent_vector(I first, I last, const allocator_type &a=allocator_type())
Construction with copying iteration range and given allocator instance.
generic_range_type(const generic_range_type< U > &r)
bool operator<(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
Meets requirements of a forward iterator for STL and a Value for a blocked_range.*/.
static segment_index_t segment_base_index_of(segment_index_t &index)
vector_iterator(const vector_iterator< Container, typename Container::value_type > &other)
const_reverse_iterator rend() const
reverse end const iterator
const T & const_reference
static const T * as_const_pointer(const void *ptr)
Value * my_item
Caches my_vector->internal_subscript(my_index)
void assign(size_type n, const_reference t)
assign n items by copying t item
segment_index_t __TBB_EXPORTED_METHOD internal_clear(internal_array_op1 destroy)
vector_iterator operator+(ptrdiff_t offset) const
void assign(I first, I last)
assign range [first, last)
vector_iterator(const Container &vector, size_t index, void *ptr=0)
bool operator>(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
size_type size() const
Return size of vector. It may include elements under construction.
void resize(size_type n)
Resize the vector. Not thread-safe.
static bool is_first_element_in_segment(size_type element_index)
void shrink_to_fit()
Optimize memory usage and fragmentation.
ptrdiff_t difference_type
void handle_unconstructed_elements(T *array, size_t n_of_elements)
Exception helper function.
static segment_index_t segment_index_of(size_type index)
static T * as_pointer(const void *src)
static void *const vector_allocation_error_flag
Bad allocation marker.
void __TBB_EXPORTED_METHOD internal_copy(const concurrent_vector_base_v3 &src, size_type element_size, internal_array_op2 copy)
reference back()
the last item
bool operator!=(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
friend bool operator==(segment_value_t const &lhs, segment_not_used)
vector_iterator & operator+=(ptrdiff_t offset)
Number of slots for segment pointers inside the class.
size_type __TBB_EXPORTED_METHOD internal_capacity() const
segment_value_t load() const
friend ptrdiff_t operator-(const vector_iterator< C, T > &i, const vector_iterator< C, U > &j)
friend bool operator==(segment_value_t const &lhs, segment_allocation_failed)
T & internal_subscript_with_exceptions(size_type index) const
Get reference to element at given index with errors checks.
void swap(concurrent_vector< T, A > &a, concurrent_vector< T, A > &b)
push_back_helper(concurrent_vector &vector)
bool operator>=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
bool operator==(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
const_reverse_iterator crend() const
reverse end const iterator
internal::concurrent_vector_base_v3::size_type size_type
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
ptrdiff_t operator-(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
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
segment_value_t(void *an_array)
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)
iterator grow_to_at_least(size_type n)
Append minimal sequence of elements such that size()>=n.
void internal_assign_iterators(I first, I last)
assign by iterators
concurrent_vector & operator=(const concurrent_vector< T, M > &vector)
Assignment for vector with different allocator type.
vector_iterator operator++(int)
Post increment.
concurrent_vector_base_v3()
allocator_type my_allocator
friend void enforce_segment_allocated(segment_value_t const &s, internal::exception_id exception=eid_bad_last_alloc)
const_reference at(size_type index) const
Get const reference to element at given index. Throws exceptions on errors.
element_construction_guard(pointer an_element)
std::reverse_iterator< iterator > reverse_iterator
friend bool operator!=(segment_value_t const &lhs, argument_type arg)
range_type range(size_t grainsize=1)
Get range for iterating with parallel algorithms.
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....
vector_iterator< Container, T > operator+(ptrdiff_t offset, const vector_iterator< Container, T > &v)
void swap(segment_t &rhs)
const_reverse_iterator rbegin() const
reverse start const iterator
void(__TBB_EXPORTED_FUNC * internal_array_op1)(void *begin, size_type n)
An operation on an n-element array starting at begin.
void swap(atomic< T > &lhs, atomic< T > &rhs)
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,...
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)
concurrent_vector(const concurrent_vector< T, M > &vector, const allocator_type &a=allocator_type())
Copying constructor for vector with different allocator type.
size_t my_index
Index into the vector.
concurrent_vector(concurrent_vector &&source)
Move constructor.
internal::vector_iterator< concurrent_vector, T > iterator
static void __TBB_EXPORTED_FUNC destroy_array(void *begin, size_type n)
Destroy n instances of T, starting at "begin".
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.
bool operator>=(const concurrent_vector< T, A1 > &a, const concurrent_vector< T, A2 > &b)
iterator push_back(T &&item)
Push item, move-aware.
const_iterator begin() const
start const iterator
void init(const void *src)
internal::allocator_base< T, A >::allocator_type allocator_type
concurrent_vector(size_type n)
Construction with initial size specified by argument n.
generic_range_type(generic_range_type &r, split)
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
void store(segment_not_used)
reverse_iterator rbegin()
reverse start iterator
concurrent_vector(concurrent_vector &&source, const allocator_type &a)
element_construction_guard g
atomic< segment_t * > my_segment
Pointer to the segments table.
friend class internal::vector_iterator
std::random_access_iterator_tag iterator_category
vector_iterator & operator--()
Pre decrement.
generic_range_type< const_iterator > const_range_type
#define __TBB_NOEXCEPT(expression)
const_reference front() const
the first item const
generic_range_type(I begin_, I end_, size_t grainsize_=1)
size_type grainsize() const
The grain size for this range.
allocator_base(const allocator_type &a=allocator_type())
const_iterator begin() const
Beginning of range.
segment_t my_storage[pointers_per_short_table]
embedded storage of segment pointers
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
iterator return_iterator_and_dismiss()
vector_iterator & operator++()
Pre increment.
void swap(concurrent_hash_map< Key, T, HashCompare, A > &a, concurrent_hash_map< Key, T, HashCompare, A > &b)
ptrdiff_t difference_type
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.
reference at(size_type index)
Get reference to element at given index. Throws exceptions on errors.
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...
void copy(const void *src)
Value & operator[](ptrdiff_t k) const