|
| FastArray () |
|
| FastArray (const FastArray< T > ©) |
|
| FastArray (size_t count, const T &value) |
| Creates an array pushing the value N times. More...
|
|
| FastArray (size_t reserveAmount) |
| Creates an array reserving the amount of elements (memory is not initialized) More...
|
|
| ~FastArray () |
|
void | append (const_iterator otherBegin, const_iterator otherEnd) |
|
void | appendPOD (const_iterator otherBegin, const_iterator otherEnd) |
|
T & | back () |
|
const T & | back () const |
|
iterator | begin () |
|
const_iterator | begin () const |
|
size_t | capacity () const |
|
void | clear () |
|
void | destroy () |
|
bool | empty () const |
|
iterator | end () |
|
const_iterator | end () const |
|
iterator | erase (iterator first, iterator last) |
|
iterator | erase (iterator toErase) |
|
iterator | erasePOD (iterator first, iterator last) |
|
T & | front () |
|
const T & | front () const |
|
iterator | insert (iterator where, const T &val) |
|
iterator | insertPOD (iterator where, const_iterator otherBegin, const_iterator otherEnd) |
| otherBegin & otherEnd must not overlap with this->begin() and this->end() More...
|
|
void | operator= (const FastArray< T > ©) |
|
T & | operator[] (size_t idx) |
|
const T & | operator[] (size_t idx) const |
|
void | pop_back () |
|
void | push_back (const T &val) |
|
void | reserve (size_t reserveAmount) |
|
void | resize (size_t newSize, const T &value=T()) |
|
void | resizePOD (size_t newSize, const T &value=T()) |
|
size_t | size () const |
|
void | swap (FastArray< T > &other) |
|
template<typename T>
class Ogre::FastArray< T >
Lightweight implementation of std::vector.
- Since we can't enable/disable those checkings selectively, I wrote our own lightweight container for performance-sensitive areas where we're also very certain we won't use them incorrectly.
- It's partially STL compliant, for example std::for_each works with it. However some functions are not, for example FastArray<int> myArray(5) does not behave as the standard does: FastArray will reserve 5 ints, while std::vector will push 5 ints and default-initialize them (in the case of ints, fill it with 5 zeros)
- Only use this container for extremely performance sensitive and you're certain you'll be using it correctly. If you're in doubt or don't know what to do, use std::vector instead.
- FastArray was created because we needed to keep multiple lists (one per thread) of culled MovableObjects pointers (against the camera) and then iterate through all of them. These multiple levels of indirection was causing MS implementation to go mad with a huge amount of useless bounds checking & iterator validation.
- Author
- Matias N. Goldberg
- Version
- 1.0