|
Blender V5.0
|
#include <BLI_vector.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 |
| using | allocator_type = Allocator |
Public Member Functions | |
| Vector (Allocator allocator={}) noexcept | |
| Vector (NoExceptConstructor, Allocator allocator={}) noexcept | |
| Vector (int64_t size, Allocator allocator={}) | |
| Vector (int64_t size, const T &value, Allocator allocator={}) | |
| template<typename U, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| Vector (Span< U > values, Allocator allocator={}) | |
| template<typename U, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| Vector (MutableSpan< U > values, Allocator allocator={}) | |
| template<typename U, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| Vector (const std::initializer_list< U > &values) | |
| Vector (const std::initializer_list< T > &values) | |
| template<typename U, size_t N, BLI_ENABLE_IF((std::is_convertible_v< U, T >))> | |
| Vector (const std::array< U, N > &values) | |
| template<typename InputIt, BLI_ENABLE_IF((!std::is_convertible_v< InputIt, int >))> | |
| Vector (InputIt first, InputIt last, Allocator allocator={}) | |
| Vector (const Vector &other) | |
| template<int64_t OtherInlineBufferCapacity> | |
| Vector (const Vector< T, OtherInlineBufferCapacity, Allocator > &other) | |
| template<int64_t OtherInlineBufferCapacity> | |
| Vector (Vector< T, OtherInlineBufferCapacity, Allocator > &&other) noexcept(is_nothrow_move_constructible()) | |
| Vector (const VectorData< T, Allocator > &data) | |
| ~Vector () | |
| Vector & | operator= (const Vector &other) |
| Vector & | operator= (Vector &&other) |
| const T & | operator[] (int64_t index) const |
| T & | operator[] (int64_t index) |
| 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 () |
| void | reserve (const int64_t min_capacity) |
| void | resize (const int64_t new_size) |
| void | resize (const int64_t new_size, const T &value) |
| void | reinitialize (const int64_t new_size) |
| void | clear () |
| void | clear_and_shrink () |
| void | append (const T &value) |
| void | append (T &&value) |
| template<typename... ForwardValue> | |
| void | append_as (ForwardValue &&...value) |
| int64_t | append_and_get_index (const T &value) |
| int64_t | append_and_get_index (T &&value) |
| template<typename... ForwardValue> | |
| int64_t | append_and_get_index_as (ForwardValue &&...value) |
| void | append_non_duplicates (const T &value) |
| void | append_unchecked (const T &value) |
| void | append_unchecked (T &&value) |
| template<typename... ForwardT> | |
| void | append_unchecked_as (ForwardT &&...value) |
| void | append_n_times (const T &value, const int64_t n) |
| void | increase_size_by_unchecked (const int64_t n) noexcept |
| void | extend (Span< T > array) |
| void | extend (const T *start, int64_t amount) |
| template<int64_t OtherInlineBufferCapacity> | |
| void | extend (Vector< T, OtherInlineBufferCapacity, Allocator > &&other) |
| template<typename InputIt> | |
| void | extend (InputIt first, InputIt last) |
| void | extend_non_duplicates (Span< T > array) |
| void | extend_unchecked (Span< T > array) |
| void | extend_unchecked (const T *start, int64_t amount) |
| void | insert (const int64_t insert_index, const T &value) |
| void | insert (const int64_t insert_index, T &&value) |
| void | insert (const int64_t insert_index, Span< T > array) |
| template<typename InputIt> | |
| void | insert (const T *insert_position, InputIt first, InputIt last) |
| template<typename InputIt> | |
| void | insert (const int64_t insert_index, InputIt first, InputIt last) |
| void | prepend (const T &value) |
| void | prepend (T &&value) |
| void | prepend (Span< T > values) |
| template<typename InputIt> | |
| void | prepend (InputIt first, InputIt last) |
| const T & | last (const int64_t n=0) const |
| T & | last (const int64_t n=0) |
| const T & | first () const |
| T & | first () |
| int64_t | size () const |
| bool | is_empty () const |
| void | remove_last () |
| T | pop_last () |
| void | remove_and_reorder (const int64_t index) |
| void | remove_first_occurrence_and_reorder (const T &value) |
| void | remove (const int64_t index) |
| void | remove (const int64_t start_index, const int64_t amount) |
| template<typename Predicate> | |
| int64_t | remove_if (Predicate &&predicate) |
| int64_t | first_index_of_try (const T &value) const |
| int64_t | first_index_of (const T &value) const |
| bool | contains (const T &value) const |
| void | fill (const T &value) const |
| T * | data () |
| const T * | data () const |
| T * | begin () |
| const T * | begin () const |
| T * | end () |
| const T * | end () const |
| std::reverse_iterator< T * > | rbegin () |
| std::reverse_iterator< const T * > | rbegin () const |
| std::reverse_iterator< T * > | rend () |
| std::reverse_iterator< const T * > | rend () const |
| int64_t | capacity () const |
| bool | is_at_capacity () const |
| IndexRange | index_range () const |
| uint64_t | hash () const |
| VectorData< T, Allocator > | release () |
| void | print_stats (const char *name) const |
| bool | is_inline () const |
Static Public Member Functions | |
| static uint64_t | hash_as (const Span< T > values) |
Friends | |
| template<typename OtherT, int64_t OtherInlineBufferCapacity, typename OtherAllocator> | |
| class | Vector |
| bool | operator== (const Vector &a, const Vector &b) |
| bool | operator!= (const Vector &a, const Vector &b) |
| T | Type of the values stored in this vector. It has to be movable. |
| InlineBufferCapacity | The number of values that can be stored in this vector, without doing a heap allocation. Sometimes it makes sense to increase this value a lot. The memory in the inline buffer is not initialized when it is not needed. |
When T is large, the small buffer optimization is disabled by default to avoid large unexpected allocations on the stack. It can still be enabled explicitly though.
| Allocator | The allocator used by this vector. Should rarely be changed, except when you don't want that MEM_* is used internally. |
Definition at line 76 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::allocator_type = Allocator |
Definition at line 86 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::const_iterator = const T * |
Definition at line 84 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::const_pointer = const T * |
Definition at line 80 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::const_reference = const T & |
Definition at line 82 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::iterator = T * |
Definition at line 83 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::pointer = T * |
Definition at line 79 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::reference = T & |
Definition at line 81 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::size_type = int64_t |
Definition at line 85 of file BLI_vector.hh.
| using blender::Vector< T, InlineBufferCapacity, Allocator >::value_type = T |
Definition at line 78 of file BLI_vector.hh.
|
inlinenoexcept |
Create an empty vector. This does not do any memory allocation.
Definition at line 140 of file BLI_vector.hh.
|
inlinenoexcept |
Definition at line 148 of file BLI_vector.hh.
|
inlineexplicit |
Create a vector with a specific size. The elements will be default constructed. If T is trivially constructible, the elements in the vector are not touched.
Definition at line 155 of file BLI_vector.hh.
|
inline |
Create a vector filled with a specific value.
Definition at line 164 of file BLI_vector.hh.
|
inline |
Create a vector from a span. The values in the vector are copy constructed.
Definition at line 174 of file BLI_vector.hh.
|
inlineexplicit |
Definition at line 183 of file BLI_vector.hh.
|
inline |
Create a vector that contains copies of the values in the initialized list.
This allows you to write code like: Vector<int> vec = {3, 4, 5};
Definition at line 195 of file BLI_vector.hh.
|
inline |
Definition at line 199 of file BLI_vector.hh.
|
inline |
Definition at line 202 of file BLI_vector.hh.
|
inline |
Definition at line 210 of file BLI_vector.hh.
|
inline |
Create a copy of another vector. The other vector will not be changed. If the other vector has less than InlineBufferCapacity elements, no allocation will be made.
Definition at line 222 of file BLI_vector.hh.
|
inline |
Create a copy of a vector with a different InlineBufferCapacity. This needs to be handled separately, so that the other one is a valid copy constructor.
Definition at line 229 of file BLI_vector.hh.
|
inlinenoexcept |
Steal the elements from another vector. This does not do an allocation. The other vector will have zero elements afterwards.
Definition at line 239 of file BLI_vector.hh.
|
inline |
Initializes the Vector from an existing buffer. The Vector takes ownership of the buffer. The caller is responsible to make sure that the buffer has been allocated with the same allocator that the Vector will use to deallocate it.
Definition at line 307 of file BLI_vector.hh.
|
inline |
Definition at line 323 of file BLI_vector.hh.
|
inline |
Insert a new element at the end of the vector. This might cause a reallocation with the capacity is exceeded.
This is similar to std::vector::push_back.
Definition at line 489 of file BLI_vector.hh.
Referenced by blender::deg::sync_writeback::add(), blender::bke::pbvh::uv_islands::add_primitive(), blender::nodes::DeclarationListBuilder::add_socket(), blender::Vector< SubdivCCGCoord, 256 >::append_non_duplicates(), BKE_blendfile_link_append_context_library_add(), blf_glyph_cache_new(), bm_log_face_alloc(), bm_log_vert_alloc(), blender::nodes::gizmos::build_tree_gizmo_propagation(), blender::io::usd::call_import_hooks(), CTX_store_add(), CTX_store_add(), CTX_store_add(), CTX_store_add_all(), draw_fcurve_curve_keys(), blender::ed::space_node::draw_node_socket_batch(), blender::seq::RetimingRange::duplicate(), ED_mesh_shapes_join_objects_exec(), ED_view3d_camera_autokey(), blender::ed::space_node::ensure_nodetree_previews(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_grease_pencil_tasks(), blender::geometry::execute_realize_mesh_tasks(), blender::geometry::execute_realize_pointcloud_tasks(), blender::io::obj::geom_add_curve_parameters(), blender::nodes::geo_eval_log::GeometryInfoLog::GeometryInfoLog(), blender::nodes::get_compositor_group_input_extra_info(), blender::nodes::get_compositor_group_output_extra_info(), blender::nodes::tests::NodeTest::get_node_trees(), gpu_shader_create_info_compile(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), grease_pencil_do_layer_adjustments(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), imb_exr_get_pass(), blender::ui::LayoutInternal::init_from_parent(), blender::ui::LayoutInternal::layout_add_but(), libblock_relink_to_newid_prepare_data(), lineart_bake_common(), blender::io::ply::load_plydata(), menu_items_from_ui_create(), MOD_lineart_gpencil_generate_v3(), blender::nodes::node_composite_cryptomatte_cc::node_extra_info(), blender::nodes::node_composite_file_output_cc::node_extra_info(), blender::nodes::node_composite_render_layer_cc::node_extra_info(), blender::seq::RetimingRange::operator*(), partial_elem_face_ensure(), partial_elem_vert_ensure(), blender::ed::space_node::pick_link(), pyrna_py_to_prop(), raycast_callback(), RE_RenderAnim(), remove_in_and_out_node_panel_recursive(), screen_opengl_render_anim_init(), blender::ed::space_node::shader_preview_startjob(), blender::ed::object::bake_simulation::simulate_to_frame_invoke(), blender::gpu::Shader::specialization_constants_init(), sph_force_cb(), blender::ed::sculpt_paint::undo::store_color(), ui_block_new_button_group(), ui_button_group_add_but(), ui_def_but(), ui_rna_collection_search_update_fn(), UI_text_clip_multiline_middle(), blender::bke::node_tree_runtime::update_link_vector(), blender::bke::node_tree_runtime::update_node_vector(), blender::bke::node_tree_runtime::update_root_frames(), version_geometry_nodes_extrude_smooth_propagation(), and WM_drag_create_path_data().
|
inline |
Definition at line 493 of file BLI_vector.hh.
|
inline |
Append the value to the vector and return the index that can be used to access the newly added value.
Definition at line 508 of file BLI_vector.hh.
Referenced by blender::bke::node_tree_runtime::update_socket_vectors_and_owner_node().
|
inline |
Definition at line 512 of file BLI_vector.hh.
|
inline |
Definition at line 516 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append_and_get_index(), and blender::Vector< SubdivCCGCoord, 256 >::append_and_get_index().
|
inline |
Definition at line 498 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append(), blender::Vector< SubdivCCGCoord, 256 >::append(), blender::Vector< SubdivCCGCoord, 256 >::append_and_get_index_as(), IMB_exr_add_channels(), and imb_exr_get_layer().
|
inline |
Insert the same element n times at the end of the vector. This might result in a reallocation internally.
Definition at line 560 of file BLI_vector.hh.
|
inline |
Append the value if it is not yet in the vector. This has to do a linear search to check if the value is in the vector. Therefore, this should only be called when it is known that the vector is small.
Definition at line 528 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::extend_non_duplicates(), and blender::bke::pbvh::uv_islands::uv_primitive_append_to_uv_edges().
|
inline |
Append the value and assume that vector has enough memory reserved. This invokes undefined behavior when not enough capacity has been reserved beforehand. Only use this in performance critical code.
Definition at line 540 of file BLI_vector.hh.
Referenced by blender::io::ply::load_plydata().
|
inline |
Definition at line 544 of file BLI_vector.hh.
|
inline |
Definition at line 548 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append_as(), blender::Vector< SubdivCCGCoord, 256 >::append_unchecked(), and blender::Vector< SubdivCCGCoord, 256 >::append_unchecked().
|
inline |
Definition at line 386 of file BLI_vector.hh.
Referenced by blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), and blender::ed::sculpt_paint::mask::update_mask_mesh().
|
inline |
Definition at line 381 of file BLI_vector.hh.
Referenced by find_all_ranges_test(), blender::Vector< SubdivCCGCoord, 256 >::hash(), insert_key(), blender::ed::sculpt_paint::undo::node_size_in_bytes(), blender::ed::sculpt_paint::mask::update_mask_mesh(), and WM_drag_get_paths().
|
inline |
Definition at line 958 of file BLI_vector.hh.
Referenced by menu_items_from_ui_create(), prepare_linehits_for_cut(), ui_block_bounds_calc_text(), ui_button_group_replace_but_ptr(), and ui_rna_collection_search_update_fn().
|
inline |
Definition at line 967 of file BLI_vector.hh.
|
inline |
Get the current capacity of the vector, i.e. the maximum number of elements the vector can hold, before it has to reallocate.
Definition at line 998 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::reserve().
|
inline |
Afterwards the vector has 0 elements, but will still have memory to be refilled again.
Definition at line 459 of file BLI_vector.hh.
Referenced by deg_flush_updates_and_refresh(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::space_node::link_drag_search_update_fn(), blender::ed::space_node::nodesocket_cache_flush(), blender::ed::space_node::shader_preview_free(), blender::LinearAllocator< Allocator >::transfer_ownership_from(), UI_block_free(), ui_multibut_states_apply(), ui_selectcontext_end(), blender::bke::node_tree_runtime::update_link_vector(), blender::bke::node_tree_runtime::update_node_vector(), blender::bke::node_tree_runtime::update_root_frames(), and blender::bke::node_tree_runtime::update_socket_vectors_and_owner_node().
|
inline |
Afterwards the vector has 0 elements and any allocated memory will be freed.
Definition at line 470 of file BLI_vector.hh.
Referenced by blf_glyph_cache_clear(), knife_add_cut(), knife_find_line_hits(), knife_finish_cut(), psys_sph_flush_springs(), re_movie_free_all(), screen_opengl_render_end(), and UI_block_update_from_old().
|
inline |
Do a linear search to see of the value is in the vector. Return true when it exists, otherwise false.
Definition at line 929 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append_non_duplicates(), blender::draw::edit_select::Instance::object_sync(), blender::animrig::nla::tests::TEST_F(), blender::animrig::nla::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
inline |
Get access to the underlying array.
Definition at line 945 of file BLI_vector.hh.
Referenced by BLI_expr_pylike_eval(), bm_mesh_calc_tessellation_with_partial__multi_threaded(), bm_mesh_calc_tessellation_with_partial__single_threaded(), do_write_image_or_movie(), Equal(), blender::gpu::VKPipelinePool::get_or_create_graphics_pipeline(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), operator*(), operator*(), operator*(), operator+(), operator-(), operator-(), operator/(), blender::gpu::render_graph::VKViewportData::operator==(), blender::gpu::VKGraphicsInfo::FragmentOut::operator==(), operator==(), blender::gpu::read_spirv_from_disk(), blender::draw::test_draw_curves_interpolate_attributes(), blender::draw::test_draw_curves_interpolate_position(), blender::io::ply::TEST_F(), blender::io::ply::TEST_F(), UI_text_clip_multiline_middle(), blender::io::ply::write_faces(), and write_result().
|
inline |
Get access to the underlying array.
Definition at line 953 of file BLI_vector.hh.
|
inline |
Definition at line 962 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::extend(), prepare_linehits_for_cut(), blender::Vector< SubdivCCGCoord, 256 >::rbegin(), blender::Vector< SubdivCCGCoord, 256 >::rbegin(), blender::Vector< SubdivCCGCoord, 256 >::remove_if(), ui_block_bounds_calc_text(), ui_button_group_replace_but_ptr(), and ui_rna_collection_search_update_fn().
|
inline |
Definition at line 971 of file BLI_vector.hh.
|
inline |
Definition at line 590 of file BLI_vector.hh.
|
inline |
Definition at line 641 of file BLI_vector.hh.
|
inline |
Copy the elements of another array to the end of this vector.
This can be used to emulate parts of std::vector::insert.
Definition at line 586 of file BLI_vector.hh.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), blender::Vector< SubdivCCGCoord, 256 >::extend(), blender::Vector< SubdivCCGCoord, 256 >::extend(), remove_in_and_out_node_panel_recursive(), and UI_menutype_draw().
|
inline |
Moves the elements of another vector to the end of this vector.
This may result in reallocation to fit other vector elements, other vector will keep it buffer allocation, but it will become empty. This can be used in vectors that manages resources, allowing acquiring resources from another vector, preventing shared ownership of managed resources.
Definition at line 605 of file BLI_vector.hh.
|
inline |
Adds all elements from the array that are not already in the vector. This is an expensive operation when the vector is large, but can be very cheap when it is known that the vector is small.
Definition at line 617 of file BLI_vector.hh.
|
inline |
Definition at line 632 of file BLI_vector.hh.
|
inline |
Extend the vector without bounds checking. It is assumed that enough memory has been reserved beforehand. Only use this in performance critical code.
Definition at line 628 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::extend(), and blender::Vector< SubdivCCGCoord, 256 >::extend_unchecked().
|
inline |
Copies the given value to every element in the vector.
Definition at line 937 of file BLI_vector.hh.
|
inline |
Definition at line 762 of file BLI_vector.hh.
|
inline |
Return a reference to the first element in the vector. This invokes undefined behavior when the vector is empty.
Definition at line 757 of file BLI_vector.hh.
Referenced by blender::ed::greasepencil::clipboard_materials_remap(), GPUPass::finalize_compilation(), imb_exr_get_pass(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::space_node::node_displace_existing_links(), blender::ed::space_node::node_link_modal(), and blender::ed::space_node::prepare_viewlayer_update().
|
inline |
Do a linear search to find the value in the vector and return the found index. This invokes undefined behavior when the value is not in the vector.
Definition at line 918 of file BLI_vector.hh.
Referenced by find_new_properties_tab(), and blender::Vector< SubdivCCGCoord, 256 >::remove_first_occurrence_and_reorder().
|
inline |
Do a linear search to find the value in the vector. When found, return the first index, otherwise return -1.
Definition at line 904 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::contains(), DRW_select_buffer_elem_get(), find_new_properties_tab(), blender::Vector< SubdivCCGCoord, 256 >::first_index_of(), and knife_find_closest_face().
|
inline |
Definition at line 1022 of file BLI_vector.hh.
Referenced by blender::gpu::VKGraphicsInfo::VertexIn::operator==().
|
inlinestatic |
Definition at line 1027 of file BLI_vector.hh.
|
inlinenoexcept |
Enlarges the size of the internal buffer that is considered to be initialized. This invokes undefined behavior when the new size is larger than the capacity. The method can be useful when you want to call constructors in the vector yourself. This should only be done in very rare cases and has to be justified every time.
Definition at line 574 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append_n_times().
|
inline |
Get an index range that makes looping over all indices more convenient and less error prone. Obviously, this should only be used when you actually need the index in the loop.
Example: for (int64_t i : myvector.index_range()) { do_something(i, my_vector[i]); }
Definition at line 1017 of file BLI_vector.hh.
Referenced by BKE_blendfile_link(), BM_mesh_normals_update_with_partial_ex(), blender::ed::greasepencil::clipboard_materials_remap(), blender::nodes::node_geo_string_to_curves_cc::create_attributes(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), EDBM_mesh_knife(), blender::bke::node_tree_runtime::ensure_topology_cache(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), guard_modifiers(), IMB_colormanagement_working_space_convert(), knife_bvh_init(), knifetool_finish_ex(), lineart_bake_endjob(), lineart_bake_startjob(), menu_items_from_ui_create(), MOD_lineart_gpencil_generate_v3(), blender::ed::sculpt_paint::move_last_point_and_resample(), ntree_exec_begin(), blender::gpu::populate_specialization_constant_values(), blender::eevee::SyncModule::sync_mesh(), ui_but_update_from_old_block(), ui_rna_collection_search_update_fn(), v3d_editvertex_buts(), and view3d_panel_curve_data().
|
inline |
Insert elements into the vector at the specified position. This has a running time of O(n) where n is the number of values that have to be moved. Undefined behavior is invoked when the insert position is out of bounds.
Definition at line 651 of file BLI_vector.hh.
|
inline |
Definition at line 669 of file BLI_vector.hh.
|
inline |
Definition at line 660 of file BLI_vector.hh.
|
inline |
Definition at line 655 of file BLI_vector.hh.
|
inline |
Definition at line 664 of file BLI_vector.hh.
|
inline |
Definition at line 1003 of file BLI_vector.hh.
|
inline |
Returns true when the vector contains no elements, otherwise false.
This is the same as std::vector::empty.
Definition at line 783 of file BLI_vector.hh.
Referenced by BKE_appdir_app_template_any(), BKE_blendfile_link(), BM_mesh_calc_tessellation_with_partial_ex(), BM_mesh_normals_update_with_partial_ex(), blender::bke::pbvh::pixels::copy_update(), deg_flush_updates_and_refresh(), ED_mesh_shapes_join_objects_exec(), blender::nodes::get_sync_state_closure_output(), blender::nodes::get_sync_state_combine_bundle(), blender::nodes::get_sync_state_evaluate_closure(), blender::nodes::get_sync_state_separate_bundle(), IMB_exr_begin_write(), IMB_exr_multilayer_convert(), IMB_exr_write_channels(), knife_add_cut(), MOD_lineart_gpencil_generate_v3(), blender::ed::space_node::node_link_modal(), blender::Vector< SubdivCCGCoord, 256 >::pop_last(), prepare_linehits_for_cut(), blender::Vector< SubdivCCGCoord, 256 >::release(), remove_in_and_out_node_panel_recursive(), blender::Vector< SubdivCCGCoord, 256 >::remove_last(), screen_opengl_render_end(), ui_block_bounds_calc(), ui_block_bounds_calc_text(), ui_block_new_button_group(), UI_block_update_from_old(), ui_but_anim_decorate_find_attached_button(), ui_button_group_add_but(), ui_item_enum_expand_tabs(), ui_multibut_restore(), ui_multibut_states_apply(), UI_panel_header_buttons_end(), ui_popup_block_position(), UI_popup_block_template_confirm_op(), ui_selectcontext_apply(), ui_selectcontext_begin(), version_geometry_nodes_extrude_smooth_propagation(), WM_gizmo_target_property_clear_rna_ptr(), WM_gizmo_target_property_def_func_ptr(), WM_gizmo_target_property_def_rna_ptr(), and blender::io::ply::write_header().
|
inline |
Definition at line 1099 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::clear_and_shrink(), blender::Vector< SubdivCCGCoord, 256 >::release(), and blender::Vector< SubdivCCGCoord, 256 >::~Vector().
|
inline |
Definition at line 746 of file BLI_vector.hh.
|
inline |
Return a reference to the nth last element. This invokes undefined behavior when the vector is too short.
Definition at line 740 of file BLI_vector.hh.
Referenced by blf_glyph_cache_new(), blender::ed::space_node::ensure_nodetree_previews(), IMB_exr_add_channels(), imb_exr_get_layer(), imb_exr_get_pass(), knife_add_cut(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::space_node::shader_preview_startjob(), blender::ui::template_asset_shelf_popover(), template_texture_user_menu(), ui_block_new_button_group(), ui_button_group_add_but(), ui_def_but(), blender::ed::space_node::ui_node_menu_column(), UI_panel_header_buttons_end(), UI_popup_block_template_confirm_op(), ui_popup_context_menu_for_panel(), blender::ed::space_node::ui_template_node_link_menu(), ui_update_flexible_spacing(), and uiTemplateStatusInfo().
|
inline |
Definition at line 364 of file BLI_vector.hh.
|
inline |
Definition at line 376 of file BLI_vector.hh.
|
inline |
Definition at line 359 of file BLI_vector.hh.
|
inline |
Definition at line 370 of file BLI_vector.hh.
|
inline |
Definition at line 331 of file BLI_vector.hh.
|
inline |
Definition at line 336 of file BLI_vector.hh.
|
inline |
Definition at line 352 of file BLI_vector.hh.
|
inline |
Get the value at the given index. This invokes undefined behavior when the index is out of bounds.
Definition at line 345 of file BLI_vector.hh.
|
inline |
Remove the last element from the vector and return it. This invokes undefined behavior when the vector is empty.
This is similar to std::vector::pop_back.
Definition at line 806 of file BLI_vector.hh.
Referenced by ui_selectcontext_begin().
|
inline |
Insert values at the beginning of the vector. This has to move all the other elements, so it has a linear running time.
Definition at line 719 of file BLI_vector.hh.
Referenced by imb_exr_get_pass().
|
inline |
Definition at line 731 of file BLI_vector.hh.
|
inline |
Definition at line 727 of file BLI_vector.hh.
|
inline |
Definition at line 723 of file BLI_vector.hh.
|
inline |
Print some debug information about the vector.
Definition at line 1093 of file BLI_vector.hh.
|
inline |
Definition at line 976 of file BLI_vector.hh.
Referenced by ctx_store_lookup_impl(), and CTX_store_ptr_lookup().
|
inline |
Definition at line 985 of file BLI_vector.hh.
|
inline |
Reset the size of the vector so that it contains new_size elements. All existing elements are destructed, and not copied if the data must be reallocated.
Definition at line 449 of file BLI_vector.hh.
Referenced by blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_grids(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), and DRW_select_buffer_context_create().
|
inline |
Release the underlying memory buffer from the Vector. The caller is responsible for freeing the pointer if it is non-null.
If the values were stored in the inline-buffer, the values are copied to a newly allocated array first. The caller does not have to any special handling in this case.
The Vector will be empty afterwards.
Definition at line 1051 of file BLI_vector.hh.
Referenced by remove_in_and_out_node_panel_recursive().
|
inline |
Remove the element at the given index and move all values coming after it one towards the front. This takes O(n) time. If the order is not important, remove_and_reorder should be used instead.
This is similar to std::vector::erase.
Definition at line 851 of file BLI_vector.hh.
|
inline |
Remove a contiguous chunk of elements and move all values coming after it towards the front. This takes O(n) time.
This is similar to std::vector::erase.
Definition at line 870 of file BLI_vector.hh.
|
inline |
Delete any element in the vector. The empty space will be filled by the previously last element. This takes O(1) time.
Definition at line 820 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::remove_first_occurrence_and_reorder().
|
inline |
Finds the first occurrence of the value, removes it and copies the last element to the hole in the vector. This takes O(n) time.
Definition at line 838 of file BLI_vector.hh.
|
inline |
Remove all values for which the given predicate is true and return the number of values removed.
This is similar to std::erase_if.
Definition at line 891 of file BLI_vector.hh.
|
inline |
Destructs the last element and decreases the size by one. This invokes undefined behavior when the vector is empty.
Definition at line 792 of file BLI_vector.hh.
Referenced by blender::nodes::node_geo_string_to_curves_cc::get_text_layout().
|
inline |
Definition at line 980 of file BLI_vector.hh.
Referenced by ctx_store_lookup_impl(), and CTX_store_ptr_lookup().
|
inline |
Definition at line 989 of file BLI_vector.hh.
|
inline |
Make sure that enough memory is allocated to hold min_capacity elements. This won't necessarily make an allocation when min_capacity is small. The actual size of the vector does not change.
Definition at line 396 of file BLI_vector.hh.
Referenced by blender::Vector< SubdivCCGCoord, 256 >::append_n_times(), BM_mesh_partial_create_from_verts(), BM_mesh_partial_create_from_verts_group_multi(), BM_mesh_partial_create_from_verts_group_single(), blender::Vector< SubdivCCGCoord, 256 >::extend(), blender::Vector< SubdivCCGCoord, 256 >::insert(), blender::io::ply::load_plydata(), RE_RenderAnim(), blender::Vector< SubdivCCGCoord, 256 >::resize(), blender::Vector< SubdivCCGCoord, 256 >::resize(), screen_opengl_render_anim_init(), UI_block_begin(), and UI_text_clip_multiline_middle().
|
inline |
Change the size of the vector so that it contains new_size elements. If new_size is smaller than the old size, the elements at the end of the vector are destructed. If new_size is larger than the old size, the new elements at the end are default constructed. If T is trivially constructible, the memory is not touched by this function.
Definition at line 409 of file BLI_vector.hh.
Referenced by blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::cloth::apply_filter_forces_grids(), blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::ed::sculpt_paint::mask::apply_mask_bmesh(), blender::ed::sculpt_paint::mask::apply_mask_grids(), blender::ed::sculpt_paint::mask::apply_mask_mesh(), blender::ed::sculpt_paint::project::apply_projection_bmesh(), blender::ed::sculpt_paint::project::apply_projection_grids(), blender::ed::sculpt_paint::project::apply_projection_mesh(), blender::ed::sculpt_paint::brushes::calc_bmesh(), blender::ed::sculpt_paint::pose::calc_bmesh(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::brushes::calc_faces(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::brushes::calc_grids(), blender::ed::sculpt_paint::pose::calc_grids(), blender::ed::sculpt_paint::pose::calc_mesh(), blender::bke::curves::nurbs::calculate_basis_cache(), blender::ed::sculpt_paint::color::color_filter_task(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_bmesh(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_grids(), blender::ed::sculpt_paint::mask::decrease_contrast_mask_mesh(), blender::ed::sculpt_paint::color::do_color_smooth_task(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::color::do_sample_wet_paint_task(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::ed::sculpt_paint::elastic_transform_node_bmesh(), blender::ed::sculpt_paint::elastic_transform_node_grids(), blender::ed::sculpt_paint::elastic_transform_node_mesh(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::ed::sculpt_paint::mask::increase_contrast_mask_bmesh(), blender::ed::sculpt_paint::mask::increase_contrast_mask_grids(), blender::ed::sculpt_paint::mask::increase_contrast_mask_mesh(), blender::io::ply::load_plydata(), blender::nodes::node_geo_bake_cc::make_bake_socket_config(), blender::nodes::node_geo_simulation_cc::make_bake_socket_config(), blender::ed::sculpt_paint::move_last_point_and_resample(), movie_index_open(), blender::io::csv::parse_records_chunk(), prepare_linehits_for_cut(), blender::gpu::read_spirv_from_disk(), blender::Vector< SubdivCCGCoord, 256 >::reinitialize(), blender::ed::sculpt_paint::brushes::sample_node_surface_bmesh(), blender::ed::sculpt_paint::brushes::sample_node_surface_grids(), blender::ed::sculpt_paint::brushes::sample_node_surface_mesh(), blender::ed::sculpt_paint::mask::sharpen_mask_bmesh(), blender::ed::sculpt_paint::mask::sharpen_mask_grids(), blender::ed::sculpt_paint::mask::sharpen_mask_mesh(), blender::ed::sculpt_paint::mask::smooth_mask_bmesh(), blender::ed::sculpt_paint::mask::smooth_mask_grids(), blender::ed::sculpt_paint::mask::smooth_mask_mesh(), blender::ed::sculpt_paint::transform_node_bmesh(), blender::ed::sculpt_paint::transform_node_grids(), blender::ed::sculpt_paint::transform_node_mesh(), ui_selectcontext_begin(), ui_template_list_collect_display_items(), blender::ed::sculpt_paint::mask::update_mask_mesh(), view3d_panel_vgroup(), wm_gizmo_create(), and WM_gizmo_operator_set().
|
inline |
Change the size of the vector so that it contains new_size elements. If new_size is smaller than the old size, the elements at the end of the vector are destructed. If new_size is larger than the old size, the new elements will be copy constructed from the given value.
Definition at line 430 of file BLI_vector.hh.
|
inline |
Return how many values are currently stored in the vector.
Definition at line 771 of file BLI_vector.hh.
Referenced by blender::ed::object::bake_exec(), blender::ed::object::bake_startjob(), BKE_blendfile_link_append_context_item_add(), BLI_expr_pylike_eval(), BLI_expr_pylike_is_constant(), BLI_expr_pylike_is_using_param(), BLI_expr_pylike_is_valid(), bm_log_entry_free(), bm_mesh_calc_tessellation_with_partial__multi_threaded(), bm_mesh_calc_tessellation_with_partial__single_threaded(), BM_mesh_calc_tessellation_with_partial_ex(), BM_mesh_partial_create_from_verts_group_multi(), BM_mesh_partial_create_from_verts_group_single(), calc_ortho_extent(), colorband_buttons_layout(), blender::gpu::GLShader::constants_declare(), draw_fcurve_curve_keys(), find_all_ranges_test(), find_new_properties_tab(), blender::gpu::VKPipelinePool::get_or_create_graphics_pipeline(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), knife_add_cut(), knife_bvh_raycast_cb(), knife_find_line_hits(), knifetool_draw(), knifetool_init(), knifetool_modal(), blender::io::ply::load_plydata(), blender::bke::outliner::treehash::TreeHash::lookup_unused(), blender::bke::bake::move_socket_values_to_bake_items(), ntree_exec_begin(), blender::gpu::render_graph::VKViewportData::operator==(), blender::gpu::VKGraphicsInfo::FragmentOut::operator==(), blender::gpu::VKGraphicsInfo::FragmentShader::operator==(), prepare_linehits_for_cut(), blender::ed::space_node::prepare_viewlayer_update(), psys_sph_flush_springs(), blender::bke::outliner::treehash::TreeHash::remove_element(), blender::ed::sculpt_paint::undo::store_color(), blender::tests::TEST(), TEST(), blender::draw::test_draw_curves_interpolate_attributes(), blender::draw::test_draw_curves_interpolate_position(), blender::io::ply::TEST_F(), blender::io::ply::TEST_F(), ui_block_align_calc(), UI_block_begin(), UI_block_update_from_old(), ui_but_anim_decorate_find_attached_button(), ui_but_last(), ui_but_update_from_old_block(), ui_item_enum_expand_tabs(), UI_panel_header_buttons_end(), ui_popup_block_scrolltest(), ui_rna_collection_search_update_fn(), ui_template_list_layout_draw(), UI_text_clip_multiline_middle(), ui_textedit_prev_but(), uilist_prepare(), uiTemplateKeymapItemProperties(), WM_drag_create_path_data(), WM_gizmo_operator_set(), and blender::io::ply::write_header().
|
friend |
Definition at line 1037 of file BLI_vector.hh.
|
friend |
Definition at line 1032 of file BLI_vector.hh.
|
friend |
Be a friend with other vector instantiations. This is necessary to implement some memory management logic.
Definition at line 122 of file BLI_vector.hh.