|
Blender V5.3
|
#include <BLI_generic_array.hh>
Public Member Functions | |
| GArray (Allocator allocator={}) noexcept | |
| GArray (NoExceptConstructor, Allocator allocator={}) noexcept | |
| GArray (const CPPType &type, int64_t size, Allocator allocator={}) | |
| GArray (const CPPType &type, const int64_t size, NoInitialization, Allocator allocator={}) | |
| GArray (const CPPType &type, Allocator allocator={}) | |
| GArray (const CPPType &type, void *buffer, int64_t size, Allocator allocator={}) | |
| GArray (const GSpan span, Allocator allocator={}) | |
| GArray (const GArray &other) | |
| GArray (GArray &&other) | |
| ~GArray () | |
| GArray & | operator= (const GArray &other) |
| GArray & | operator= (GArray &&other) |
| const CPPType & | type () const |
| bool | is_empty () const |
| int64_t | size () const |
| const void * | data () const |
| void * | data () |
| const void * | operator[] (int64_t index) const |
| void * | operator[] (int64_t index) |
| operator GSpan () const | |
| operator GMutableSpan () | |
| GSpan | as_span () const |
| GMutableSpan | as_mutable_span () |
| Allocator & | allocator () |
| const Allocator & | allocator () const |
| void | reinitialize (const int64_t new_size) |
Protected Attributes | |
| const CPPType * | type_ = nullptr |
| void * | data_ = nullptr |
| int64_t | size_ = 0 |
| BLI_NO_UNIQUE_ADDRESS Allocator | allocator_ |
| Allocator | The allocator used by this array. Should rarely be changed, except when you don't want that MEM_* functions are used internally. |
Definition at line 30 of file BLI_generic_array.hh.
|
inlinenoexcept |
The default constructor creates an empty array, the only situation in which the type is allowed to be null. This default constructor exists so GArray can be used in containers, but the type should be supplied before doing anything else to the array.
Definition at line 48 of file BLI_generic_array.hh.
References allocator().
Referenced by blender::nodes::compute_attributes_to_store(), GArray(), GArray(), blender::nodes::node_geo_rasterize_points::node_geo_exec(), operator=(), operator=(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::tests::TEST_F(), and blender::vpaint_init_vpaint().
|
inlinenoexcept |
Definition at line 50 of file BLI_generic_array.hh.
References allocator().
|
inline |
Create and allocate a new array, with elements default constructed (which does not do anything for trivial types).
Definition at line 56 of file BLI_generic_array.hh.
References allocator(), size(), and type().
|
inline |
Definition at line 62 of file BLI_generic_array.hh.
References allocator(), size(), and type().
|
inline |
Create an empty array with just a type.
Definition at line 76 of file BLI_generic_array.hh.
References allocator(), and type().
|
inline |
Take ownership of a buffer with a provided size. The buffer should be allocated with the same allocator provided to the constructor.
Definition at line 85 of file BLI_generic_array.hh.
References allocator(), size(), and type().
|
inline |
Create an array by copying values from a generic span.
Definition at line 99 of file BLI_generic_array.hh.
References allocator().
|
inline |
Create an array by copying values from another generic array.
Definition at line 108 of file BLI_generic_array.hh.
References allocator(), as_span(), and GArray().
|
inline |
Create an array by taking ownership of another array's data, clearing the data in the other.
Definition at line 113 of file BLI_generic_array.hh.
References allocator_, data_, GArray(), size_, and type_.
|
inline |
Definition at line 120 of file BLI_generic_array.hh.
References data_, blender::CPPType::destruct_n(), size_, and type_.
|
inline |
|
inline |
Definition at line 210 of file BLI_generic_array.hh.
References allocator_.
|
inline |
Definition at line 198 of file BLI_generic_array.hh.
Referenced by blender::nodes::compute_attributes_to_store(), blender::bke::bake::deserialize_value_list(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::tests::TEST_F(), blender::tests::TEST_F(), and blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes().
|
inline |
Definition at line 193 of file BLI_generic_array.hh.
Referenced by blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), GArray(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::bke::mesh_apply_spatial_organization(), blender::bke::sample_corner_attributes(), blender::tests::TEST_F(), and blender::tests::TEST_F().
|
inline |
Definition at line 164 of file BLI_generic_array.hh.
References data_.
|
inline |
Get a pointer to the beginning of the array.
Definition at line 160 of file BLI_generic_array.hh.
References data_.
Referenced by blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::ed::geometry::convert_attribute(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::nodes::GList::ArrayData::span_for_write(), blender::tests::TEST_F(), blender::tests::TEST_F(), and blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes().
|
inline |
Definition at line 144 of file BLI_generic_array.hh.
References size_.
Referenced by blender::tests::TEST_F(), and blender::tests::TEST_F().
|
inline |
Definition at line 187 of file BLI_generic_array.hh.
References blender::BLI_assert(), data_, blender::GMutableSpan::GMutableSpan(), size_, and type_.
|
inline |
Definition at line 181 of file BLI_generic_array.hh.
References blender::BLI_assert(), data_, blender::GSpan::GSpan(), size_, and type_.
|
inline |
Definition at line 128 of file BLI_generic_array.hh.
References blender::copy_assign_container(), and GArray().
|
inline |
Definition at line 133 of file BLI_generic_array.hh.
References GArray(), and blender::move_assign_container().
|
inline |
Definition at line 175 of file BLI_generic_array.hh.
References blender::BLI_assert(), data_, POINTER_OFFSET, blender::CPPType::size, size_, and type_.
|
inline |
Definition at line 169 of file BLI_generic_array.hh.
References blender::BLI_assert(), data_, POINTER_OFFSET, blender::CPPType::size, size_, and type_.
|
inline |
Destruct values and create a new array of the given size. The values in the new array are default constructed.
Definition at line 219 of file BLI_generic_array.hh.
References blender::BLI_assert(), data_, blender::CPPType::default_construct_n(), blender::CPPType::destruct_n(), size_, and type_.
Referenced by blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call().
|
inline |
Return the number of elements in the array (not the size in bytes).
Definition at line 152 of file BLI_generic_array.hh.
References size_.
Referenced by GArray(), GArray(), GArray(), blender::bke::sample_corner_attributes(), blender::tests::TEST_F(), and blender::tests::TEST_F().
|
inline |
Definition at line 138 of file BLI_generic_array.hh.
References blender::BLI_assert(), and type_.
Referenced by GArray(), GArray(), GArray(), GArray(), and blender::tests::TEST_F().
|
protected |
Definition at line 40 of file BLI_generic_array.hh.
Referenced by allocator(), allocator(), and GArray().
|
protected |
Definition at line 37 of file BLI_generic_array.hh.
Referenced by data(), data(), GArray(), operator GMutableSpan(), operator GSpan(), operator[](), operator[](), reinitialize(), and ~GArray().
|
protected |
Definition at line 38 of file BLI_generic_array.hh.
Referenced by GArray(), is_empty(), operator GMutableSpan(), operator GSpan(), operator[](), operator[](), reinitialize(), size(), and ~GArray().
|
protected |
The type of the data in the array, will be null after the array is default constructed, but a value should be assigned before any other interaction with the array.
Definition at line 36 of file BLI_generic_array.hh.
Referenced by GArray(), operator GMutableSpan(), operator GSpan(), operator[](), operator[](), reinitialize(), type(), and ~GArray().