VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Attributes
makVrv::DtReusableMemoryVector< T, I, R > Class Template Reference
Inheritance diagram for makVrv::DtReusableMemoryVector< T, I, R >:
Inheritance graph
[legend]

Classes

struct  Block
 

Public Member Functions

 DtReusableMemoryVector ()
 
 ~DtReusableMemoryVector ()
 
int findFreeBlock (const size_t sizeRequired)
 
std::pair< int, intremove (const R &removalPredicate)
 
void removeIndices (int startIndex, int endIndex)
 
void printFreeBlocks (void)
 
size_t size (void) const
 
const T & operator[] (int index) const
 
T & operator[] (int index)
 
void reserve (size_t reserveSize)
 
const T * data (void) const
 
void updateFreeBlocks (int startIndex, int endIndex)
 

Protected Types

typedef std::list< BlockListFreeBlocks
 
typedef std::vector< T > VectorOfTs
 

Protected Attributes

ListFreeBlocks myListFreeBlocks
 
myInitializerForT
 
VectorOfTs myVectorOfTs
 

Member Typedef Documentation

template<class T, class I, class R = DtNullRemoval>
typedef std::list<Block> makVrv::DtReusableMemoryVector< T, I, R >::ListFreeBlocks
protected
template<class T, class I, class R = DtNullRemoval>
typedef std::vector<T> makVrv::DtReusableMemoryVector< T, I, R >::VectorOfTs
protected

Constructor & Destructor Documentation

template<class T , class I , class R >
makVrv::DtReusableMemoryVector< T, I, R >::DtReusableMemoryVector ( )

constructor

template<class T , class I , class R >
makVrv::DtReusableMemoryVector< T, I, R >::~DtReusableMemoryVector ( )

destructor

Member Function Documentation

template<class T , class I , class R >
int makVrv::DtReusableMemoryVector< T, I, R >::findFreeBlock ( const size_t  sizeRequired)

get an available free block or add one to the end of the vector if one is not available

References makVrv::DtReusableMemoryVector< T, I, R >::Block::size, and makVrv::DtReusableMemoryVector< T, I, R >::Block::startIndex.

template<class T, class I, class R = DtNullRemoval>
std::pair<int, int> makVrv::DtReusableMemoryVector< T, I, R >::remove ( const R &  removalPredicate)

remove a range of objects and free that range. returns the start and end index that was removed currently only supports removalPredicates which select contiguous entries undefined results if it does not.

template<class T, class I, class R = DtNullRemoval>
void makVrv::DtReusableMemoryVector< T, I, R >::removeIndices ( int  startIndex,
int  endIndex 
)

remove a range of indices, inclusive

template<class T , class I , class R >
void makVrv::DtReusableMemoryVector< T, I, R >::printFreeBlocks ( void  )

debug printout of the free blocks that are available

template<class T , class I , class R >
size_t makVrv::DtReusableMemoryVector< T, I, R >::size ( void  ) const

current size of the vector

template<class T , class I , class R >
const T & makVrv::DtReusableMemoryVector< T, I, R >::operator[] ( int  index) const

access an element in the vector via index

template<class T , class I , class R >
T & makVrv::DtReusableMemoryVector< T, I, R >::operator[] ( int  index)

access an element in the vector via index

template<class T , class I , class R >
void makVrv::DtReusableMemoryVector< T, I, R >::reserve ( size_t  reserveSize)

reserve a block of memory for this vector of a specific size

template<class T , class I , class R >
const T * makVrv::DtReusableMemoryVector< T, I, R >::data ( void  ) const

get the pointer to the raw data in the vector

template<class T , class I , class R >
void makVrv::DtReusableMemoryVector< T, I, R >::updateFreeBlocks ( int  startIndex,
int  endIndex 
)

add a new free block or combine it with free blocks already in the list

References makVrv::DtReusableMemoryVector< T, I, R >::Block::size, and makVrv::DtReusableMemoryVector< T, I, R >::Block::startIndex.

Member Data Documentation

template<class T, class I, class R = DtNullRemoval>
ListFreeBlocks makVrv::DtReusableMemoryVector< T, I, R >::myListFreeBlocks
protected
template<class T, class I, class R = DtNullRemoval>
I makVrv::DtReusableMemoryVector< T, I, R >::myInitializerForT
protected
template<class T, class I, class R = DtNullRemoval>
VectorOfTs makVrv::DtReusableMemoryVector< T, I, R >::myVectorOfTs
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)