|
Nori
|
Basic vector implementation, which stores all data in a list of fixed-sized blocks. More...
#include <gkdtree.h>
Public Member Functions | |
| BlockedVector () | |
| ~BlockedVector () | |
| void | push_back (const T &value) |
| Append an element to the end. | |
| T * | allocate (size_t size) |
| Allocate a certain number of elements and return a pointer to the first one. | |
| T & | operator[] (size_t index) |
| const T & | operator[] (size_t index) const |
| size_t | size () const |
| Return the currently used number of items. | |
| size_t | blockCount () const |
| Return the number of allocated blocks. | |
| size_t | capacity () const |
| Return the total capacity. | |
| void | resize (size_t pos) |
| Resize the vector to the given size. | |
| void | clear () |
| Release all memory. | |
Basic vector implementation, which stores all data in a list of fixed-sized blocks.
This leads to a more conservative memory usage when the final size of a (possibly very large) growing vector is unknown. Also, frequent reallocations & copies are avoided.
| BlockedVector< T, BlockSize >::BlockedVector | ( | ) | [inline] |
| BlockedVector< T, BlockSize >::~BlockedVector | ( | ) | [inline] |
| T* BlockedVector< T, BlockSize >::allocate | ( | size_t | size | ) | [inline] |
| size_t BlockedVector< T, BlockSize >::blockCount | ( | ) | const [inline] |
| size_t BlockedVector< T, BlockSize >::capacity | ( | ) | const [inline] |
| void BlockedVector< T, BlockSize >::clear | ( | ) | [inline] |
| const T& BlockedVector< T, BlockSize >::operator[] | ( | size_t | index | ) | const [inline] |
| T& BlockedVector< T, BlockSize >::operator[] | ( | size_t | index | ) | [inline] |
| void BlockedVector< T, BlockSize >::push_back | ( | const T & | value | ) | [inline] |
| void BlockedVector< T, BlockSize >::resize | ( | size_t | pos | ) | [inline] |
| size_t BlockedVector< T, BlockSize >::size | ( | ) | const [inline] |