VR-Forces 4.10 Class Documentation
 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
 block of free data in the vector More...
 

Public Member Functions

 DtReusableMemoryVector ()
 constructor More...
 
 ~DtReusableMemoryVector ()
 destructor More...
 
int findFreeBlock (const size_t sizeRequired)
 get an available free block or add one to the end of the vector if one is not available More...
 
std::pair< int, intremove (const R &removalPredicate)
 remove a range of objects and free that range. More...
 
void removeIndices (int startIndex, int endIndex)
 remove a range of indices, inclusive More...
 
void printFreeBlocks (void)
 debug printout of the free blocks that are available More...
 
size_t size (void) const
 current size of the vector More...
 
const T & operator[] (int index) const
 access an element in the vector via index More...
 
T & operator[] (int index)
 access an element in the vector via index More...
 
void reserve (size_t reserveSize)
 reserve a block of memory for this vector of a specific size More...
 
const T * data (void) const
 get the pointer to the raw data in the vector More...
 
void updateFreeBlocks (int startIndex, int endIndex)
 add a new free block or combine it with free blocks already in the list More...
 

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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)