AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxData::Vector< T > Class Template Reference

#include <Vector.h>

+ Inheritance diagram for agxData::Vector< T >:

Public Types

typedef const T * const_iterator
 
typedef const T * const_pointer
 
typedef const T & const_reference
 
typedef ptrdiff_t difference_type
 
typedef T * iterator
 
typedef std::random_access_iterator_tag iterator_category
 
typedef T * pointer
 
typedef T & reference
 
typedef size_t size_type
 
typedef T Type
 
typedef T value_type
 
- Public Types inherited from agxData::Array< T >
typedef const T * const_iterator
 
typedef const T * const_pointer
 
typedef const T & const_reference
 
typedef ptrdiff_t difference_type
 
typedef T * iterator
 
typedef std::random_access_iterator_tag iterator_category
 
typedef T * pointer
 
typedef T & reference
 
typedef size_t size_type
 
typedef T Type
 
typedef T value_type
 

Public Member Functions

 Vector ()
 
 Vector (agxData::Buffer *buffer)
 
 ~Vector ()
 
void clear ()
 Remove all elements, optionally with maintained buffer allocation.
 
void commit ()
 Commit all changes.
 
void decrement (size_t numElements=1)
 
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 >
bool findAndErase (const T2 &element, bool searchMultiple=false)
 Find and erase an element.
 
T * increment (size_t numElements=1, const T &value=T())
 Resize using a increment.
 
template<typename InputIterator >
void insert (iterator it, InputIterator first, InputIterator last)
 
iterator insert (iterator position, const T &value)
 
void insert (size_t index, const T &value)
 
void pop_back ()
 Remove the back element.
 
template<typename T2 >
void push_back (const T2 &value)
 Append a new data element to the vector.
 
void reserve (size_t size)
 Reserve capacity in the vector.
 
void resize (size_t size, const T &value=T())
 Resize the vector, which then enables direct addressing using the bracket '[]' operator.
 
- Public Member Functions inherited from agxData::Array< T >
 Array ()
 Create a new invalid array.
 
 Array (agx::Vector< T > &vec)
 Create a new array view from a vector.
 
 Array (agx::Vector< T > &vec, agx::IndexRange32 range)
 
 Array (agx::VectorPOD< T > &vec)
 
 Array (agx::VectorPOD< T > &vec, agx::IndexRange32 range)
 
 Array (agxData::Buffer *buffer)
 Create a new array covering the entire given buffer.
 
 Array (agxData::Buffer *buffer, agx::IndexRange32 range)
 Create a new array covering the given range of the given buffer.
 
 Array (const agxData::Array< T > &other, agx::IndexRange32 localRange)
 Create a new array that covers a subset of another array.
 
agx::GlobalResult::Transaction allocateResult (size_t numElements)
 
T & at (size_t index)
 
const T & at (size_t index) const
 
T & back ()
 
const T & back () const
 
iterator begin ()
 
const_iterator begin () const
 
template<typename T2 >
size_t commitResult (const T2 &vector)
 
template<typename T2 >
size_t commitResult (const T2 &vector, agx::Index sortIndex)
 
size_t commitResult (size_t numElements, const void *localResult)
 
size_t commitResult (size_t numElements, const void *localResult, agx::Index sortIndex)
 
template<typename T2 >
bool contains (const T2 &element) const
 
iterator end ()
 
const_iterator end () const
 
template<typename T2 >
size_t find (const T2 &element) const
 The index of the first occurrence of an element that is equal to the given element.
 
T & front ()
 
const T & front () const
 
agx::GlobalResultgetGlobalResult ()
 
agxData::Array< T > operator[] (agx::IndexRange32 subRange) const
 
T & operator[] (size_t index)
 
const T & operator[] (size_t index) const
 
T * ptr ()
 
const T * ptr () const
 
agxData::Array< T > slice (agx::IndexRange32 subRange) const
 
- Public Member Functions inherited from agxData::AbstractArray
 AbstractArray ()
 Create a new invalid array.
 
 AbstractArray (agxData::Buffer *buffer)
 Create a new array that covers the entire given buffer.
 
 AbstractArray (agxData::Buffer *buffer, agx::IndexRange32 range)
 Create a new array for the given buffer that covers the specified range.
 
 AbstractArray (const agxData::AbstractArray &other, agx::IndexRange32 localRange)
 Create a new array that covers a subset of another array.
 
