|
AGX Dynamics 2.41.1.2
|
Templated vector class. More...
#include <Vector.h>
Inheritance diagram for agx::Vector< T, Allocator >:Public Types | |
| typedef const T * | const_iterator |
| typedef const T * | const_pointer |
| typedef const T & | const_reference |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
| typedef ptrdiff_t | difference_type |
| typedef T * | iterator |
| typedef std::random_access_iterator_tag | iterator_category |
| typedef T * | pointer |
| typedef T & | reference |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| typedef size_t | size_type |
| typedef T | Type |
| typedef T | value_type |
Public Types inherited from agx::Container | |
| enum | ClearPolicy { SHRINK_BUFFER , SHRINK_BUFFER_AVERAGED , MAINTAIN_BUFFER } |
| agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory. More... | |
Public Member Functions | |
| Vector (const Allocator &allocator=Allocator()) | |
| Vector (const Vector< T, Allocator > &other) | |
| Vector (const_iterator first, const_iterator end, const Allocator &allocator=Allocator()) | |
| Vector (size_t size, const T &value=T(), const Allocator &allocator=Allocator()) | |
| Vector (std::initializer_list< T > values, const Allocator &allocator=Allocator()) | |
| Vector (Vector< T, Allocator > &&other) | |
| ~Vector () | |
| Allocator & | allocator () |
| const Allocator & | allocator () const |
| T & | at (size_t index) const |
| T & | back () const |
| iterator | begin () |
| const_iterator | begin () const |
| void | clear (ClearPolicy policy=SHRINK_BUFFER_AVERAGED) |
| Remove all elements, optionally with maintained buffer allocation. | |
| bool | contains (const T &element) const |
| template<typename T2 > | |
| bool | contains (const T2 &element) const |
| Test if the vector contains a certain element. | |
| iterator | end () |
| const_iterator | end () const |
| iterator | erase (iterator position) |
| STL erase functionality. | |
| iterator | erase (iterator start, iterator end) |
| void | erase (size_t index) |
| Erase elements using indices instead of iterators. | |
| void | erase (size_t start, size_t end) |
| iterator | eraseFast (const_iterator position) |
| Fast erase, replacing the erased element with the last element. | |
| void | eraseFast (size_t index) |
| template<typename T2 > | |
| size_t | find (const T2 &element) const |
| Find the index to a matching element, return size() if not found. | |
| template<typename T2 > | |
| bool | findAndErase (const T2 &element, bool searchMultiple=false) |
| Find and erase an element. | |
| T & | front () const |
| T * | increment (size_t numElements=1) |
| Resize using a increment. | |
| template<typename InputIterator > | |
| void | insert (const_iterator it, InputIterator first, InputIterator last) |
| void | insert (const_iterator it, std::initializer_list< T > ilist) |
| iterator | insert (iterator position, const T &value) |
| void | insert (size_t index, const T &value) |
| bool | operator!= (const Vector< T, Allocator > &other) const |
| Vector< T, Allocator > & | operator= (const Vector< T, Allocator > &other) |
| bool | operator== (const Vector< T, Allocator > &other) const |
| Compare with other vector, return true if same size and all pairs are equal. | |
| T & | operator[] (size_t i) const |
| void | pop_back () |
| T * | ptr () |
| Get access to the internal data buffer. | |
| const T * | ptr () const |
| void | push_back (const T &value) |
| template<typename T2 > | |
| void | push_back (const T2 &value) |
| void | push_back (T &&value) |
| reverse_iterator | rbegin () |
| const_reverse_iterator | rbegin () const |
| reverse_iterator | rend () |
| const_reverse_iterator | rend () const |
| void | reserve (size_t size) |
| Reserve capacity in the vector. | |
| void | reserveAtLeast (size_t size) |
| Reserve capacity in the vector. | |
| void | resize (size_t size) |
| Resize the vector, which then enables direct addressing using the bracket '[]' operator. | |
| void | resize (size_t size, const T &value) |
| void | shrink_to_fit () |
| Reduce the capacity of the vector to the actual size (number of elements) | |
| void | swap (Vector &other) |
Public Member Functions inherited from agx::Container | |
| size_t | capacity () const |
| Returns the size of the memory are used by the container to store its elements. | |
| bool | empty () const |
| void * | ptr () |
| const void * | ptr () const |
| size_t | size () const |
Additional Inherited Members | |
Protected Member Functions inherited from agx::Container | |
| Container () | |
| Container (const Container &other) | |
| Container (Container &&other) | |
| ~Container () | |
Protected Attributes inherited from agx::Container | |
| void * | m_buffer |
| size_t | m_capacity |
| size_t | m_size |
Templated vector class.
Definition at line 52 of file agx/Vector.h.
| typedef const T* agx::Vector< T, Allocator >::const_iterator |
Definition at line 63 of file agx/Vector.h.
| typedef const T* agx::Vector< T, Allocator >::const_pointer |
Definition at line 58 of file agx/Vector.h.
| typedef const T& agx::Vector< T, Allocator >::const_reference |
Definition at line 60 of file agx/Vector.h.
| typedef std::reverse_iterator<const_iterator> agx::Vector< T, Allocator >::const_reverse_iterator |
Definition at line 138 of file agx/Vector.h.
| typedef ptrdiff_t agx::Vector< T, Allocator >::difference_type |
Definition at line 65 of file agx/Vector.h.
| typedef T* agx::Vector< T, Allocator >::iterator |
Definition at line 62 of file agx/Vector.h.
| typedef std::random_access_iterator_tag agx::Vector< T, Allocator >::iterator_category |
Definition at line 64 of file agx/Vector.h.
| typedef T* agx::Vector< T, Allocator >::pointer |
Definition at line 57 of file agx/Vector.h.
| typedef T& agx::Vector< T, Allocator >::reference |
Definition at line 59 of file agx/Vector.h.
| typedef std::reverse_iterator<iterator> agx::Vector< T, Allocator >::reverse_iterator |
Definition at line 137 of file agx/Vector.h.
| typedef size_t agx::Vector< T, Allocator >::size_type |
Definition at line 61 of file agx/Vector.h.
| typedef T agx::Vector< T, Allocator >::Type |
Definition at line 55 of file agx/Vector.h.
| typedef T agx::Vector< T, Allocator >::value_type |
Definition at line 56 of file agx/Vector.h.
|
explicit |
|
explicit |
|
explicit |
| agx::Vector< T, Allocator >::Vector | ( | std::initializer_list< T > | values, |
| const Allocator & | allocator = Allocator() |
||
| ) |
| agx::Vector< T, Allocator >::Vector | ( | const Vector< T, Allocator > & | other | ) |
| agx::Vector< T, Allocator >::Vector | ( | Vector< T, Allocator > && | other | ) |
Definition at line 460 of file agx/Vector.h.
References agx::ByteAllocator::setContainer().
| agx::Vector< T, A >::~Vector |
Definition at line 669 of file agx/Vector.h.
References agx::ByteAllocator::deallocateBytes(), m_capacity, m_elements, and m_size.
| A & agx::Vector< T, A >::allocator |
Definition at line 1001 of file agx/Vector.h.
Referenced by agxCollide::Space::getBroadPhasePairs(), and agxCollide::Space::getSeparationPairs().
| const A & agx::Vector< T, A >::allocator |
Definition at line 1004 of file agx/Vector.h.
| T & agx::Vector< T, A >::at | ( | size_t | index | ) | const |
Definition at line 691 of file agx/Vector.h.
References agxVerifyN, m_elements, and m_size.
Referenced by agx::SetVector< DataT, HashT >::at().
| T & agx::Vector< T, A >::back |
Definition at line 707 of file agx/Vector.h.
References agxAssert1, m_elements, and m_size.
Referenced by agx::MemoryPool< T >::clear(), agxCollide::Space::disableForContacts(), and agxUtil::Spline::getTension().
| Vector< T, A >::iterator agx::Vector< T, A >::begin |
Definition at line 1041 of file agx/Vector.h.
References m_elements.
Referenced by agx::HashVector< KeyT, DataT, HashT >::begin(), agx::SetVector< DataT, HashT >::begin(), agxSDK::MergeSplitActionContainer::begin(), agxStream::RestoreObjects< T >::begin(), agx::begin(), agx::HashVector< KeyT, DataT, HashT >::purge(), and agx::SetVector< DataT, HashT >::purge().
| Vector< T, A >::const_iterator agx::Vector< T, A >::begin |
Definition at line 1047 of file agx/Vector.h.
References m_elements.
| void agx::Vector< T, A >::clear | ( | ClearPolicy | policy = SHRINK_BUFFER_AVERAGED | ) |
Remove all elements, optionally with maintained buffer allocation.
Definition at line 491 of file agx/Vector.h.
References AGX_VECTOR_SHRINK_THRESHOLD, AGX_VECTOR_SMOOTHING_FACTOR, agx::ByteAllocator::deallocateBytes(), m_capacity, and m_size.
Referenced by agxModel::SuctionCupSensorFilter::~SuctionCupSensorFilter(), agx::HashVector< KeyT, DataT, HashT >::clear(), agx::SetVector< DataT, HashT >::clear(), agx::HashVector< KeyT, DataT, HashT >::purge(), and agx::SetVector< DataT, HashT >::purge().
| bool agx::Vector< T, A >::contains | ( | const T & | element | ) | const |
Definition at line 849 of file agx/Vector.h.
References m_size.
| bool agx::Vector< T, A >::contains | ( | const T2 & | element | ) | const |
Test if the vector contains a certain element.
Definition at line 843 of file agx/Vector.h.
References m_size.
Referenced by agxSDK::MergeSplitUtils::collectConnectingEdges().
| Vector< T, A >::iterator agx::Vector< T, A >::end |
Definition at line 1044 of file agx/Vector.h.
References m_elements, and m_size.
Referenced by agx::HashVector< KeyT, DataT, HashT >::end(), agx::SetVector< DataT, HashT >::end(), agxSDK::MergeSplitActionContainer::end(), agxStream::RestoreObjects< T >::end(), agx::end(), agx::HashVector< KeyT, DataT, HashT >::purge(), and agx::SetVector< DataT, HashT >::purge().
| Vector< T, A >::const_iterator agx::Vector< T, A >::end |
Definition at line 1050 of file agx/Vector.h.
References m_elements, and m_size.
| Vector< T, A >::iterator agx::Vector< T, A >::erase | ( | iterator | position | ) |
| Vector< T, A >::iterator agx::Vector< T, A >::erase | ( | iterator | start, |
| iterator | end | ||
| ) |
Definition at line 773 of file agx/Vector.h.
References agx::begin(), and agx::end().
| void agx::Vector< T, A >::erase | ( | size_t | index | ) |
Erase elements using indices instead of iterators.
Definition at line 784 of file agx/Vector.h.
References agxAssert, m_elements, and m_size.
| void agx::Vector< T, A >::erase | ( | size_t | start, |
| size_t | end | ||
| ) |
Definition at line 806 of file agx/Vector.h.
References agxAssert1, agx::end(), m_elements, and m_size.
| Vector< T, A >::iterator agx::Vector< T, A >::eraseFast | ( | const_iterator | position | ) |
Fast erase, replacing the erased element with the last element.
Definition at line 825 of file agx/Vector.h.
References agx::begin().
| void agx::Vector< T, A >::eraseFast | ( | size_t | index | ) |
Definition at line 833 of file agx/Vector.h.
References agxAssertN, m_elements, and m_size.
| size_t agx::Vector< T, A >::find | ( | const T2 & | element | ) | const |
Find the index to a matching element, return size() if not found.
Definition at line 856 of file agx/Vector.h.
References m_elements, and m_size.
| bool agx::Vector< T, A >::findAndErase | ( | const T2 & | element, |
| bool | searchMultiple = false |
||
| ) |
Find and erase an element.
| element | - Element to search for |
| searchMultiple | Set to true if search should continue after element is found, otherwise the search terminates on first match. |
Definition at line 868 of file agx/Vector.h.
References m_elements, and m_size.
| T & agx::Vector< T, A >::front |
Definition at line 699 of file agx/Vector.h.
References agxAssert1, m_elements, and m_size.
| T * agx::Vector< T, A >::increment | ( | size_t | numElements = 1 | ) |
Resize using a increment.
Definition at line 605 of file agx/Vector.h.
References AGX_VECTOR_RESIZE_FACTOR, m_capacity, m_elements, and m_size.
| void agx::Vector< T, A >::insert | ( | const_iterator | it, |
| InputIterator | first, | ||
| InputIterator | last | ||
| ) |
Definition at line 899 of file agx/Vector.h.
References AGX_VECTOR_RESIZE_FACTOR, agx::begin(), m_capacity, m_elements, and m_size.
| void agx::Vector< T, A >::insert | ( | const_iterator | it, |
| std::initializer_list< T > | ilist | ||
| ) |
Definition at line 924 of file agx/Vector.h.
| Vector< T, A >::iterator agx::Vector< T, A >::insert | ( | iterator | position, |
| const T & | value | ||
| ) |
Definition at line 891 of file agx/Vector.h.
References agx::begin().
| void agx::Vector< T, A >::insert | ( | size_t | index, |
| const T & | value | ||
| ) |
Definition at line 930 of file agx/Vector.h.
References AGX_VECTOR_MIN_SIZE, AGX_VECTOR_RESIZE_FACTOR, agxAssertN, m_capacity, m_elements, and m_size.
| bool agx::Vector< T, A >::operator!= | ( | const Vector< T, Allocator > & | other | ) | const |
Definition at line 632 of file agx/Vector.h.
References m_elements, m_size, and agx::Container::size().
| Vector< T, A > & agx::Vector< T, A >::operator= | ( | const Vector< T, Allocator > & | other | ) |
Definition at line 646 of file agx/Vector.h.
References agx::Container::capacity(), m_elements, m_size, agx::ByteAllocator::setContainer(), and agx::Container::size().
| bool agx::Vector< T, A >::operator== | ( | const Vector< T, Allocator > & | other | ) | const |
Compare with other vector, return true if same size and all pairs are equal.
Definition at line 619 of file agx/Vector.h.
References m_elements, m_size, and agx::Container::size().
| T & agx::Vector< T, A >::operator[] | ( | size_t | i | ) | const |
Definition at line 684 of file agx/Vector.h.
References agxAssertN, m_elements, and m_size.
| void agx::Vector< T, A >::pop_back |
Definition at line 754 of file agx/Vector.h.
References agxAssert, m_elements, and m_size.
Referenced by agxCollide::Space::disableForContacts().
| T * agx::Vector< T, A >::ptr |
Get access to the internal data buffer.
Definition at line 677 of file agx/Vector.h.
References m_elements.
Referenced by agxData::Array< T >::Array().
| const T * agx::Vector< T, A >::ptr |
Definition at line 680 of file agx/Vector.h.
References m_elements.
| void agx::Vector< T, A >::push_back | ( | const T & | value | ) |
Definition at line 727 of file agx/Vector.h.
References AGX_VECTOR_MIN_SIZE, AGX_VECTOR_RESIZE_FACTOR, m_capacity, m_elements, and m_size.
| void agx::Vector< T, A >::push_back | ( | const T2 & | value | ) |
Definition at line 715 of file agx/Vector.h.
References AGX_VECTOR_MIN_SIZE, AGX_VECTOR_RESIZE_FACTOR, m_capacity, m_elements, and m_size.
Referenced by agxModel::TireFilter::addBody(), agxSDK::RigidBodyLogListener::addBody(), agxSDK::ConstraintLogListener::addConstraint(), agxModel::SuctionCupSensorFilter::addGeometry(), agx::WireContactConstraint::addWireParticle(), agx::MemoryPool< T >::clear(), agxSDK::MergeSplitUtils::collectConnectingEdges(), agxSDK::copyVectors(), agx::createMissingTiers(), agxCollide::Space::disableForContacts(), agxWire::Link::getConnectingNodes(), agx::HashVector< KeyT, DataT, HashT >::purge(), agx::SetVector< DataT, HashT >::purge(), agx::HashVector< KeyT, DataT, HashT >::push_back(), agxStream::StoreObjects< T >::push_back(), and agx::SetVector< DataT, HashT >::push_back().
| void agx::Vector< T, A >::push_back | ( | T && | value | ) |
Definition at line 741 of file agx/Vector.h.
References AGX_VECTOR_MIN_SIZE, AGX_VECTOR_RESIZE_FACTOR, m_capacity, m_elements, and m_size.
| Vector< T, A >::reverse_iterator agx::Vector< T, A >::rbegin |
Definition at line 1053 of file agx/Vector.h.
References agx::end().
Referenced by agx::SetVector< DataT, HashT >::rbegin().
| Vector< T, A >::const_reverse_iterator agx::Vector< T, A >::rbegin |
Definition at line 1059 of file agx/Vector.h.
References agx::end().
| Vector< T, A >::reverse_iterator agx::Vector< T, A >::rend |
Definition at line 1056 of file agx/Vector.h.
References agx::begin().
Referenced by agx::SetVector< DataT, HashT >::rend().
| Vector< T, A >::const_reverse_iterator agx::Vector< T, A >::rend |
Definition at line 1062 of file agx/Vector.h.
References agx::begin().
| void agx::Vector< T, A >::reserve | ( | size_t | size | ) |
Reserve capacity in the vector.
Definition at line 583 of file agx/Vector.h.
References m_capacity.
Referenced by agxCollide::Space::disableForContacts(), agxWire::Link::getConnectingNodes(), agx::HashVector< KeyT, DataT, HashT >::purge(), agx::SetVector< DataT, HashT >::purge(), agx::HashVector< KeyT, DataT, HashT >::reserve(), and agx::SetVector< DataT, HashT >::reserve().
| void agx::Vector< T, A >::reserveAtLeast | ( | size_t | size | ) |
Reserve capacity in the vector.
Let vector grow in same way as push_back() does.
Definition at line 592 of file agx/Vector.h.
References AGX_VECTOR_MIN_SIZE, AGX_VECTOR_RESIZE_FACTOR, and m_capacity.
| void agx::Vector< T, A >::resize | ( | size_t | size | ) |
Resize the vector, which then enables direct addressing using the bracket '[]' operator.
Definition at line 540 of file agx/Vector.h.
References AGX_VECTOR_SHRINK_THRESHOLD, m_capacity, and m_size.
Referenced by agxStream::RestoreObjects< T >::RestoreObjects().
| void agx::Vector< T, A >::resize | ( | size_t | size, |
| const T & | value | ||
| ) |
Definition at line 562 of file agx/Vector.h.
References AGX_VECTOR_SHRINK_THRESHOLD, m_capacity, and m_size.
| void agx::Vector< T, A >::shrink_to_fit |
Reduce the capacity of the vector to the actual size (number of elements)
Definition at line 531 of file agx/Vector.h.
References m_capacity, and m_size.
| void agx::Vector< T, A >::swap | ( | Vector< T, Allocator > & | other | ) |
Definition at line 1651 of file agx/Vector.h.
References agx::Container::m_buffer, agx::Container::m_capacity, m_capacity, agx::Container::m_size, and std::swap().
Referenced by agx::swap().