#include <SparseArray.h>
Definition at line 28 of file SparseArray.h.
Public Types | |
| typedef std::list < Block > | BlockList |
Public Member Functions | |
| ~SparseArray () | |
| _Type | operator[] (size_t offset) const |
| void | range_write (size_t offset, size_t elts, const _Type *in) |
| size_t | size () const |
| const BlockList & | blocks () const |
Private Member Functions | |
| _Type * | allocate (size_t offset, size_t size) |
Private Attributes | |
| BlockList | blocks_ |
| List of blocks_ sorted in ascending order by offset. | |
Classes | |
| class | Block |
| typedef std::list<Block> SparseArray< _Type >::BlockList |
Definition at line 49 of file SparseArray.h.
| SparseArray< _Type >::~SparseArray | ( | ) | [inline] |
| _Type SparseArray< _Type >::operator[] | ( | size_t | offset | ) | const [inline] |
In the empty sparse area, the SparseArray returns an element which is the default constructor of _Type.
Definition at line 65 of file SparseArray.h.
References SparseArray< _Type >::blocks_.
| void SparseArray< _Type >::range_write | ( | size_t | offset, | |
| size_t | elts, | |||
| const _Type * | in | |||
| ) | [inline] |
Write into the sparse map. Allocates a block if needed.
Definition at line 88 of file SparseArray.h.
References SparseArray< _Type >::allocate(), and ASSERT.
| size_t SparseArray< _Type >::size | ( | ) | const [inline] |
Definition at line 103 of file SparseArray.h.
References SparseArray< _Type >::blocks_.
Referenced by SparseArray< _Type >::Block::Block().
| const BlockList& SparseArray< _Type >::blocks | ( | ) | const [inline] |
Definition at line 119 of file SparseArray.h.
References SparseArray< _Type >::blocks_.
| _Type* SparseArray< _Type >::allocate | ( | size_t | offset, | |
| size_t | size | |||
| ) | [inline, private] |
Allocate a block starting at offset with elts. Will merge blocks that it finds overlapping.
Definition at line 134 of file SparseArray.h.
References ASSERT, SparseArray< _Type >::blocks_, and NOTREACHED.
Referenced by SparseArray< _Type >::range_write().
BlockList SparseArray< _Type >::blocks_ [private] |
List of blocks_ sorted in ascending order by offset.
Definition at line 126 of file SparseArray.h.
Referenced by SparseArray< _Type >::allocate(), SparseArray< _Type >::blocks(), SparseArray< _Type >::operator[](), SparseArray< _Type >::size(), and SparseArray< _Type >::~SparseArray().
1.5.3