|
Blender V5.0
|
#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, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| Array (Span< U > values, Allocator allocator={}) | |
| template<typename U, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| 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, BLI_ENABLE_IF((is_span_convertible_pointer_v< T, U >))> | |
| operator Span< U > () const | |
| template<typename U, BLI_ENABLE_IF((is_span_convertible_pointer_v< T, U >))> | |
| 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 & | first () const |
| T & | first () |
| const T & | last (const int64_t n=0) const |
| T & | last (const int64_t n=0) |
| const T * | data () const |
| T * | data () |
| const T * | begin () const |
| T * | begin () |
| const T * | end () const |
| T * | end () |
| std::reverse_iterator< T * > | rbegin () |
| std::reverse_iterator< const T * > | rbegin () const |
| std::reverse_iterator< T * > | rend () |
| std::reverse_iterator< const T * > | rend () const |
| IndexRange | index_range () const |
| uint64_t | hash () const |
| void | clear_without_destruct () |
| Allocator & | allocator () |
| const Allocator & | allocator () const |
| void | reinitialize (const int64_t new_size) |
Static Public Member Functions | |
| static uint64_t | hash_as (const Span< T > values) |
| static int64_t | inline_buffer_capacity () |
Friends | |
| bool | operator== (const Array &a, const Array &b) |
| bool | operator!= (const Array &a, const Array &b) |
| T | The type of the values stored in the array. |
| InlineBufferCapacity | The number of values that can be stored in the array, without doing a heap allocation. |
| 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 50 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_iterator = const T * |
Definition at line 58 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_pointer = const T * |
Definition at line 54 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::const_reference = const T & |
Definition at line 56 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::iterator = T * |
Definition at line 57 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::pointer = T * |
Definition at line 53 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::reference = T & |
Definition at line 55 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::size_type = int64_t |
Definition at line 59 of file BLI_array.hh.
| using blender::Array< T, InlineBufferCapacity, Allocator >::value_type = T |
Definition at line 52 of file BLI_array.hh.
|
inlinenoexcept |
By default an empty array is created.
Definition at line 78 of file BLI_array.hh.
|
inlinenoexcept |
Definition at line 84 of file BLI_array.hh.
|
inline |
Create a new array that contains copies of all values.
Definition at line 90 of file BLI_array.hh.
|
inline |
Create a new array that contains copies of all values.
Definition at line 102 of file BLI_array.hh.
|
inline |
Definition at line 107 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 120 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 131 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 159 of file BLI_array.hh.
|
inline |
Definition at line 167 of file BLI_array.hh.
|
inlinenoexcept |
Definition at line 169 of file BLI_array.hh.
|
inline |
Definition at line 191 of file BLI_array.hh.
|
inline |
Access the allocator used by this array.
Definition at line 397 of file BLI_array.hh.
|
inline |
Definition at line 401 of file BLI_array.hh.
|
inline |
Definition at line 248 of file BLI_array.hh.
Referenced by blender::ed::sculpt_paint::cloth::apply_grab_brush(), blender::ed::sculpt_paint::cloth::apply_snake_hook_brush(), blender::bke::node_structure_type_inferencing::calc_node_interface(), blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_grids(), IMB_byte_from_float(), blender::ed::sculpt_paint::mask::increase_contrast_mask_grids(), blender::ed::sculpt_paint::mask::scatter_mask_grids(), blender::ed::sculpt_paint::undo::store_face_sets(), blender::ed::sculpt_paint::undo::store_mask_grids(), blender::ed::sculpt_paint::undo::store_mask_mesh(), and blender::ed::sculpt_paint::expand::write_mask_data().
|
inline |
Definition at line 243 of file BLI_array.hh.
Referenced by BKE_mesh_legacy_convert_uvs_to_generic(), blender::ed::sculpt_paint::filter::calc_sharpen_filter(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_grids(), blender::ed::sculpt_paint::mask::gather_mask_grids(), blender::ed::sculpt_paint::mask::increase_contrast_mask_grids(), blender::geometry::lookup_tris_in_cell(), blender::ed::sculpt_paint::undo::node_size_in_bytes(), blender::ed::sculpt_paint::orig_face_set_data_lookup_grids(), blender::ed::sculpt_paint::orig_face_set_data_lookup_mesh(), blender::ed::sculpt_paint::orig_mask_data_lookup_grids(), blender::ed::sculpt_paint::orig_mask_data_lookup_mesh(), blender::ed::transform::pointcloud::recalcData_pointcloud(), blender::ed::sculpt_paint::undo::restore_mask_grids(), blender::ed::sculpt_paint::undo::restore_mask_mesh(), blender::ed::sculpt_paint::mask::sharpen_mask_grids(), blender::ed::sculpt_paint::mask::smooth_mask_grids(), blender::ed::sculpt_paint::undo::store_mask_grids(), blender::ed::sculpt_paint::undo::store_mask_mesh(), blender::ed::sculpt_paint::undo::store_positions_mesh(), and update_custom_knots().
|
inline |
Definition at line 330 of file BLI_array.hh.
|
inline |
Definition at line 321 of file BLI_array.hh.
Referenced by BKE_mesh_legacy_convert_polys_to_offsets(), and BKE_mesh_validate_arrays().
|
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 389 of file BLI_array.hh.
|
inline |
Definition at line 316 of file BLI_array.hh.
|
inline |
Get a pointer to the beginning of the array.
Definition at line 312 of file BLI_array.hh.
Referenced by BKE_mesh_validate_arrays(), BKE_sculptsession_free_vwpaint_data(), blendthumb_extract_from_file_impl(), do_weight_paint_vertex_multi(), do_weight_paint_vertex_single(), CBlendThumb::GetThumbnail(), IMB_byte_from_float(), blender::ed::sculpt_paint::vwpaint::init_session_data(), knife_bvh_raycast_cb(), knife_find_line_hits(), RE_bake_pixels_populate_from_objects(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), UI_searchbox_size_x_guess(), and wpaint_stroke_test_start().
|
inline |
Definition at line 334 of file BLI_array.hh.
|
inline |
Definition at line 325 of file BLI_array.hh.
Referenced by BKE_mesh_legacy_convert_polys_to_offsets(), and BKE_mesh_validate_arrays().
|
inline |
Copies the given value to every element in the array.
Definition at line 272 of file BLI_array.hh.
Referenced by blender::bke::pbvh::uv_islands::mesh_data_init_primitive_uv_island_ids(), blender::ed::sculpt_paint::undo::store_face_sets(), blender::ed::sculpt_paint::undo::store_mask_grids(), blender::ed::sculpt_paint::undo::store_mask_mesh(), blender::ed::sculpt_paint::expand::topology_from_state_boundary(), and vpaint_proj_dm_map_cosnos_update().
|
inline |
Definition at line 286 of file BLI_array.hh.
|
inline |
Return a reference to the first element in the array. This invokes undefined behavior when the array is empty.
Definition at line 281 of file BLI_array.hh.
Referenced by blender::draw::discard_buffers(), M_Geometry_delaunay_2d_cdt(), blender::meshintersect::operator<<(), and blender::geometry::preprocess_meshes().
|
inline |
Definition at line 365 of file BLI_array.hh.
|
inlinestatic |
Definition at line 370 of file BLI_array.hh.
|
inline |
Get an index range containing all valid indices for this array.
Definition at line 360 of file BLI_array.hh.
Referenced by apply_weights_vertex_normal(), BKE_mesh_legacy_convert_polys_to_offsets(), BKE_mesh_legacy_convert_uvs_to_generic(), BKE_subdiv_ccg_average_grids(), BKE_subdiv_ccg_average_stitch_faces(), blender::bke::compare_geometry::compare_curves(), blender::draw::create_material_subranges(), blender::draw::discard_buffers(), grease_pencil_evaluate_layers(), blender::geometry::initialize_curves_builtin_attribute_defaults(), M_Geometry_delaunay_2d_cdt(), blender::bke::mesh_apply_spatial_organization(), blender::draw::mesh_batch_cache_clear(), blender::meshintersect::operator<<(), blender::ed::sculpt_paint::undo::restore_vert_visibility_mesh(), and ui_searchbox_size_x_from_items().
|
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 410 of file BLI_array.hh.
|
inline |
Returns true when the number of elements in the array is zero.
Definition at line 264 of file BLI_array.hh.
Referenced by BKE_editmesh_looptris_calc_with_partial_ex(), BKE_editmesh_orco_tangents_calc(), BKE_editmesh_uv_tangents_calc(), BKE_sculptsession_free_vwpaint_data(), blendthumb_create_png_data_from_thumb(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::draw::discard_buffers(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::mask::duplicate_mask(), blender::draw::extract_tris_subdiv(), blender::ed::sculpt_paint::fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::mask::fill_mask_grids(), blender::ed::sculpt_paint::mask::gather_mask_grids(), blender::ed::sculpt_paint::boundary::init_falloff_grids(), blender::ed::sculpt_paint::vwpaint::init_session_data(), blender::geometry::lookup_tris_in_cell(), blender::bke::mesh_apply_spatial_organization(), blender::draw::mesh_render_data_loose_geom_ensure(), blender::draw::overlay::Sculpts::mesh_sync(), multires_reshape_assign_final_coords_from_ccg(), SCULPT_fake_neighbors_ensure(), blender::ed::sculpt_paint::sculpt_geometry_preview_lines_draw(), blender::ed::sculpt_paint::undo::store_mask_grids(), blender::bke::subdiv::subdiv_to_mesh(), blender::bke::pbvh::update_mask_grids(), blender::ed::sculpt_paint::islands::vert_id_get(), blender::ed::sculpt_paint::expand::vert_to_face_falloff(), and wpaint_stroke_test_start().
|
inline |
Definition at line 302 of file BLI_array.hh.
|
inline |
Return a reference to the nth last element. This invokes undefined behavior when the array is too short.
Definition at line 296 of file BLI_array.hh.
Referenced by blender::bke::curve_to_mesh_sweep().
|
inline |
Definition at line 226 of file BLI_array.hh.
|
inline |
Definition at line 238 of file BLI_array.hh.
|
inline |
Definition at line 221 of file BLI_array.hh.
|
inline |
Definition at line 232 of file BLI_array.hh.
|
inlinenoexcept |
Definition at line 202 of file BLI_array.hh.
|
inline |
Definition at line 197 of file BLI_array.hh.
|
inline |
Definition at line 207 of file BLI_array.hh.
|
inline |
Definition at line 214 of file BLI_array.hh.
|
inline |
Definition at line 339 of file BLI_array.hh.
|
inline |
Definition at line 348 of file BLI_array.hh.
|
inline |
Destruct values and create a new array of the given size. The values in the new array are default constructed.
Definition at line 419 of file BLI_array.hh.
Referenced by apply_weights_vertex_normal(), BKE_editmesh_looptris_calc_ex(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_pbvh_bmesh_node_save_orig(), blender::bke::node_structure_type_inferencing::calc_node_interface(), context_init_lookup(), blender::ed::transform::pointcloud::createTransPointCloudVerts(), ED_vpaint_proj_handle_create(), blender::ed::sculpt_paint::undo::fill_node_data_grids(), blender::ed::sculpt_paint::undo::fill_node_data_mesh(), blender::bke::get_armature_deform_params(), blender::get_pattern_info(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), handle_curves_knot_mode(), knifetool_init(), blender::draw::mesh_batch_cache_init(), blender::bke::pbvh::uv_islands::mesh_data_init_primitive_uv_island_ids(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), op_generic_value_invoke(), pose_slide_init(), blender::geometry::preprocess_grease_pencils(), blender::geometry::preprocess_meshes(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::ed::sculpt_paint::expand::topology_from_state_boundary(), um_arraystore_cd_compact(), blender::ed::sculpt_paint::expand::vert_to_face_falloff(), and blender::geometry::weld_mesh_context_create().
|
inline |
Definition at line 343 of file BLI_array.hh.
|
inline |
Definition at line 352 of file BLI_array.hh.
|
inline |
Returns the number of elements in the array.
Definition at line 256 of file BLI_array.hh.
Referenced by BKE_editmesh_looptris_calc_with_partial_ex(), BKE_editmesh_orco_tangents_calc(), BKE_editmesh_uv_tangents_calc(), BKE_mesh_validate_arrays(), BKE_sculptsession_free_vwpaint_data(), calc_face_as_quad_map(), blender::ed::transform::createTransEditVerts(), blender::ed::sculpt_paint::undo::fill_node_data_grids(), blender::ed::sculpt_paint::undo::fill_node_data_mesh(), grease_pencil_initialize_drawing_user_counts_after_read(), IMB_byte_from_float(), blender::ed::sculpt_paint::vwpaint::init_session_data(), knife_bvh_init(), knife_bvh_raycast_cb(), knife_find_line_hits(), knife_ray_intersect_face(), knifetool_init_obinfo(), M_Geometry_delaunay_2d_cdt(), blender::bke::mesh_apply_spatial_organization(), blender::draw::mesh_render_data_update_loose_geom(), blender::meshintersect::operator<<(), blender::ed::sculpt_paint::undo::restore_position_mesh(), blender::ed::sculpt_paint::sculpt_geometry_preview_lines_draw(), stats_object_edit(), um_arraystore_cd_expand(), um_arraystore_cd_free(), and uvprojectModifier_do().
|
friend |
Definition at line 380 of file BLI_array.hh.
|
friend |
Definition at line 375 of file BLI_array.hh.