![]() |
AGX Dynamics 2.40.0.0
|
Local scope vector. More...
#include <LocalVector.h>
Public Member Functions | |
LocalVector () | |
LocalVector (const LocalVector< T > &other) | |
LocalVector (LocalVector< T > &&other) | |
LocalVector (size_t size, const T &value=T()) | |
![]() | |
VectorPOD (const agx::ThreadLocalAllocator &allocator=agx::ThreadLocalAllocator()) | |
VectorPOD (const VectorPOD< T, agx::ThreadLocalAllocator > &other) | |
VectorPOD (const_iterator first, const_iterator end, const agx::ThreadLocalAllocator &allocator=agx::ThreadLocalAllocator()) | |
VectorPOD (size_t size, const T &value=T(), const agx::ThreadLocalAllocator &allocator=agx::ThreadLocalAllocator()) | |
VectorPOD (std::initializer_list< T > values, const agx::ThreadLocalAllocator &allocator=agx::ThreadLocalAllocator()) | |
VectorPOD (VectorPOD< T, agx::ThreadLocalAllocator > &&other) | |
~VectorPOD () | |
agx::ThreadLocalAllocator & | allocator () |
const agx::ThreadLocalAllocator & | 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 |
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) |
size_t | find (const T2 &element) const |
Find the index to a matching element, return size() if not found. | |
bool | findAndErase (const T &element, bool searchMultiple=false) |
Find and erase an element. | |
T & | front () const |
T * | increment (size_t numElements=1) |
Resize using a increment. | |
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 VectorPOD< T, agx::ThreadLocalAllocator > &other) const |
VectorPOD< T, agx::ThreadLocalAllocator > & | operator= (const VectorPOD< T, agx::ThreadLocalAllocator > &other) |
bool | operator== (const VectorPOD< T, agx::ThreadLocalAllocator > &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) |
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 (VectorPOD &other) |
![]() | |
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 | |
![]() | |
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 T * | pointer |
typedef T & | reference |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef size_t | size_type |
typedef T | Type |
typedef T | value_type |
![]() | |
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... | |
![]() | |
Container () | |
Container (const Container &other) | |
Container (Container &&other) | |
~Container () | |
![]() | |
void * | m_buffer |
size_t | m_capacity |
size_t | m_size |
Local scope vector.
Fast allocation/deallocation using a thread local memory buffer.
Should only be used for local, short-lived, frequently created containers.
Beware that a LocalVector's allocation is unstable. All LocalVectors owned by the same thread get their memory allocations from the same memory pool. If the memory pool is exhausted then it is reallocated and ALL LocalVectors owned by that thread get a new buffer. In C++-speak, an operation that invalidates iterators/pointers into one LocalVectors invalidates pointers/iterators to ALL LocalVectors owned by the same thread. Avoid calling functions that may create LocalVectors when holding pointers/interators into LocalVectors, including using range for loops.
Definition at line 43 of file LocalVector.h.
agxData::LocalVector< T >::LocalVector |
Definition at line 57 of file LocalVector.h.
agxData::LocalVector< T >::LocalVector | ( | size_t | size, |
const T & | value = T() |
||
) |
Definition at line 63 of file LocalVector.h.
agxData::LocalVector< T >::LocalVector | ( | const LocalVector< T > & | other | ) |
Definition at line 69 of file LocalVector.h.
|
inline |
Definition at line 75 of file LocalVector.h.