|
RavEngine
|
#include <PxArray.h>
Public Types | |
| typedef T * | Iterator |
| typedef const T * | ConstIterator |
Public Member Functions | |
| PxArray (const PxEMPTY v) | |
| PX_INLINE | PxArray (const Alloc &alloc=Alloc()) |
| PX_INLINE | PxArray (uint32_t size, const T &a=T(), const Alloc &alloc=Alloc()) |
| template<class A > | |
| PX_INLINE | PxArray (const PxArray< T, A > &other, const Alloc &alloc=Alloc()) |
| PX_INLINE | PxArray (const PxArray &other, const Alloc &alloc=Alloc()) |
| PX_INLINE | PxArray (const T *first, const T *last, const Alloc &alloc=Alloc()) |
| PX_INLINE | ~PxArray () |
| template<class A > | |
| PX_INLINE PxArray & | operator= (const PxArray< T, A > &rhs) |
| PX_INLINE PxArray & | operator= (const PxArray &t) |
| PX_FORCE_INLINE const T & | operator[] (uint32_t i) const |
| PX_FORCE_INLINE T & | operator[] (uint32_t i) |
| PX_FORCE_INLINE ConstIterator | begin () const |
| PX_FORCE_INLINE Iterator | begin () |
| PX_FORCE_INLINE ConstIterator | end () const |
| PX_FORCE_INLINE Iterator | end () |
| PX_FORCE_INLINE const T & | front () const |
| PX_FORCE_INLINE T & | front () |
| PX_FORCE_INLINE const T & | back () const |
| PX_FORCE_INLINE T & | back () |
| PX_FORCE_INLINE uint32_t | size () const |
| PX_INLINE void | clear () |
| PX_FORCE_INLINE bool | empty () const |
| PX_INLINE Iterator | find (const T &a) |
| PX_INLINE ConstIterator | find (const T &a) const |
| PX_FORCE_INLINE T & | pushBack (const T &a) |
| PX_INLINE T | popBack () |
| PX_INLINE T & | insert () |
| PX_INLINE void | replaceWithLast (uint32_t i) |
| PX_INLINE void | replaceWithLast (Iterator i) |
| PX_INLINE bool | findAndReplaceWithLast (const T &a) |
| PX_INLINE void | remove (uint32_t i) |
| PX_INLINE void | removeRange (uint32_t begin, uint32_t count) |
| PX_NOINLINE void | resize (const uint32_t size, const T &a=T()) |
| PX_NOINLINE void | resizeUninitialized (const uint32_t size) |
| PX_INLINE void | shrink () |
| PX_INLINE void | reset () |
| PX_INLINE void | resetOrClear () |
| PX_INLINE void | reserve (const uint32_t capacity) |
| PX_FORCE_INLINE uint32_t | capacity () const |
| PX_FORCE_INLINE void | forceSize_Unsafe (uint32_t size) |
| PX_INLINE void | swap (PxArray< T, Alloc > &other) |
| PX_INLINE void | assign (const T *first, const T *last) |
| PX_FORCE_INLINE uint32_t | isInUserMemory () const |
| PX_INLINE Alloc & | getAllocator () |
| return reference to allocator | |
Protected Member Functions | |
| PxArray (T *memory, uint32_t size, uint32_t capacity, const Alloc &alloc=Alloc()) | |
| template<class A > | |
| PX_NOINLINE void | copy (const PxArray< T, A > &other) |
| PX_INLINE T * | allocate (uint32_t size) |
| PX_INLINE void | deallocate (void *mem) |
| PX_NOINLINE T & | growAndPushBack (const T &a) |
| PX_INLINE void | grow (uint32_t capacity) |
| PX_NOINLINE void | recreate (uint32_t capacity) |
| PX_INLINE uint32_t | capacityIncrement () const |
Static Protected Member Functions | |
| static PX_INLINE void | create (T *first, T *last, const T &a) |
| static PX_INLINE void | copy (T *first, T *last, const T *src) |
| static PX_INLINE void | destroy (T *first, T *last) |
Protected Attributes | |
| T * | mData |
| uint32_t | mSize |
| uint32_t | mCapacity |
An array is a sequential container.
Implementation note entries between 0 and size are valid objects we use inheritance to build this because the array is included inline in a lot of objects and we want the allocator to take no space if it's not stateful, which aggregation doesn't allow. Also, we want the metadata at the front for the inline case where the allocator contains some inline storage space
|
inlineexplicit |
Default array constructor. Initialize an empty array
|
inlineexplicit |
Initialize array with given capacity
|
inlineexplicit |
Copy-constructor. Copy all entries from other array
|
inlineexplicit |
Initialize array with given length
|
inline |
Destructor
|
inline |
Assign a range of values to this vector (resizes to length of range)
|
inline |
Returns a reference to the last element of the array. Undefined if the array is empty
|
inline |
Returns a pointer to the initial element of the array.
|
inline |
Query the capacity(allocated mem) for the array.
|
inline |
Clears the array.
|
inline |
Returns whether the array is empty (i.e. whether its size is 0).
|
inline |
Returns an iterator beyond the last element of the array. Do not dereference.
|
inline |
Finds the first occurrence of an element in the array.
| a | The element to find. |
|
inline |
Replaces the first occurrence of the element a with the last element Operation is O(n)
| a | The position of the element that will be subtracted from this array. |
|
inline |
Unsafe function to force the size of the array
|
inline |
Returns a reference to the first element of the array. Undefined if the array is empty.
|
inlineprotected |
Resizes the available memory for the array.
| capacity | The number of entries that the set should be able to hold. |
|
protected |
Called when pushBack() needs to grow the array.
| a | The element that will be added to this array. |
|
inline |
Construct one element at the end of the array. Operation is O(1).
|
inline |
Assignment operator. Copy content (deep-copy)
|
inline |
Array indexing operator.
| i | The index of the element that will be returned. |
|
inline |
Array indexing operator.
| i | The index of the element that will be returned. |
|
inline |
Returns the element at the end of the array. Only legal if the array is non-empty.
|
inline |
Adds one element to the end of the array. Operation is O(1).
| a | The element that will be added to this array. |
|
protected |
Creates a new memory block, copies all entries to the new block and destroys old entries.
| capacity | The number of entries that the set should be able to hold. |
|
inline |
Subtracts the element on position i from the array. Shift the entire array one step. Operation is O(n)
| i | The position of the element that will be subtracted from this array. |
|
inline |
Removes a range from the array. Shifts the array so order is maintained. Operation is O(n)
| begin | The starting position of the element that will be subtracted from this array. |
| count | The number of elments that will be subtracted from this array. |
|
inline |
Subtracts the element on position i from the array and replace it with the last element. Operation is O(1)
| i | The position of the element that will be subtracted from this array. |
|
inline |
Ensure that the array has at least size capacity.
|
inline |
Deletes all array elements and frees memory.
|
inline |
Resets or clears the array depending on occupancy.
| PX_NOINLINE void physx::PxArray< T, Alloc >::resize | ( | const uint32_t | size, |
| const T & | a = T() |
||
| ) |
Resize array
|
inline |
Resize array such that only as much memory is allocated to hold the existing elements
|
inline |
Returns the number of entries in the array. This can, and probably will, differ from the array capacity.
|
inline |
Swap contents of an array without allocating temporary storage