RavEngine
Loading...
Searching...
No Matches
physx::PxsCCDBlockArray< T, BLOCK_SIZE > Struct Template Reference

a container class used in the CCD that minimizes frequency of hitting the allocator. More...

#include <PxsCCD.h>

Collaboration diagram for physx::PxsCCDBlockArray< T, BLOCK_SIZE >:
[legend]

Classes

struct  Block
 A block of data. More...
 
struct  BlockInfo
 A header for a block of data. More...
 

Public Member Functions

 PxsCCDBlockArray ()
 Constructor.
 
 ~PxsCCDBlockArray ()
 Destructor.
 
void clear ()
 Clears this block array.
 
void clear_NoDelete ()
 Clears this block array but does not release the memory.
 
T & pushBack ()
 Push a new element onto the back of the block array.
 
T & pushBack (T &data)
 Pushes a new element onto the back of this array, intitializing it to match the data.
 
void popBack ()
 Pops the last element from the list.
 
PxU32 size () const
 Returns the current size of the array.
 
T & operator[] (PxU32 index) const
 Returns the element at a given index in the array.
 

Public Attributes

PxArray< BlockInfo > blocks
 
PxU32 currentBlock
 The current block.
 

Detailed Description

template<typename T, int BLOCK_SIZE>
struct physx::PxsCCDBlockArray< T, BLOCK_SIZE >

a container class used in the CCD that minimizes frequency of hitting the allocator.

This class stores a set of blocks of memory. It is effectively an array that resizes more efficiently because it doesn't need to reallocate an entire buffer and copy data.

Member Function Documentation

◆ clear()

template<typename T , int BLOCK_SIZE>
void physx::PxsCCDBlockArray< T, BLOCK_SIZE >::clear ( )
inline

Clears this block array.

Note
This clear function also deletes all additional blocks

◆ operator[]()

template<typename T , int BLOCK_SIZE>
T & physx::PxsCCDBlockArray< T, BLOCK_SIZE >::operator[] ( PxU32  index) const
inline

Returns the element at a given index in the array.

Parameters
[in]indexThe index of the element in the array
Returns
The element at a given index in the array.

◆ pushBack() [1/2]

template<typename T , int BLOCK_SIZE>
T & physx::PxsCCDBlockArray< T, BLOCK_SIZE >::pushBack ( )
inline

Push a new element onto the back of the block array.

Returns
The new element

◆ pushBack() [2/2]

template<typename T , int BLOCK_SIZE>
T & physx::PxsCCDBlockArray< T, BLOCK_SIZE >::pushBack ( T &  data)
inline

Pushes a new element onto the back of this array, intitializing it to match the data.

Parameters
dataThe data to initialize the new element to
Returns
The new element

◆ size()

template<typename T , int BLOCK_SIZE>
PxU32 physx::PxsCCDBlockArray< T, BLOCK_SIZE >::size ( ) const
inline

Returns the current size of the array.

Returns
The current size of the array.

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