|
Blender
V2.93
|
#include <BLI_array.hh>
Public Types | |
| using | value_type = T |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | iterator = T * |
| using | const_iterator = const T * |
| using | size_type = int64_t |
Public Member Functions | |
| Array (Allocator allocator={}) noexcept | |
| Array (NoExceptConstructor, Allocator allocator={}) noexcept | |
| template<typename U , typename std::enable_if_t< std::is_convertible_v< U, T >> * = nullptr> | |
| Array (Span< U > values, Allocator allocator={}) | |
| template<typename U , typename std::enable_if_t< std::is_convertible_v< U, T >> * = nullptr> | |
| Array (const std::initializer_list< U > &values, Allocator allocator={}) | |
| Array (const std::initializer_list< T > &values, Allocator allocator={}) | |
| Array (int64_t size, Allocator allocator={}) | |
| Array (int64_t size, const T &value, Allocator allocator={}) | |
| Array (int64_t size, NoInitialization, Allocator allocator={}) | |
| Array (const Array &other) | |
| Array (Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >) | |
| ~Array () | |
| Array & | operator= (const Array &other) |
| Array & | operator= (Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >) |
| T & | operator[] (int64_t index) |
| const T & | operator[] (int64_t index) const |
| operator Span< T > () const | |
| operator MutableSpan< T > () | |
| template<typename U , typename std::enable_if_t< is_span_convertible_pointer_v< T, U >> * = nullptr> | |
| operator Span< U > () const | |
| template<typename U , typename std::enable_if_t< is_span_convertible_pointer_v< T, U >> * = nullptr> | |
| operator MutableSpan< U > () | |
| Span< T > | as_span () const |
| MutableSpan< T > | as_mutable_span () |
| int64_t | size () const |
| bool | is_empty () const |
| void | fill (const T &value) const |
| const T & | last () const |
| T & | last () |
| const T * | data () const |
| T * | data () |
| const T * | begin () const |
| const T * | end () const |
| T * | begin () |
| T * | end () |
| std::reverse_iterator< T * > | rbegin () |
| std::reverse_iterator< T * > | rend () |
| std::reverse_iterator< const T * > | rbegin () const |
| std::reverse_iterator< const T * > | rend () const |
| IndexRange | index_range () const |
| void | clear_without_destruct () |
| Allocator & | allocator () |
| const Allocator & | allocator () const |
| void | reinitialize (const int64_t new_size) |
Static Public Member Functions | |
| static int64_t | inline_buffer_capacity () |
Definition at line 62 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_iterator = const T * |
Definition at line 70 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_pointer = const T * |
Definition at line 66 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_reference = const T & |
Definition at line 68 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::iterator = T * |
Definition at line 69 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::pointer = T * |
Definition at line 65 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::reference = T & |
Definition at line 67 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::size_type = int64_t |
Definition at line 71 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::value_type = T |
Definition at line 64 of file BLI_array.hh.
|
inlinenoexcept |
By default an empty array is created.
Definition at line 90 of file BLI_array.hh.
|
inlinenoexcept |
Definition at line 96 of file BLI_array.hh.
|
inline |
Create a new array that contains copies of all values.
Definition at line 104 of file BLI_array.hh.
|
inline |
Create a new array that contains copies of all values.
Definition at line 116 of file BLI_array.hh.
|
inline |
Definition at line 121 of file BLI_array.hh.
|
inlineexplicit |
Create a new array with the given size. All values will be default constructed. For trivial types like int, default construction does nothing.
We might want another version of this in the future, that does not do default construction even for non-trivial types. This should not be the default though, because one can easily mess up when dealing with uninitialized memory.
Definition at line 134 of file BLI_array.hh.
|
inline |
Create a new array with the given size. All values will be initialized by copying the given default.
Definition at line 145 of file BLI_array.hh.
|
inline |
Create a new array with uninitialized elements. The caller is responsible for constructing the elements. Moving, copying or destructing an Array with uninitialized elements invokes undefined behavior.
This should be used very rarely. Note, that the normal size-constructor also does not initialize the elements when T is trivially constructible. Therefore, it only makes sense to use this with non trivially constructible types.
Usage: Array<std::string> my_strings(10, NoInitialization());
Definition at line 166 of file BLI_array.hh.
|
inline |
Definition at line 174 of file BLI_array.hh.
|
inlinenoexcept |
Definition at line 178 of file BLI_array.hh.
References data_, and blender::uninitialized_relocate_n().
|
inline |
Definition at line 193 of file BLI_array.hh.
References data_, and blender::destruct_n().
|
inline |
Access the allocator used by this array.
Definition at line 362 of file BLI_array.hh.
|
inline |
Definition at line 366 of file BLI_array.hh.
|
inline |
Definition at line 250 of file BLI_array.hh.
Referenced by blender::nodes::distribute_points_poisson_disk().
|
inline |
|
inline |
Definition at line 315 of file BLI_array.hh.
References data_.
|
inline |
Definition at line 306 of file BLI_array.hh.
References data_.
Referenced by blender::Array< T, InlineBufferCapacity, Allocator >::rend().
|
inline |
Sets the size to zero. This should only be used when you have manually destructed all elements in the array beforehand. Use with care.
Definition at line 354 of file BLI_array.hh.
|
inline |
Definition at line 301 of file BLI_array.hh.
References data_.
|
inline |
Get a pointer to the beginning of the array.
Definition at line 297 of file BLI_array.hh.
References data_.
Referenced by BMD_mesh_intersection(), blender::string_search::damerau_levenshtein_distance(), and blender::tests::TEST().
|
inline |
Definition at line 319 of file BLI_array.hh.
References data_.
|
inline |
Definition at line 310 of file BLI_array.hh.
References data_.
Referenced by blender::Array< T, InlineBufferCapacity, Allocator >::rbegin().
|
inline |
Copies the given value to every element in the array.
Definition at line 274 of file BLI_array.hh.
References data_, and blender::initialized_fill_n().
|
inline |
Get an index range containing all valid indices for this array.
Definition at line 345 of file BLI_array.hh.
Referenced by blender::nodes::geo_node_point_distribute_exec(), and blender::nodes::get_geometry_element_ids_as_uints().
|
inlinestatic |
Get the value of the InlineBufferCapacity template argument. This is the number of elements that can be stored without doing an allocation.
Definition at line 375 of file BLI_array.hh.
|
inline |
Returns true when the number of elements in the array is zero.
Definition at line 266 of file BLI_array.hh.
Referenced by blender::fn::GVectorArray::is_empty().
|
inline |
Definition at line 288 of file BLI_array.hh.
References BLI_assert, and data_.
|
inline |
Return a reference to the last element in the array. This invokes undefined behavior when the array is empty.
Definition at line 283 of file BLI_array.hh.
References BLI_assert, and data_.
|
inline |
Definition at line 228 of file BLI_array.hh.
|
inline |
Definition at line 240 of file BLI_array.hh.
References data_.
|
inline |
Definition at line 223 of file BLI_array.hh.
|
inline |
Definition at line 234 of file BLI_array.hh.
References data_.
|
inlinenoexcept |
Definition at line 204 of file BLI_array.hh.
References blender::move_assign_container().
|
inline |
Definition at line 199 of file BLI_array.hh.
References blender::copy_assign_container().
|
inline |
Definition at line 209 of file BLI_array.hh.
References BLI_assert, and data_.
|
inline |
Definition at line 216 of file BLI_array.hh.
References BLI_assert, and data_.
|
inline |
Definition at line 324 of file BLI_array.hh.
References blender::Array< T, InlineBufferCapacity, Allocator >::end().
|
inline |
Definition at line 333 of file BLI_array.hh.
References blender::Array< T, InlineBufferCapacity, Allocator >::end().
|
inline |
Destruct values and create a new array of the given size. The values in the new array are default constructed.
Definition at line 384 of file BLI_array.hh.
References BLI_assert, data_, blender::default_construct_n(), blender::destruct_n(), and T.
|
inline |
Definition at line 328 of file BLI_array.hh.
References blender::Array< T, InlineBufferCapacity, Allocator >::begin().
|
inline |
Definition at line 337 of file BLI_array.hh.
References blender::Array< T, InlineBufferCapacity, Allocator >::begin().
|
inline |
Returns the number of elements in the array.
Definition at line 258 of file BLI_array.hh.
Referenced by InstancesComponent::almost_unique_ids(), blender::nodes::get_geometry_element_ids_as_uints(), blender::meshintersect::get_output_face_index(), blender::fn::GVectorArray::size(), and blender::tests::TEST().