#include <concurrent_vector.h>

Classes | |
| class | generic_range_type |
| class | internal_loop_guide |
| Exception-aware helper class for filling a segment by exception-danger operators of user class. | |
Public Types | |
| typedef internal::allocator_base< T, A > ::allocator_type | allocator_type |
| typedef internal::vector_iterator < concurrent_vector, const T > | const_iterator |
| typedef const T * | const_pointer |
| typedef generic_range_type < const_iterator > | const_range_type |
| typedef const T & | const_reference |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
| typedef ptrdiff_t | difference_type |
| typedef internal::vector_iterator < concurrent_vector, T > | iterator |
| typedef T * | pointer |
| typedef generic_range_type < iterator > | range_type |
| typedef T & | reference |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
| typedef internal::concurrent_vector_base_v3::size_type | size_type |
| typedef T | value_type |
Public Member Functions | |
| void | assign (size_type n, const_reference t) |
| assign n items by copying t item | |
| template<class I > | |
| void | assign (I first, I last) |
| assign range [first, last) | |
| reference | at (size_type index) |
| Get reference to element at given index. Throws exceptions on errors. | |
| const_reference | at (size_type index) const |
| Get const reference to element at given index. Throws exceptions on errors. | |
| const_reference | back () const |
| the last item const | |
| reference | back () |
| the last item | |
| iterator | begin () |
| start iterator | |
| const_iterator | begin () const |
| start const iterator | |
| size_type | capacity () const |
| Maximum size to which array can grow without allocating more memory. Concurrent allocations are not included in the value. | |
| const_iterator | cbegin () const |
| start const iterator | |
| const_iterator | cend () const |
| end const iterator | |
| void | clear () |
| Clear container while keeping memory allocated. | |
| concurrent_vector (const concurrent_vector &vector, const allocator_type &a=allocator_type()) | |
| Copying constructor. | |
| concurrent_vector (size_type n) | |
| Construction with initial size specified by argument n. | |
| 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, and given allocator instance. | |
| concurrent_vector (const allocator_type &a=allocator_type()) | |
| Construct empty vector. | |
| template<class I > | |
| concurrent_vector (I first, I last, const allocator_type &a=allocator_type()) | |
| Construction with copying iteration range and given allocator instance. | |
| template<class M > | |
| concurrent_vector (const concurrent_vector< T, M > &vector, const allocator_type &a=allocator_type()) | |
| Copying constructor for vector with different allocator type. | |
| const_reverse_iterator | crbegin () const |
| reverse start const iterator | |
| const_reverse_iterator | crend () const |
| reverse end const iterator | |
| bool | empty () const |
| Return true if vector is not empty or has elements under construction at least. | |
| iterator | end () |
| end iterator | |
| const_iterator | end () const |
| end const iterator | |
| reference | front () |
| the first item | |
| const_reference | front () const |
| the first item const | |
| allocator_type | get_allocator () const |
| return allocator object | |
| iterator | grow_by (size_type delta) |
| Grow by "delta" elements. | |
| iterator | grow_by (size_type delta, const_reference t) |
| Grow by "delta" elements using copying constuctor. | |
| iterator | grow_to_at_least (size_type n) |
| Append minimal sequence of elements such that size()>=n. | |
| const internal::concurrent_vector_base_v3 & | internal_vector_base () const |
| size_type | max_size () const |
| Upper bound on argument to reserve. | |
| template<class M > | |
| concurrent_vector & | operator= (const concurrent_vector< T, M > &vector) |
| Assignment for vector with different allocator type. | |
| concurrent_vector & | operator= (const concurrent_vector &vector) |
| Assignment. | |
| reference | operator[] (size_type index) |
| Get reference to element at given index. | |
| const_reference | operator[] (size_type index) const |
| Get const reference to element at given index. | |
| iterator | push_back (const_reference item) |
| Push item. | |
| range_type | range (size_t grainsize=1) |
| Get range for iterating with parallel algorithms. | |
| const_range_type | range (size_t grainsize=1) const |
| Get const range for iterating with parallel algorithms. | |
| reverse_iterator | rbegin () |
| reverse start iterator | |
| const_reverse_iterator | rbegin () const |
| reverse start const iterator | |
| reverse_iterator | rend () |
| reverse end iterator | |
| const_reverse_iterator | rend () const |
| reverse end const iterator | |
| void | reserve (size_type n) |
| Allocate enough space to grow to size n without having to allocate more memory later. | |
| void | resize (size_type n) |
| Resize the vector. Not thread-safe. | |
| void | resize (size_type n, const_reference t) |
| Resize the vector, copy t for new elements. Not thread-safe. | |
| void | shrink_to_fit () |
| Optimize memory usage and fragmentation. | |
| size_type | size () const |
| Return size of vector. It may include elements under construction. | |
| void | swap (concurrent_vector &vector) |
| swap two instances | |
| ~concurrent_vector () | |
| Clear and destroy vector. | |
Friends | |
| class | internal::vector_iterator |
Concurrent vector container concurrent_vector is a container having the following main properties:
Definition at line 450 of file concurrent_vector.h.
| typedef internal::allocator_base<T, A>::allocator_type tbb::concurrent_vector< T, A >::allocator_type |
Definition at line 474 of file concurrent_vector.h.
| typedef internal::vector_iterator<concurrent_vector,const T> tbb::concurrent_vector< T, A >::const_iterator |
Definition at line 484 of file concurrent_vector.h.
| typedef const T* tbb::concurrent_vector< T, A >::const_pointer |
Definition at line 481 of file concurrent_vector.h.
| typedef generic_range_type<const_iterator> tbb::concurrent_vector< T, A >::const_range_type |
Definition at line 500 of file concurrent_vector.h.
| typedef const T& tbb::concurrent_vector< T, A >::const_reference |
Definition at line 479 of file concurrent_vector.h.
| typedef std::reverse_iterator<const_iterator> tbb::concurrent_vector< T, A >::const_reverse_iterator |
Definition at line 489 of file concurrent_vector.h.
| typedef ptrdiff_t tbb::concurrent_vector< T, A >::difference_type |
Definition at line 477 of file concurrent_vector.h.
| typedef internal::vector_iterator<concurrent_vector,T> tbb::concurrent_vector< T, A >::iterator |
Definition at line 483 of file concurrent_vector.h.
| typedef T* tbb::concurrent_vector< T, A >::pointer |
Definition at line 480 of file concurrent_vector.h.
| typedef generic_range_type<iterator> tbb::concurrent_vector< T, A >::range_type |
Definition at line 499 of file concurrent_vector.h.
| typedef T& tbb::concurrent_vector< T, A >::reference |
Definition at line 478 of file concurrent_vector.h.
| typedef std::reverse_iterator<iterator> tbb::concurrent_vector< T, A >::reverse_iterator |
Definition at line 488 of file concurrent_vector.h.
| typedef internal::concurrent_vector_base_v3::size_type tbb::concurrent_vector< T, A >::size_type |
Definition at line 473 of file concurrent_vector.h.
| typedef T tbb::concurrent_vector< T, A >::value_type |
Definition at line 476 of file concurrent_vector.h.
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | const allocator_type & | a = allocator_type() |
) | [inline, explicit] |
Definition at line 507 of file concurrent_vector.h.
: internal::allocator_base<T, A>(a), internal::concurrent_vector_base()
{
vector_allocator_ptr = &internal_allocator;
}
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | const concurrent_vector< T, A > & | vector, | |
| const allocator_type & | a = allocator_type() | |||
| ) | [inline] |
Definition at line 514 of file concurrent_vector.h.
: internal::allocator_base<T, A>(a), internal::concurrent_vector_base()
{
vector_allocator_ptr = &internal_allocator;
__TBB_TRY {
internal_copy(vector, sizeof(T), ©_array);
} __TBB_CATCH(...) {
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
__TBB_RETHROW();
}
}
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | const concurrent_vector< T, M > & | vector, | |
| const allocator_type & | a = allocator_type() | |||
| ) | [inline] |
Definition at line 529 of file concurrent_vector.h.
: internal::allocator_base<T, A>(a), internal::concurrent_vector_base()
{
vector_allocator_ptr = &internal_allocator;
__TBB_TRY {
internal_copy(vector.internal_vector_base(), sizeof(T), ©_array);
} __TBB_CATCH(...) {
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
__TBB_RETHROW();
}
}
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | size_type | n | ) | [inline, explicit] |
Definition at line 543 of file concurrent_vector.h.
{
vector_allocator_ptr = &internal_allocator;
__TBB_TRY {
internal_resize( n, sizeof(T), max_size(), NULL, &destroy_array, &initialize_array );
} __TBB_CATCH(...) {
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
__TBB_RETHROW();
}
}
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | size_type | n, | |
| const_reference | t, | |||
| const allocator_type & | a = allocator_type() | |||
| ) | [inline] |
Definition at line 556 of file concurrent_vector.h.
: internal::allocator_base<T, A>(a)
{
vector_allocator_ptr = &internal_allocator;
__TBB_TRY {
internal_resize( n, sizeof(T), max_size(), static_cast<const void*>(&t), &destroy_array, &initialize_array_by );
} __TBB_CATCH(...) {
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
__TBB_RETHROW();
}
}
| tbb::concurrent_vector< T, A >::concurrent_vector | ( | I | first, | |
| I | last, | |||
| const allocator_type & | a = allocator_type() | |||
| ) | [inline] |
Definition at line 571 of file concurrent_vector.h.
: internal::allocator_base<T, A>(a)
{
vector_allocator_ptr = &internal_allocator;
__TBB_TRY {
internal_assign_range(first, last, static_cast<is_integer_tag<std::numeric_limits<I>::is_integer> *>(0) );
} __TBB_CATCH(...) {
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
__TBB_RETHROW();
}
}
| tbb::concurrent_vector< T, A >::~concurrent_vector | ( | ) | [inline] |
Definition at line 823 of file concurrent_vector.h.
{
segment_t *table = my_segment;
internal_free_segments( reinterpret_cast<void**>(table), internal_clear(&destroy_array), my_first_block );
// base class destructor call should be then
}
| void tbb::concurrent_vector< T, A >::assign | ( | size_type | n, | |
| const_reference | t | |||
| ) | [inline] |
Definition at line 797 of file concurrent_vector.h.
| void tbb::concurrent_vector< T, A >::assign | ( | I | first, | |
| I | last | |||
| ) | [inline] |
Definition at line 804 of file concurrent_vector.h.
{
clear(); internal_assign_range( first, last, static_cast<is_integer_tag<std::numeric_limits<I>::is_integer> *>(0) );
}
| reference tbb::concurrent_vector< T, A >::at | ( | size_type | index | ) | [inline] |
Definition at line 683 of file concurrent_vector.h.
{
return internal_subscript_with_exceptions(index);
}
| const_reference tbb::concurrent_vector< T, A >::at | ( | size_type | index | ) | const [inline] |
Definition at line 688 of file concurrent_vector.h.
{
return internal_subscript_with_exceptions(index);
}
| reference tbb::concurrent_vector< T, A >::back | ( | ) | [inline] |
Definition at line 784 of file concurrent_vector.h.
| const_reference tbb::concurrent_vector< T, A >::back | ( | ) | const [inline] |
Definition at line 789 of file concurrent_vector.h.
| iterator tbb::concurrent_vector< T, A >::begin | ( | ) | [inline] |
Definition at line 750 of file concurrent_vector.h.
Referenced by appendVector(), divide_and_conquer(), and tbb::operator==().
{return iterator(*this,0);}
| const_iterator tbb::concurrent_vector< T, A >::begin | ( | ) | const [inline] |
Definition at line 754 of file concurrent_vector.h.
{return const_iterator(*this,0);}
| size_type tbb::concurrent_vector< T, A >::capacity | ( | ) | const [inline] |
Definition at line 714 of file concurrent_vector.h.
{return internal_capacity();}
| const_iterator tbb::concurrent_vector< T, A >::cbegin | ( | ) | const [inline] |
Definition at line 758 of file concurrent_vector.h.
{return const_iterator(*this,0);}
| const_iterator tbb::concurrent_vector< T, A >::cend | ( | ) | const [inline] |
Definition at line 760 of file concurrent_vector.h.
{return const_iterator(*this,size());}
| void tbb::concurrent_vector< T, A >::clear | ( | ) | [inline] |
To free up the memory, use in conjunction with method compact(). Not thread safe
Definition at line 818 of file concurrent_vector.h.
Referenced by initialize(), and quickhull().
{
internal_clear(&destroy_array);
}
| const_reverse_iterator tbb::concurrent_vector< T, A >::crbegin | ( | ) | const [inline] |
Definition at line 770 of file concurrent_vector.h.
{return const_reverse_iterator(end());}
| const_reverse_iterator tbb::concurrent_vector< T, A >::crend | ( | ) | const [inline] |
Definition at line 772 of file concurrent_vector.h.
{return const_reverse_iterator(begin());}
| bool tbb::concurrent_vector< T, A >::empty | ( | ) | const [inline] |
Definition at line 711 of file concurrent_vector.h.
{return !my_early_size;}
| iterator tbb::concurrent_vector< T, A >::end | ( | ) | [inline] |
Definition at line 752 of file concurrent_vector.h.
Referenced by appendVector(), divide_and_conquer(), tbb::operator==(), and quickhull().
| const_iterator tbb::concurrent_vector< T, A >::end | ( | ) | const [inline] |
Definition at line 756 of file concurrent_vector.h.
{return const_iterator(*this,size());}
| reference tbb::concurrent_vector< T, A >::front | ( | ) | [inline] |
Definition at line 774 of file concurrent_vector.h.
| const_reference tbb::concurrent_vector< T, A >::front | ( | ) | const [inline] |
Definition at line 779 of file concurrent_vector.h.
| allocator_type tbb::concurrent_vector< T, A >::get_allocator | ( | ) | const [inline] |
Definition at line 794 of file concurrent_vector.h.
{ return this->my_allocator; }
| iterator tbb::concurrent_vector< T, A >::grow_by | ( | size_type | delta, | |
| const_reference | t | |||
| ) | [inline] |
Returns iterator pointing to the first new element.
Definition at line 624 of file concurrent_vector.h.
| iterator tbb::concurrent_vector< T, A >::grow_by | ( | size_type | delta | ) | [inline] |
Returns iterator pointing to the first new element.
Definition at line 611 of file concurrent_vector.h.
Referenced by appendVector(), and SerialVectorFib().
| iterator tbb::concurrent_vector< T, A >::grow_to_at_least | ( | size_type | n | ) | [inline] |
The new elements are default constructed. Blocks until all elements in range [0..n) are allocated. May return while other elements are being constructed by other threads. Returns iterator that points to beginning of appended sequence. If no elements were appended, returns iterator pointing to nth element.
Definition at line 641 of file concurrent_vector.h.
Referenced by SerialVectorFib().
| const internal::concurrent_vector_base_v3& tbb::concurrent_vector< T, A >::internal_vector_base | ( | ) | const [inline] |
Definition at line 829 of file concurrent_vector.h.
Referenced by tbb::concurrent_vector< padded_element, padded_allocator_type >::concurrent_vector(), and tbb::concurrent_vector< padded_element, padded_allocator_type >::operator=().
{ return *this; }
| size_type tbb::concurrent_vector< T, A >::max_size | ( | ) | const [inline] |
Definition at line 743 of file concurrent_vector.h.
| concurrent_vector& tbb::concurrent_vector< T, A >::operator= | ( | const concurrent_vector< T, M > & | vector | ) | [inline] |
Definition at line 593 of file concurrent_vector.h.
| concurrent_vector& tbb::concurrent_vector< T, A >::operator= | ( | const concurrent_vector< T, A > & | vector | ) | [inline] |
Definition at line 585 of file concurrent_vector.h.
| reference tbb::concurrent_vector< T, A >::operator[] | ( | size_type | index | ) | [inline] |
This method is thread-safe for concurrent reads, and also while growing the vector, as long as the calling thread has checked that index<size().
Definition at line 673 of file concurrent_vector.h.
{
return internal_subscript(index);
}
| const_reference tbb::concurrent_vector< T, A >::operator[] | ( | size_type | index | ) | const [inline] |
Definition at line 678 of file concurrent_vector.h.
{
return internal_subscript(index);
}
| iterator tbb::concurrent_vector< T, A >::push_back | ( | const_reference | item | ) | [inline] |
Returns iterator pointing to the new element.
Definition at line 656 of file concurrent_vector.h.
Referenced by divide_and_conquer(), SplitByCP::operator()(), and FillRNDPointsVector::operator()().
| range_type tbb::concurrent_vector< T, A >::range | ( | size_t | grainsize = 1 |
) | [inline] |
Definition at line 693 of file concurrent_vector.h.
{
return range_type( begin(), end(), grainsize );
}
| const_range_type tbb::concurrent_vector< T, A >::range | ( | size_t | grainsize = 1 |
) | const [inline] |
Definition at line 698 of file concurrent_vector.h.
{
return const_range_type( begin(), end(), grainsize );
}
| reverse_iterator tbb::concurrent_vector< T, A >::rbegin | ( | ) | [inline] |
Definition at line 762 of file concurrent_vector.h.
{return reverse_iterator(end());}
| const_reverse_iterator tbb::concurrent_vector< T, A >::rbegin | ( | ) | const [inline] |
Definition at line 766 of file concurrent_vector.h.
{return const_reverse_iterator(end());}
| reverse_iterator tbb::concurrent_vector< T, A >::rend | ( | ) | [inline] |
Definition at line 764 of file concurrent_vector.h.
{return reverse_iterator(begin());}
| const_reverse_iterator tbb::concurrent_vector< T, A >::rend | ( | ) | const [inline] |
Definition at line 768 of file concurrent_vector.h.
{return const_reverse_iterator(begin());}
| void tbb::concurrent_vector< T, A >::reserve | ( | size_type | n | ) | [inline] |
Like most of the methods provided for STL compatibility, this method is *not* thread safe. The capacity afterwards may be bigger than the requested reservation.
Definition at line 719 of file concurrent_vector.h.
| void tbb::concurrent_vector< T, A >::resize | ( | size_type | n, | |
| const_reference | t | |||
| ) | [inline] |
Definition at line 730 of file concurrent_vector.h.
| void tbb::concurrent_vector< T, A >::resize | ( | size_type | n | ) | [inline] |
Definition at line 725 of file concurrent_vector.h.
| void tbb::concurrent_vector< T, A >::shrink_to_fit | ( | ) |
Definition at line 902 of file concurrent_vector.h.
References T.
{
internal_segments_table old;
__TBB_TRY {
if( internal_compact( sizeof(T), &old, &destroy_array, ©_array ) )
internal_free_segments( old.table, pointers_per_long_table, old.first_block ); // free joined and unnecessary segments
} __TBB_CATCH(...) {
if( old.first_block ) // free segment allocated for compacting. Only for support of exceptions in ctor of user T[ype]
internal_free_segments( old.table, 1, old.first_block );
__TBB_RETHROW();
}
}
| size_type tbb::concurrent_vector< T, A >::size | ( | ) | const [inline] |
Definition at line 705 of file concurrent_vector.h.
Referenced by appendVector(), divide(), divide_and_conquer(), extremum(), and tbb::operator==().
{
size_type sz = my_early_size, cp = internal_capacity();
return cp < sz ? cp : sz;
}
| void tbb::concurrent_vector< T, A >::swap | ( | concurrent_vector< T, A > & | vector | ) | [inline] |
Definition at line 809 of file concurrent_vector.h.
Referenced by tbb::swap().
friend class internal::vector_iterator [friend] |
Definition at line 468 of file concurrent_vector.h.
Copyright © 2005-2010 Intel Corporation. All Rights Reserved.
Licensed under the GNU General Public License 2 with the runtime exception.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.