void _setBuffer (agxData::Buffer *buffer)
 Set the buffer while maintaining the current range, should normally not be used.
 
agxData::Bufferbuffer ()
 
const agxData::Bufferbuffer () const
 
bool empty () const
 
agxData::FormatgetFormat ()
 
const agxData::FormatgetFormat () const
 
void init ()
 Set to empty array.
 
void init (agxData::Buffer *buffer)
 Set the buffer that the array will access. The range is set to the entire buffer.
 
void init (agxData::Buffer *buffer, agx::IndexRange32 range)
 Set the buffer that the array will access, as well as the range of the buffer that is to be covered.
 
bool isValid () const
 
agx::IndexRange32range ()
 
const agx::IndexRange32range () const
 
void setRange (agx::IndexRange32 range)
 Set the range of the buffer that the array will cover.
 
void setRange (size_t startIndex, size_t endIndex)
 Set the range of the buffer that the array will cover.
 
size_t size () const
 
void sync ()
 Updates the internal data access pointer. Called when the back end buffer is reallocated.
 
- Public Member Functions inherited from agxData::Data
 Data (void *ptr=nullptr)
 
AbstractArrayasArray ()
 
template<typename T >
Array< T > & asArray ()
 
const AbstractArrayasArray () const
 
template<typename T >
const Array< T > & asArray () const
 
AbstractScalarasScalar ()
 
template<typename T >
Scalar< T > & asScalar ()
 
const AbstractScalarasScalar () const
 
template<typename T >
const Scalar< T > & asScalar () const
 
void * ptr ()
 
const void * ptr () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agxData::Array< T >
static const agxData::Array< T > raw (const T *buffer, agx::Index size)
 
static agxData::Array< T > raw (T *buffer, agx::Index size)
 Array creation helper method that creates an array covering the given memory area.
 
- Static Public Attributes inherited from agxData::Array< T >
static const bool IsScalar = false
 
- Protected Attributes inherited from agxData::AbstractArray
agxData::Bufferm_buffer
 
agx::IndexRange32 m_range
 
- Protected Attributes inherited from agxData::Data
void * m_ptr
 

Detailed Description

template<typename T>
class agxData::Vector< T >

Definition at line 27 of file agxData/Vector.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef const T* agxData::Vector< T >::const_iterator

Definition at line 38 of file agxData/Vector.h.

◆ const_pointer

template<typename T >
typedef const T* agxData::Vector< T >::const_pointer

Definition at line 33 of file agxData/Vector.h.

◆ const_reference

template<typename T >
typedef const T& agxData::Vector< T >::const_reference

Definition at line 35 of file agxData/Vector.h.

◆ difference_type

template<typename T >
typedef ptrdiff_t agxData::Vector< T >::difference_type

Definition at line 40 of file agxData/Vector.h.

◆ iterator

template<typename T >
typedef T* agxData::Vector< T >::iterator

Definition at line 37 of file agxData/Vector.h.

◆ iterator_category

template<typename T >
typedef std::random_access_iterator_tag agxData::Vector< T >::iterator_category

Definition at line 39 of file agxData/Vector.h.

◆ pointer

template<typename T >
typedef T* agxData::Vector< T >::pointer

Definition at line 32 of file agxData/Vector.h.

◆ reference

template<typename T >
typedef T& agxData::Vector< T >::reference

Definition at line 34 of file agxData/Vector.h.

◆ size_type

template<typename T >
typedef size_t agxData::Vector< T >::size_type

Definition at line 36 of file agxData/Vector.h.

◆ Type

template<typename T >
typedef T agxData::Vector< T >::Type

Definition at line 30 of file agxData/Vector.h.

◆ value_type

template<typename T >
typedef T agxData::Vector< T >::value_type

Definition at line 31 of file agxData/Vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/2]

template<typename T >
agxData::Vector< T >::Vector
explicit

Definition at line 130 of file agxData/Vector.h.

◆ Vector() [2/2]

template<typename T >
agxData::Vector< T >::Vector ( agxData::Buffer buffer)
explicit

◆ ~Vector()

template<typename T >
agxData::Vector< T >::~Vector

Definition at line 141 of file agxData/Vector.h.

Member Function Documentation

◆ clear()

template<typename T >
void agxData::Vector< T >::clear

Remove all elements, optionally with maintained buffer allocation.

