|
Blender V5.0
|
#include <BLI_vector_list.hh>
Public Member Functions | |
| VectorList () | |
| VectorList (VectorList &&other) noexcept | |
| VectorList & | operator= (VectorList &&other) |
| void | append (const T &value) |
| void | append (T &&value) |
| template<typename ForwardT> | |
| void | append_as (ForwardT &&value) |
| T & | first () |
| T & | last () |
| int64_t | size () const |
| bool | is_empty () const |
| void | clear () |
| void | clear_and_shrink () |
| const T & | operator[] (int64_t index) const |
| T & | operator[] (int64_t index) |
| MutIterator | begin () |
| MutIterator | end () |
| ConstIterator | begin () const |
| ConstIterator | end () const |
A VectorList is a vector of vectors.
VectorList can be used when:
1) Don't know up front the number of elements that will be added to the list. Use array or vector.reserve when known up front.
2) Number of reads/writes doesn't require sequential access of the whole list. A vector ensures memory is sequential which is fast when reading, writing can have overhead when the reserved memory is full.
When a VectorList reserved memory is full it will allocate memory for the new items, breaking the sequential access. Within each allocated memory block the elements are ordered sequentially.
Indexing has some overhead compared to a Vector or an Array, but it still has constant time access.
Definition at line 38 of file BLI_vector_list.hh.
|
inline |
Definition at line 54 of file BLI_vector_list.hh.
|
inlinenoexcept |
Definition at line 60 of file BLI_vector_list.hh.
|
inline |
Insert a new element at the end of the VectorList.
Definition at line 74 of file BLI_vector_list.hh.
Referenced by make_dupli(), blender::tests::return_by_value_helper(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Insert a new element at the end of the VectorList.
Definition at line 80 of file BLI_vector_list.hh.
|
inline |
This is similar to std::vector::emplace_back.
Definition at line 86 of file BLI_vector_list.hh.
Referenced by blender::VectorList< DupliObject >::append(), and blender::VectorList< DupliObject >::append().
|
inline |
Definition at line 284 of file BLI_vector_list.hh.
|
inline |
Definition at line 293 of file BLI_vector_list.hh.
|
inline |
Afterwards the VectorList has 0 elements, but will still have memory to be refilled again.
Definition at line 130 of file BLI_vector_list.hh.
Referenced by BKE_scene_base_iter_next(), blender::draw::foreach_obref_in_scene(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Afterwards the VectorList has 0 elements and the Vectors allocated memory will be freed.
Definition at line 140 of file BLI_vector_list.hh.
|
inline |
Definition at line 288 of file BLI_vector_list.hh.
|
inline |
Definition at line 297 of file BLI_vector_list.hh.
|
inline |
Return a reference to the first element in the VectorList. This invokes undefined behavior when the VectorList is empty.
Definition at line 97 of file BLI_vector_list.hh.
Referenced by BKE_scene_base_iter_next(), and blender::tests::TEST().
|
inline |
Returns true when the VectorList contains no elements, otherwise false.
This is the same as std::vector::empty.
Definition at line 124 of file BLI_vector_list.hh.
Referenced by BKE_scene_base_iter_next(), BM_mesh_uvselect_set_elem_from_mesh(), blender::draw::foreach_obref_in_scene(), blender::ed::object::make_object_duplilist_real(), and blender::tests::TEST().
|
inline |
Return a reference to the last element in the VectorList. This invokes undefined behavior when the VectorList is empty.
Definition at line 107 of file BLI_vector_list.hh.
Referenced by make_dupli(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Definition at line 68 of file BLI_vector_list.hh.
|
inline |
Get the value at the given index. This invokes undefined behavior when the index is out of bounds.
Definition at line 162 of file BLI_vector_list.hh.
|
inline |
Get the value at the given index. This invokes undefined behavior when the index is out of bounds.
Definition at line 152 of file BLI_vector_list.hh.
|
inline |
Return how many values are currently stored in the VectorList.
Definition at line 114 of file BLI_vector_list.hh.
Referenced by BKE_scene_base_iter_next(), blender::VectorList< DupliObject >::end(), blender::VectorList< DupliObject >::end(), blender::VectorList< DupliObject >::first(), blender::VectorList< DupliObject >::last(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().