|
Blender V4.3
|
#include <BLI_linear_allocator_chunked_list.hh>
Inherits blender::NonCopyable.
Classes | |
| class | ConstIterator |
| class | MutableIterator |
Public Member Functions | |
| ChunkedList ()=default | |
| ChunkedList (ChunkedList &&other) | |
| ~ChunkedList () | |
| ChunkedList & | operator= (ChunkedList &&other) |
| void | append (LinearAllocator<> &allocator, const T &value) |
| void | append (LinearAllocator<> &allocator, T &&value) |
| template<typename... Args> | |
| void | append_as (LinearAllocator<> &allocator, Args &&...args) |
| ConstIterator | begin () const |
| ConstIterator | end () const |
| MutableIterator | begin () |
| MutableIterator | end () |
This is a special purpose container data structure that can be used to efficiently gather many elements into many (small) lists for later retrieval. Insertion order is not maintained.
To use this data structure, one has to have a separate #LinearAllocator which is passed to the append function. This allows the same allocator to be used by many lists. Passing it into the append function also removes the need to store the allocator pointer in every list.
It is an improvement over #Vector because it does not require any reallocations. #VectorList could also be used to overcome the reallocation issue.
This data structure is also an improvement over #VectorList because:
Definition at line 51 of file BLI_linear_allocator_chunked_list.hh.
|
default |
|
inline |
Definition at line 59 of file BLI_linear_allocator_chunked_list.hh.
|
inline |
Definition at line 65 of file BLI_linear_allocator_chunked_list.hh.
References blender::linear_allocator::ChunkedListSegment< T, Capacity >::next.
|
inline |
Add an element to the list. The insertion order is not maintained. The given allocator is used to allocate any extra memory that may be needed.
Definition at line 94 of file BLI_linear_allocator_chunked_list.hh.
References blender::linear_allocator::ChunkedList< T, SegmentCapacity >::append_as().
Referenced by blender::linear_allocator::tests::TEST(), blender::linear_allocator::tests::TEST(), and blender::linear_allocator::tests::TEST().
|
inline |
Definition at line 99 of file BLI_linear_allocator_chunked_list.hh.
References blender::linear_allocator::ChunkedList< T, SegmentCapacity >::append_as().
|
inline |
Definition at line 104 of file BLI_linear_allocator_chunked_list.hh.
References blender::LinearAllocator< Allocator >::construct(), blender::linear_allocator::ChunkedListSegment< T, Capacity >::next, blender::linear_allocator::ChunkedListSegment< T, Capacity >::size, T, and blender::linear_allocator::ChunkedListSegment< T, Capacity >::values.
Referenced by blender::linear_allocator::ChunkedList< T, SegmentCapacity >::append(), and blender::linear_allocator::ChunkedList< T, SegmentCapacity >::append().
|
inline |
Definition at line 179 of file BLI_linear_allocator_chunked_list.hh.
|
inline |
Definition at line 169 of file BLI_linear_allocator_chunked_list.hh.
|
inline |
Definition at line 184 of file BLI_linear_allocator_chunked_list.hh.
|
inline |
Definition at line 174 of file BLI_linear_allocator_chunked_list.hh.
|
inline |
Definition at line 80 of file BLI_linear_allocator_chunked_list.hh.
References blender::linear_allocator::ChunkedList< T, SegmentCapacity >::ChunkedList().