Definition at line 331 of file agxData/Vector.h.

References agxAssert, and m_size.

◆ commit()

template<typename T >
void agxData::Vector< T >::commit

Commit all changes.

Definition at line 147 of file agxData/Vector.h.

References agxAssert.

◆ decrement()

template<typename T >
void agxData::Vector< T >::decrement ( size_t  numElements = 1)

Definition at line 217 of file agxData/Vector.h.

References agxAssert.

◆ erase() [1/4]

template<typename T >
Vector< T >::iterator agxData::Vector< T >::erase ( iterator  position)

STL erase functionality.

Definition at line 255 of file agxData/Vector.h.

References agxAssert.

◆ erase() [2/4]

template<typename T >
Vector< T >::iterator agxData::Vector< T >::erase ( iterator  start,
iterator  end 
)

Definition at line 265 of file agxData/Vector.h.

References agxAssert.

◆ erase() [3/4]

template<typename T >
void agxData::Vector< T >::erase ( size_t  index)

Erase elements using indices instead of iterators.

Definition at line 277 of file agxData/Vector.h.

References agxAssert.

◆ erase() [4/4]

template<typename T >
void agxData::Vector< T >::erase ( size_t  start,
size_t  end 
)

Definition at line 291 of file agxData/Vector.h.

References agxAssert, agxAssert1, and m_size.

◆ eraseFast() [1/2]

template<typename T >
Vector< T >::iterator agxData::Vector< T >::eraseFast ( const_iterator  position)

Fast erase, replacing the erased element with the last element.

Definition at line 310 of file agxData/Vector.h.

References agxAssert.

◆ eraseFast() [2/2]

template<typename T >
void agxData::Vector< T >::eraseFast ( size_t  index)

Definition at line 320 of file agxData/Vector.h.

References agxAssert, agxAssertN, and m_size.

◆ findAndErase()

template<typename T >
template<typename T2 >
bool agxData::Vector< T >::findAndErase ( const T2 &  element,
bool  searchMultiple = false 
)

Find and erase an element.

Parameters
elementThe element to search for
searchMultipleSet to true if search should continue after element is found, otherwise the search terminates on first match.
Returns
true if the element was found, else false

Definition at line 338 of file agxData/Vector.h.

References agxAssert.

◆ increment()

template<typename T >
T * agxData::Vector< T >::increment ( size_t  numElements = 1,
const T &  value = T() 
)

Resize using a increment.

Definition at line 198 of file agxData/Vector.h.

References agxAssert, agxData::Buffer::CAPACITY_MULTIPLIER, and m_capacity.

◆ insert() [1/3]

template<typename T >
template<typename InputIterator >
void agxData::Vector< T >::insert ( iterator  it,
InputIterator  first,
InputIterator  last 
)

Definition at line 391 of file agxData/Vector.h.

References agxAssert, agxData::Buffer::CAPACITY_MULTIPLIER, m_capacity, and m_size.

◆ insert() [2/3]

template<typename T >
Vector< T >::iterator agxData::Vector< T >::insert ( iterator  position,
const T &  value 
)

Definition at line 362 of file agxData/Vector.h.

References agxAssert.

◆ insert() [3/3]

template<typename T >
void agxData::Vector< T >::insert ( size_t  index,
const T &  value 
)

◆ pop_back()

template<typename T >
void agxData::Vector< T >::pop_back

Remove the back element.

Definition at line 244 of file agxData/Vector.h.

References agxAssert.

◆ push_back()

template<typename T >
template<typename T2 >
void agxData::Vector< T >::push_back ( const T2 &  value)

Append a new data element to the vector.

Definition at line 231 of file agxData/Vector.h.

References agxAssert, agxData::Buffer::CAPACITY_MULTIPLIER, m_capacity, and m_size.

◆ reserve()

template<typename T >
void agxData::Vector< T >::reserve ( size_t  size)

Reserve capacity in the vector.

Definition at line 191 of file agxData/Vector.h.

References agxAssert.

◆ resize()

template<typename T >
void agxData::Vector< T >::resize ( size_t  size,
const T &  value = T() 
)

Resize the vector, which then enables direct addressing using the bracket '[]' operator.

Definition at line 165 of file agxData/Vector.h.

References AGX_VECTOR_SHRINK_THRESHOLD, agxAssert, m_capacity, and m_size.


The documentation for this class was generated from the following file: