Blender  V3.3
Public Types | Public Member Functions | Friends | List of all members
blender::Vector< T, InlineBufferCapacity, Allocator > Class Template Reference

#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
 

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 (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 ListBase &values, 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(std::is_nothrow_move_constructible_v< T >)
 
 ~Vector ()
 
Vectoroperator= (const Vector &other)
 
Vectoroperator= (Vector &&other)
 
const Toperator[] (int64_t index) const
 
Toperator[] (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< Tas_span () const
 
MutableSpan< Tas_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_make_inline ()
 
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)
 
void extend_non_duplicates (Span< T > array)
 
void extend_unchecked (Span< T > array)
 
void extend_unchecked (const T *start, int64_t amount)
 
template<typename InputIt >
void extend (InputIt first, InputIt last)
 
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 Tlast (const int64_t n=0) const
 
Tlast (const int64_t n=0)
 
const Tfirst () const
 
Tfirst ()
 
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)
 
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
 
Tdata ()
 
const Tdata () const
 
Tbegin ()
 
Tend ()
 
const Tbegin () const
 
const Tend () const
 
std::reverse_iterator< T * > rbegin ()
 
std::reverse_iterator< T * > rend ()
 
std::reverse_iterator< const T * > rbegin () const
 
std::reverse_iterator< const T * > rend () const
 
int64_t capacity () const
 
IndexRange index_range () const
 
void print_stats (StringRef name="") const
 

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)
 

Detailed Description

template<typename T, int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
class blender::Vector< T, InlineBufferCapacity, Allocator >

Definition at line 64 of file BLI_vector.hh.

Member Typedef Documentation

◆ const_iterator

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::const_iterator = const T *

Definition at line 72 of file BLI_vector.hh.

◆ const_pointer

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::const_pointer = const T *

Definition at line 68 of file BLI_vector.hh.

◆ const_reference

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::const_reference = const T &

Definition at line 70 of file BLI_vector.hh.

◆ iterator

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::iterator = T *

Definition at line 71 of file BLI_vector.hh.

◆ pointer

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::pointer = T *

Definition at line 67 of file BLI_vector.hh.

◆ reference

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::reference = T &

Definition at line 69 of file BLI_vector.hh.

◆ size_type

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::size_type = int64_t

Definition at line 73 of file BLI_vector.hh.

◆ value_type

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
using blender::Vector< T, InlineBufferCapacity, Allocator >::value_type = T

Definition at line 66 of file BLI_vector.hh.

Constructor & Destructor Documentation

◆ Vector() [1/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( Allocator  allocator = {})
inlinenoexcept

Create an empty vector. This does not do any memory allocation.

Definition at line 117 of file BLI_vector.hh.

◆ Vector() [2/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( NoExceptConstructor  ,
Allocator  allocator = {} 
)
inlinenoexcept

Definition at line 125 of file BLI_vector.hh.

◆ Vector() [3/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( int64_t  size,
Allocator  allocator = {} 
)
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 134 of file BLI_vector.hh.

◆ Vector() [4/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( int64_t  size,
const T value,
Allocator  allocator = {} 
)
inline

Create a vector filled with a specific value.

Definition at line 143 of file BLI_vector.hh.

◆ Vector() [5/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename U , BLI_ENABLE_IF((std::is_convertible_v< U, T >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( Span< U values,
Allocator  allocator = {} 
)
inline

Create a vector from a span. The values in the vector are copy constructed.

Definition at line 153 of file BLI_vector.hh.

◆ Vector() [6/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename U , BLI_ENABLE_IF((std::is_convertible_v< U, T >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const std::initializer_list< U > &  values)
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 168 of file BLI_vector.hh.

◆ Vector() [7/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const std::initializer_list< T > &  values)
inline

Definition at line 172 of file BLI_vector.hh.

◆ Vector() [8/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename U , size_t N, BLI_ENABLE_IF((std::is_convertible_v< U, T >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const std::array< U, N > &  values)
inline

Definition at line 177 of file BLI_vector.hh.

◆ Vector() [9/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename InputIt , BLI_ENABLE_IF((!std::is_convertible_v< InputIt, int >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( InputIt  first,
InputIt  last,
Allocator  allocator = {} 
)
inline

Definition at line 185 of file BLI_vector.hh.

◆ Vector() [10/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const ListBase values,
Allocator  allocator = {} 
)
inline

Create a vector from a ListBase. The caller has to make sure that the values in the linked list have the correct type.

Example Usage: Vector<ModifierData *> modifiers(ob->modifiers);

Definition at line 200 of file BLI_vector.hh.

◆ Vector() [11/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const Vector< T, InlineBufferCapacity, Allocator > &  other)
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 212 of file BLI_vector.hh.

◆ Vector() [12/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<int64_t OtherInlineBufferCapacity>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( const Vector< T, OtherInlineBufferCapacity, Allocator > &  other)
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 221 of file BLI_vector.hh.

◆ Vector() [13/13]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<int64_t OtherInlineBufferCapacity>
blender::Vector< T, InlineBufferCapacity, Allocator >::Vector ( Vector< T, OtherInlineBufferCapacity, Allocator > &&  other)
inlinenoexcept

Steal the elements from another vector. This does not do an allocation. The other vector will have zero elements afterwards.

Definition at line 231 of file BLI_vector.hh.

References AT, blender::Vector< T, InlineBufferCapacity, Allocator >::capacity(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), T, blender::uninitialized_relocate_n(), and UPDATE_VECTOR_SIZE.

◆ ~Vector()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::~Vector ( )
inline

Member Function Documentation

◆ append() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append ( const T value)
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 433 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append_as().

Referenced by blender::fn::FieldEvaluator::add(), blender::ResourceScope::add(), blender::fn::MFProcedureBuilder::add_call(), blender::compositor::NodeOperationBuilder::add_complex_operation_buffers(), blender::geometry::add_curves_on_mesh(), blender::compositor::NodeOperationBuilder::add_datatype_conversions(), blender::nodes::node_geo_dual_mesh_cc::add_edge(), blender::deg::DepsgraphNodeBuilder::add_id_node(), blender::deg::Depsgraph::add_id_node(), InstancesComponent::add_instance(), blender::nodes::GatherLinkSearchOpParams::add_item(), CryptomatteSession::add_layer(), blender::io::obj::MTLWriter::add_materials(), blender::nodes::LinkSearchOpParams::add_node(), blender::compositor::CryptomatteOperation::add_object_index(), blender::compositor::NodeOperationBuilder::add_operation_input_constants(), blender::deg::DepsgraphNodeBuilder::add_operation_node(), CurveEval::add_spline(), blender::fn::FieldEvaluator::add_with_destination(), VolumeUniformBufPool::alloc(), blender::bke::pbvh::pixels::Triangles::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_non_duplicates(), GPUCodegenCreateInfo::NameBuffer::append_sampler_name(), blender::ed::spreadsheet::apply_filter_operation(), asset_operation_get_ids_from_context(), BLI_string_search_add(), BLI_string_search_query(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::nodes::SeparateRGBAFunction::call(), blender::nodes::node_geo_raycast_cc::RaycastFunction::call(), blender::nodes::node_shader_sepcomb_xyz_cc::MF_SeparateXYZ::call(), blender::fn::combine_field_inputs(), compute_attributes_to_store(), compute_geometry(), compute_interpolated_polygons(), compute_vertex_mask__armature_mode(), blender::ui::context_path_add_generic(), blender::bke::copy_with_removed_curves(), blender::bke::copy_with_removed_points(), blender::fn::MFProcedureDotExport::create_entry_node(), blender::geometry::create_nurbs_to_bezier_handles(), CustomData_blend_write_prepare(), blender::deg::deg_graph_transitive_reduction(), blender::compositor::NodeOperationBuilder::determine_canvases(), blender::meshintersect::direct_mesh_boolean(), blender::nodes::node_geo_dual_mesh_cc::dissolve_redundant_verts(), DRW_view_data_create(), DRW_view_data_use_engine(), duplicate_exec(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points(), blender::nodes::node_geo_edge_paths_to_curves_cc::edge_paths_to_curves_convert(), blender::geometry::edges_to_curve_point_indices(), blender::eevee::VelocityModule::end_sync(), blender::draw::Texture::ensure_layer_views(), blender::draw::Texture::ensure_mip_views(), blender::fn::evaluate_fields(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::execute_multi_function_node(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::execute_multi_function_node__field(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::execute_multi_function_node__value(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_mesh_tasks(), blender::geometry::execute_realize_pointcloud_tasks(), blender::nodes::GeoNodeExecParams::extract_multi_input(), blender::modifiers::geometry_nodes::NodeParamsProvider::extract_multi_input(), blender::string_search::extract_normalized_words(), blender::IndexMask::extract_ranges(), blender::IndexMask::extract_ranges_invert(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::io::obj::filter_supported_objects(), blender::gpu::GLShader::finalize(), blender::deg::ComponentNode::finalize_build(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::bke::pbvh::pixels::find_nodes_to_update(), find_spreadsheet_editors(), blender::ed::space_node::viewer_linking::find_viewer_nodes(), blender::io::obj::fixup_invalid_polygon(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::forward_output(), blender::compositor::FullFrameExecutionModel::FullFrameExecutionModel(), blender::geometry::gather_generic_curve_attributes_to_propagate(), blender::geometry::gather_generic_mesh_attributes_to_propagate(), blender::geometry::gather_generic_pointcloud_attributes_to_propagate(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::bke::node_field_inferencing::gather_input_socket_dependencies(), gather_mutable_geometry_sets(), blender::ed::space_node::gather_socket_link_operations(), blender::compositor::generate_hashes(), generate_unique_instance_ids(), blender::io::obj::geom_add_curve_parameters(), blender::io::obj::geom_add_curve_vertex_indices(), blender::io::obj::geom_add_edge(), blender::bke::geometry_set_collect_recursive(), blender::io::obj::geometry_to_blender_objects(), blender::compositor::SharedOperationBuffers::get_areas_to_render(), GeometrySet::get_components_for_read(), blender::nodes::DInputSocket::get_corresponding_group_input_sockets(), blender::fn::get_field_context_inputs(), blender::fn::MFProcedureDotExport::get_instructions_in_block(), blender::bke::node_field_inferencing::get_node_field_inferencing_interface(), blender::compositor::get_operation_dependencies(), blender::geometry::get_selected_edges(), blender::ed::sculpt_paint::get_symmetry_brush_transforms(), blender::gpu::GLShaderInterface::GLShaderInterface(), GPU_debug_group_begin(), gpu_select_query_load_id(), GPU_shader_create_ex(), GPU_shader_create_from_info(), blender::render::texturemargin::TextureMarginMap::grow_dijkstra(), OutlinerLibOverrideData::id_root_add(), OutlinerLibOverrideData::id_root_set(), image_exr_from_scene_linear_to_output(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::initialize_node_state(), blender::fn::MFSignatureBuilder::input(), blender::fn::MFProcedureDotExport::instruction_to_string(), internal_dependencies_panel_draw(), blender::IndexMask::invert(), blender::nodes::node_geo_join_geometry_cc::join_component_type(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::load_unlinked_input_value(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::log_socket_value(), blender::nodes::geometry_nodes_eval_log::NodeLog::lookup_available_attributes(), make_recursive_duplis(), blender::eevee::MaterialModule::material_array_get(), blender::draw::mesh_buffer_cache_create_requested(), blender::draw::mesh_buffer_cache_create_requested_subdiv(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::nodes::geometry_nodes_eval_log::ModifierLog::ModifierLog(), blender::fn::MFSignatureBuilder::mutable_(), blender::ed::space_node::named_attribute_tooltip(), blender::nodes::node_geo_boolean_cc::node_geo_exec(), blender::nodes::node_geo_collection_info_cc::node_geo_exec(), blender::ed::space_node::node_get_extra_info(), blender::ed::space_node::node_group_ungroup(), object_clear_transform_generic_exec(), object_duplilist(), object_transform_axis_target_invoke(), blender::fn::MFSignatureBuilder::output(), blender::io::obj::OBJParser::parse(), blender::ed::space_node::pick_link(), blender::geometry::prepare_attribute_fallbacks(), blender::nodes::node_geo_scale_elements_cc::prepare_edge_islands(), blender::nodes::node_geo_scale_elements_cc::prepare_face_islands(), blender::gpu::Shader::print_log(), blender::LinearAllocator< Allocator >::provide_buffer(), blender::compositor::NodeOperationBuilder::prune_operations(), blender::deg::Relation::Relation(), blender::bke::MutableAttributeAccessor::remove_anonymous(), InstancesComponent::remove_unused_references(), blender::compositor::NodeOperationBuilder::resolve_proxies(), blender::geometry::retrieve_attribute_spans(), blender::bke::retrieve_attributes_for_transfer(), blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center(), blender::nodes::node_geo_distribute_points_on_faces_cc::sample_mesh_surface(), blender::ed::sculpt_paint::AddOperationExecutor::sample_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::schedule_node(), blender::string_search::score_query_against_words(), blender::nodes::search_link_ops_for_declarations(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::nodes::node_geo_material_selection_cc::select_mesh_by_material(), selected_indices_from_vertex_group(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::set_input_required(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::set_input_unused(), shader_to_rgba_node_gather(), blender::ed::space_node::snode_autoconnect(), blender::ed::space_node::sort_multi_input_socket_links(), blender::compositor::sort_operations_recursive(), standard_defines(), blender::tests::TEST(), blender::bke::tests::TEST(), blender::nodes::DerivedNodeTree::to_dot(), blender::nodes::NodeTreeRef::to_dot(), blender::bke::DynamicPointAttributeProvider::try_get_for_read(), blender::bke::DynamicPointAttributeProvider::try_get_for_write(), blender::ed::space_node::ui_node_link_items(), blender::ed::space_node::ui_node_menu_column(), ui_update_flexible_spacing(), blender::bke::NodeTreeMainUpdater::update(), view2d_major_step_x__time(), blender::geometry::weld_edge_ctx_alloc(), blender::geometry::weld_poly_loop_ctx_alloc(), blender::geometry::weld_vert_ctx_alloc_and_setup(), and blender::io::obj::write_mesh_objects().

◆ append() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append ( T &&  value)
inline

◆ append_and_get_index() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index ( const T value)
inline

Append the value to the vector and return the index that can be used to access the newly added value.

Definition at line 452 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index_as().

Referenced by blender::fn::FieldEvaluator::add(), and blender::tests::TEST().

◆ append_and_get_index() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index ( T &&  value)
inline

◆ append_and_get_index_as()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename... ForwardValue>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index_as ( ForwardValue &&...  value)
inline

◆ append_as()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename... ForwardValue>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_as ( ForwardValue &&...  value)
inline

◆ append_n_times()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times ( const T value,
const int64_t  n 
)
inline

◆ append_non_duplicates()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_non_duplicates ( const T value)
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 472 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and blender::Vector< T, InlineBufferCapacity, Allocator >::contains().

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::extend_non_duplicates(), blender::bke::node_field_inferencing::find_group_output_dependencies(), gather_component_types_recursive(), GeometrySet::keep_only_during_modify(), and blender::tests::TEST().

◆ append_unchecked() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked ( const T value)
inline

◆ append_unchecked() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked ( T &&  value)
inline

◆ append_unchecked_as()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename... ForwardT>
void blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked_as ( ForwardT &&...  value)
inline

◆ as_mutable_span()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
MutableSpan<T> blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span ( )
inline

◆ as_span()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
Span<T> blender::Vector< T, InlineBufferCapacity, Allocator >::as_span ( ) const
inline

◆ begin() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T* blender::Vector< T, InlineBufferCapacity, Allocator >::begin ( )
inline

◆ begin() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T* blender::Vector< T, InlineBufferCapacity, Allocator >::begin ( ) const
inline

Definition at line 875 of file BLI_vector.hh.

◆ capacity()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::capacity ( ) const
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 906 of file BLI_vector.hh.

Referenced by blender::gpu::GLQueryPool::begin_query(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and blender::Vector< T, InlineBufferCapacity, Allocator >::Vector().

◆ clear()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::clear ( )
inline

◆ clear_and_make_inline()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::clear_and_make_inline ( )
inline

Afterwards the vector has 0 elements and any allocated memory will be freed.

Definition at line 414 of file BLI_vector.hh.

References blender::destruct_n(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and UPDATE_VECTOR_SIZE.

Referenced by blender::io::obj::OBJMesh::clear().

◆ contains()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
bool blender::Vector< T, InlineBufferCapacity, Allocator >::contains ( const T value) const
inline

◆ data() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T* blender::Vector< T, InlineBufferCapacity, Allocator >::data ( )
inline

◆ data() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T* blender::Vector< T, InlineBufferCapacity, Allocator >::data ( ) const
inline

Get access to the underlying array.

Definition at line 861 of file BLI_vector.hh.

◆ end() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T* blender::Vector< T, InlineBufferCapacity, Allocator >::end ( )
inline

◆ end() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T* blender::Vector< T, InlineBufferCapacity, Allocator >::end ( ) const
inline

Definition at line 879 of file BLI_vector.hh.

◆ extend() [1/3]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend ( const T start,
int64_t  amount 
)
inline

◆ extend() [2/3]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename InputIt >
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend ( InputIt  first,
InputIt  last 
)
inline

◆ extend() [3/3]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend ( Span< T array)
inline

◆ extend_non_duplicates()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend_non_duplicates ( Span< T array)
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 545 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append_non_duplicates(), and T.

Referenced by GPUCodegen::generate_library(), and blender::tests::TEST().

◆ extend_unchecked() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend_unchecked ( const T start,
int64_t  amount 
)
inline

Definition at line 560 of file BLI_vector.hh.

References BLI_assert, blender::uninitialized_copy_n(), and UPDATE_VECTOR_SIZE.

◆ extend_unchecked() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::extend_unchecked ( Span< T array)
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 556 of file BLI_vector.hh.

References blender::Span< T >::data(), and array< T, alignment >::size().

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), and merge_uvs_for_vertex().

◆ fill()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::fill ( const T value) const
inline

Copies the given value to every element in the vector.

Definition at line 845 of file BLI_vector.hh.

References blender::initialized_fill_n(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by blender::tests::TEST().

◆ first() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T& blender::Vector< T, InlineBufferCapacity, Allocator >::first ( )
inline

◆ first() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T& blender::Vector< T, InlineBufferCapacity, Allocator >::first ( ) const
inline

◆ first_index_of()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of ( const T value) const
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 826 of file BLI_vector.hh.

References BLI_assert, and blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of_try().

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::remove_first_occurrence_and_reorder(), and blender::tests::TEST().

◆ first_index_of_try()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of_try ( const T value) const
inline

Do a linear search to find the value in the vector. When found, return the first index, otherwise return -1.

Definition at line 812 of file BLI_vector.hh.

References T.

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::contains(), DRW_view_data_free_unused(), blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of(), and blender::tests::TEST().

◆ increase_size_by_unchecked()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::increase_size_by_unchecked ( const int64_t  n)
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 518 of file BLI_vector.hh.

References BLI_assert, and UPDATE_VECTOR_SIZE.

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times().

◆ index_range()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
IndexRange blender::Vector< T, InlineBufferCapacity, Allocator >::index_range ( ) const
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 920 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by CurveEval::accumulated_spline_lengths(), BLI_string_search_query(), blender::eevee::Sampling::cdf_from_curvemapping(), blender::eevee::Sampling::cdf_invert(), CurveEval::control_point_offsets(), blender::bke::copy_with_removed_curves(), blender::bke::copy_with_removed_points(), blender::nodes::node_geo_string_to_curves_cc::create_attributes(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::fn::MFProcedureDotExport::create_entry_node(), curve_eval_from_dna_curve(), blender::bke::curve_legacy_to_curves(), blender::geometry::edges_to_curve_point_indices(), blender::fn::evaluate_fields(), CurveEval::evaluated_point_offsets(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::execute_multi_function_node__value(), blender::IndexMask::extract_ranges_invert(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::geometry::OrderedAttributes::index_range(), blender::fn::MFProcedureDotExport::instruction_to_string(), internal_dependencies_panel_draw(), blender::ed::space_node::named_attribute_tooltip(), blender::ed::space_node::node_draw_extra_info_panel(), blender::nodes::node_geo_string_join_cc::node_geo_exec(), object_transform_axis_target_modal(), blender::HashTableStats::print(), blender::gpu::Shader::print_log(), refresh_socket_list(), blender::ed::sculpt_paint::CombOperationExecutor::restore_segment_lengths(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::nodes::search_link_ops_for_declarations(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::ed::space_node::sort_multi_input_socket_links(), and blender::eevee::SyncModule::sync_mesh().

◆ insert() [1/5]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::insert ( const int64_t  insert_index,
const T value 
)
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 579 of file BLI_vector.hh.

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::Vector< T, InlineBufferCapacity, Allocator >::insert(), blender::Vector< T, InlineBufferCapacity, Allocator >::prepend(), and blender::tests::TEST().

◆ insert() [2/5]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename InputIt >
void blender::Vector< T, InlineBufferCapacity, Allocator >::insert ( const int64_t  insert_index,
InputIt  first,
InputIt  last 
)
inline

◆ insert() [3/5]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::insert ( const int64_t  insert_index,
Span< T array 
)
inline

◆ insert() [4/5]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::insert ( const int64_t  insert_index,
T &&  value 
)
inline

◆ insert() [5/5]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename InputIt >
void blender::Vector< T, InlineBufferCapacity, Allocator >::insert ( const T insert_position,
InputIt  first,
InputIt  last 
)
inline

◆ is_empty()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
bool blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty ( ) const
inline

Returns true when the vector contains no elements, otherwise false.

This is the same as std::vector::empty.

Definition at line 706 of file BLI_vector.hh.

Referenced by blender::compositor::NodeOperationBuilder::add_output_buffers(), blender::fn::combine_field_inputs(), blender::io::obj::CurveFromGeometry::create_curve(), blender::io::obj::create_geometry(), blender::deg::deg_debug_graphviz_node(), blender::deg::deg_graph_remove_unused_noops(), duplicate_exec(), ED_spreadsheet_context_path_exists(), ED_spreadsheet_context_path_is_active(), blender::nodes::node_geo_edge_paths_to_curves_cc::edge_paths_to_curves_convert(), blender::fn::evaluate_fields(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::nodes::geometry_nodes_eval_log::ModifierLog::find_tree_by_node_editor_context(), blender::ed::space_node::viewer_linking::get_existing_viewer(), OutlinerLibOverrideData::id_root_set(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::initialize_node_state(), blender::geometry::interpolate_position_with_interpolation(), blender::deg::BuilderStack::is_empty(), blender::deg::is_unused_noop(), blender::ed::space_node::link_drag_search_exec_fn(), merge_uvs_for_vertex(), blender::draw::mesh_buffer_cache_create_requested(), blender::draw::mesh_buffer_cache_create_requested_subdiv(), object_clear_transform_generic_exec(), blender::gpu::GLSharedOrphanLists::orphans_clear(), blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last(), blender::gpu::Shader::print_log(), blender::bke::MutableAttributeAccessor::remove_anonymous(), blender::Vector< T, InlineBufferCapacity, Allocator >::remove_last(), blender::string_search::score_query_against_words(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::set_input_required(), blender::ed::spreadsheet::spreadsheet_context_update_tag(), blender::ed::spreadsheet::spreadsheet_filter_rows(), blender::tests::TEST(), blender::io::obj::write_mesh_objects(), blender::gpu::GLContext::~GLContext(), and blender::deg::BuilderStack::ScopedEntry::~ScopedEntry().

◆ last() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T& blender::Vector< T, InlineBufferCapacity, Allocator >::last ( const int64_t  n = 0)
inline

◆ last() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T& blender::Vector< T, InlineBufferCapacity, Allocator >::last ( const int64_t  n = 0) const
inline

◆ operator MutableSpan< T >()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::operator MutableSpan< T > ( )
inline

Definition at line 308 of file BLI_vector.hh.

◆ operator MutableSpan< U >()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< T, U >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::operator MutableSpan< U > ( )
inline

◆ operator Span< T >()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
blender::Vector< T, InlineBufferCapacity, Allocator >::operator Span< T > ( ) const
inline

Definition at line 303 of file BLI_vector.hh.

◆ operator Span< U >()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< T, U >)) >
blender::Vector< T, InlineBufferCapacity, Allocator >::operator Span< U > ( ) const
inline

◆ operator=() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
Vector& blender::Vector< T, InlineBufferCapacity, Allocator >::operator= ( const Vector< T, InlineBufferCapacity, Allocator > &  other)
inline

Definition at line 275 of file BLI_vector.hh.

References blender::copy_assign_container().

◆ operator=() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
Vector& blender::Vector< T, InlineBufferCapacity, Allocator >::operator= ( Vector< T, InlineBufferCapacity, Allocator > &&  other)
inline

Definition at line 280 of file BLI_vector.hh.

References blender::move_assign_container().

◆ operator[]() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T& blender::Vector< T, InlineBufferCapacity, Allocator >::operator[] ( int64_t  index)
inline

◆ operator[]() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
const T& blender::Vector< T, InlineBufferCapacity, Allocator >::operator[] ( int64_t  index) const
inline

Get the value at the given index. This invokes undefined behavior when the index is out of bounds.

Definition at line 289 of file BLI_vector.hh.

References BLI_assert, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

◆ pop_last()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
T blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last ( )
inline

◆ prepend() [1/4]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::prepend ( const T value)
inline

Insert values at the beginning of the vector. The has to move all the other elements, so it has a linear running time.

Definition at line 642 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::insert().

Referenced by blender::tests::TEST().

◆ prepend() [2/4]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename InputIt >
void blender::Vector< T, InlineBufferCapacity, Allocator >::prepend ( InputIt  first,
InputIt  last 
)
inline

◆ prepend() [3/4]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::prepend ( Span< T values)
inline

◆ prepend() [4/4]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::prepend ( T &&  value)
inline

◆ print_stats()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::print_stats ( StringRef  name = "") const
inline

Print some debug information about the vector.

Definition at line 938 of file BLI_vector.hh.

References BLI_str_format_byte_unit(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

◆ rbegin() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
std::reverse_iterator<T *> blender::Vector< T, InlineBufferCapacity, Allocator >::rbegin ( )
inline

◆ rbegin() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
std::reverse_iterator<const T *> blender::Vector< T, InlineBufferCapacity, Allocator >::rbegin ( ) const
inline

◆ reinitialize()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::reinitialize ( const int64_t  new_size)
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 393 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), and blender::Vector< T, InlineBufferCapacity, Allocator >::resize().

◆ remove() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::remove ( const int64_t  index)
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 774 of file BLI_vector.hh.

References BLI_assert, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and UPDATE_VECTOR_SIZE.

Referenced by blender::tests::TEST().

◆ remove() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::remove ( const int64_t  start_index,
const int64_t  amount 
)
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 793 of file BLI_vector.hh.

References BLI_assert, blender::destruct_n(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and UPDATE_VECTOR_SIZE.

◆ remove_and_reorder()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::remove_and_reorder ( const int64_t  index)
inline

◆ remove_first_occurrence_and_reorder()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::remove_first_occurrence_and_reorder ( const T value)
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 761 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of(), and blender::Vector< T, InlineBufferCapacity, Allocator >::remove_and_reorder().

Referenced by blender::tests::TEST(), and blender::deg::Relation::unlink().

◆ remove_last()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::remove_last ( )
inline

Destructs the last element and decreases the size by one. This invokes undefined behavior when the vector is empty.

Definition at line 715 of file BLI_vector.hh.

References BLI_assert, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), and UPDATE_VECTOR_SIZE.

Referenced by blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), make_recursive_duplis(), and blender::tests::TEST().

◆ rend() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
std::reverse_iterator<T *> blender::Vector< T, InlineBufferCapacity, Allocator >::rend ( )
inline

◆ rend() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
std::reverse_iterator<const T *> blender::Vector< T, InlineBufferCapacity, Allocator >::rend ( ) const
inline

◆ reserve()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::reserve ( const int64_t  min_capacity)
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 340 of file BLI_vector.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::capacity().

Referenced by blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times(), BKE_mesh_merge_customdata_for_apply_modifier(), blendthumb_create_png_data_from_thumb(), BMeshFairingContext::BMeshFairingContext(), blender::nodes::node_geo_raycast_cc::RaycastFunction::call(), compute_interpolated_polygons(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_mesh_data_from_poly_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_mesh_data_from_poly_selection_edge_face(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_edge_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_poly_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_vertex_selection(), computed_masked_polygons(), DRW_view_data_create(), blender::geometry::edges_to_curve_point_indices(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::deg::ComponentNode::finalize_build(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::bke::pbvh::pixels::find_nodes_to_update(), blender::io::obj::fixup_invalid_polygon(), blender::io::obj::geometry_to_blender_objects(), blender::Vector< T, InlineBufferCapacity, Allocator >::insert(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::log_socket_value(), merge_uvs_for_vertex(), MeshFairingContext::MeshFairingContext(), blender::nodes::node_geo_collection_info_cc::node_geo_exec(), blender::nodes::node_geo_scale_elements_cc::prepare_edge_islands(), blender::nodes::node_geo_scale_elements_cc::prepare_face_islands(), InstancesComponent::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::compositor::NodeOperationBuilder::sort_operations(), blender::ed::spreadsheet::spreadsheet_filter_rows(), blender::tests::TEST(), test_sin_cos_from_fraction_symmetry(), blender::bke::DynamicPointAttributeProvider::try_get_for_read(), blender::bke::DynamicPointAttributeProvider::try_get_for_write(), UniformVertexWeight::UniformVertexWeight(), VoronoiVertexWeight::VoronoiVertexWeight(), blender::geometry::weld_edge_ctx_alloc(), blender::geometry::weld_poly_loop_ctx_alloc(), blender::geometry::weld_vert_ctx_alloc_and_setup(), and blender::io::obj::write_mesh_objects().

◆ resize() [1/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::resize ( const int64_t  new_size)
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 353 of file BLI_vector.hh.

References BLI_assert, blender::default_construct_n(), blender::destruct_n(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and UPDATE_VECTOR_SIZE.

Referenced by blender::io::obj::MTLWriter::add_materials(), blender::gpu::GLQueryPool::begin_query(), blender::io::obj::OBJMesh::calc_poly_order(), NURBSpline::calculate_basis_cache(), blender::bke::curves::nurbs::calculate_basis_cache(), NURBSpline::calculate_knots(), BezierSpline::control_point_offsets(), Spline::evaluated_lengths(), BezierSpline::evaluated_mappings(), blender::bke::CurvesGeometry::evaluated_normals(), blender::fn::execute_call_instruction(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::initialize_node_state(), blender::io::obj::linked_sockets_to_dest_id(), merge_uvs_for_vertex(), mesh_init_origspace(), blender::Vector< T, InlineBufferCapacity, Allocator >::reinitialize(), InstancesComponent::resize(), CurveEval::resize(), BezierSpline::resize(), NURBSpline::resize(), PolySpline::resize(), blender::IndexMask::slice_and_offset(), blender::tests::TEST(), blender::render::texturemargin::TextureMarginMap::TextureMarginMap(), blender::io::obj::OBJWriter::write_poly_elements(), and zlib_compress().

◆ resize() [2/2]

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
void blender::Vector< T, InlineBufferCapacity, Allocator >::resize ( const int64_t  new_size,
const T value 
)
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 374 of file BLI_vector.hh.

References BLI_assert, blender::destruct_n(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::uninitialized_fill_n(), and UPDATE_VECTOR_SIZE.

◆ size()

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
int64_t blender::Vector< T, InlineBufferCapacity, Allocator >::size ( ) const
inline

Return how many values are currently stored in the vector.

Definition at line 694 of file BLI_vector.hh.

References BLI_assert.

Referenced by CurveEval::accumulated_spline_lengths(), blender::fn::MFProcedureBuilder::add_call(), blender::geometry::add_curves_on_mesh(), blender::nodes::node_geo_dual_mesh_cc::add_edge(), blender::io::obj::MTLWriter::add_materials(), VolumeUniformBufPool::alloc(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index_as(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times(), GPUCodegenCreateInfo::NameBuffer::append_sampler_name(), CurveEval::assert_valid_point_attributes(), asset_operation_get_id_vec_stats_from_context(), blender::gpu::GLQueryPool::begin_query(), BKE_volume_grid_selection_surface(), BKE_volume_grid_wireframe(), BLI_string_search_query(), blender::nodes::SeparateRGBAFunction::call(), blender::nodes::node_shader_sepcomb_xyz_cc::MF_SeparateXYZ::call(), blender::eevee::Sampling::cdf_from_curvemapping(), blender::eevee::Sampling::cdf_invert(), blender::nodes::node_geo_curve_fill_cc::cdt_to_mesh(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear_and_make_inline(), compute_interpolated_polygons(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_mesh_data_from_poly_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_mesh_data_from_poly_selection_edge_face(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_edge_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_poly_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_vertex_selection(), computed_masked_polygons(), CurveEval::control_point_offsets(), blender::bke::copy_with_removed_points(), blender::compositor::CryptomatteNode::create_cryptomatte_operation(), blender::fn::MFProcedureDotExport::create_entry_node(), blender::io::obj::MeshFromGeometry::create_mesh(), curve_eval_from_dna_curve(), blender::bke::curve_legacy_to_curves(), CustomData_blend_write_prepare(), DEG_debug_compare(), DEG_debug_consistency_check(), DEG_iterator_ids_begin(), DEG_iterator_objects_begin(), DEG_stats_simple(), blender::nodes::node_geo_dual_mesh_cc::dissolve_redundant_verts(), DRW_view_data_enabled_engine_iter_begin(), ED_spreadsheet_context_path_exists(), ED_spreadsheet_context_path_is_active(), blender::nodes::node_geo_edge_paths_to_curves_cc::edge_paths_to_curves_convert(), blender::geometry::edges_to_curve_point_indices(), blender::eevee::VelocityModule::end_sync(), blender::draw::Texture::ensure_layer_views(), blender::draw::Texture::ensure_mip_views(), CurveEval::evaluated_point_offsets(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), extract_png_from_blend_file(), blender::Vector< T, InlineBufferCapacity, Allocator >::fill(), blender::index_mask_ops::detail::find_indices_based_on_predicate__merge(), blender::nodes::geometry_nodes_eval_log::ModifierLog::find_node_by_spreadsheet_editor_context(), find_sockets_to_preview_for_spreadsheet(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), blender::compositor::ConstantFolder::fold_operations(), blender::deg::ComponentNode::get_entry_operation(), blender::deg::ComponentNode::get_exit_operation(), blender::compositor::BuffersIteratorBuilder< T >::Iterator::get_num_inputs(), blender::compositor::NodeOperation::get_number_of_input_sockets(), blender::compositor::NodeOperation::get_number_of_output_sockets(), blender::compositor::get_operation_dependencies(), blender::nodes::node_geo_string_to_curves_cc::get_text_layout(), GPU_debug_get_groups_names(), GPU_debug_group_begin(), group_verify_socket_list(), blender::render::texturemargin::TextureMarginMap::grow_dijkstra(), blender::HashTableStats::HashTableStats(), blender::compositor::BuffersIteratorBuilder< T >::Iterator::in(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::initialize_node_state(), blender::Vector< T, InlineBufferCapacity, Allocator >::insert(), blender::fn::MFProcedureDotExport::instruction_to_string(), blender::bke::curves::nurbs::interpolate_to_evaluated(), blender::nodes::node_geo_join_geometry_cc::join_component_type(), NURBSpline::knots(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::ed::space_node::link_drag_search_exec_fn(), merge_uvs_for_vertex(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::modifiers::geometry_nodes::MultiInputValue::missing_values(), GeometrySet::modify_geometry_sets(), blender::ed::space_node::node_draw_extra_info_panel(), blender::nodes::node_geo_collection_info_cc::node_geo_exec(), blender::nodes::node_geo_string_join_cc::node_geo_exec(), object_clear_transform_generic_exec(), object_transform_axis_target_modal(), blender::Vector< blender::bke::AttributeKind >::operator MutableSpan< blender::bke::AttributeKind >(), blender::Vector< T, InlineBufferCapacity, Allocator >::operator MutableSpan< U >(), blender::Vector< blender::bke::AttributeKind >::operator Span< blender::bke::AttributeKind >(), blender::Vector< T, InlineBufferCapacity, Allocator >::operator Span< U >(), blender::Vector< T, InlineBufferCapacity, Allocator >::operator[](), blender::gpu::GLSharedOrphanLists::orphans_clear(), blender::nodes::node_geo_scale_elements_cc::prepare_edge_islands(), blender::nodes::node_geo_scale_elements_cc::prepare_face_islands(), blender::gpu::Shader::print_log(), blender::Vector< T, InlineBufferCapacity, Allocator >::print_stats(), blender::io::obj::OBJMesh::remap_poly_index(), blender::Vector< T, InlineBufferCapacity, Allocator >::remove(), blender::Vector< T, InlineBufferCapacity, Allocator >::remove_and_reorder(), FloatBufferCache::remove_unused_buffers(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::AddOperationExecutor::sample_projected(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::string_search::score_query_against_words(), blender::ed::sculpt_paint::select_grow::select_grow_invoke_per_curve(), blender::geometry::OrderedAttributes::size(), BezierSpline::size(), NURBSpline::size(), PolySpline::size(), blender::ed::spreadsheet::spreadsheet_context_update_tag(), blender::ed::spreadsheet::spreadsheet_filter_rows(), standard_defines(), blender::eevee::SyncModule::sync_mesh(), blender::bke::tests::TEST(), blender::tests::TEST(), blender::string_search::tests::TEST(), blender::bke::idprop::tests::test_array_to_value(), blender::bke::idprop::tests::test_idprop(), blender::bke::DynamicPointAttributeProvider::try_get_for_read(), blender::bke::DynamicPointAttributeProvider::try_get_for_write(), blender::ed::space_node::ui_node_menu_column(), blender::bke::pbvh::pixels::update_pixels(), blender::Vector< T, InlineBufferCapacity, Allocator >::Vector(), view2d_major_step_x__time(), blender::geometry::weld_mesh_context_create(), blender::geometry::weld_poly_loop_ctx_alloc(), blender::io::obj::OBJWriter::write_poly_normals(), blender::io::obj::OBJWriter::write_uv_coords(), blender::gpu::GLQueryPool::~GLQueryPool(), blender::ResourceScope::~ResourceScope(), and blender::Vector< T, InlineBufferCapacity, Allocator >::~Vector().

Friends And Related Function Documentation

◆ operator!=

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
bool operator!= ( const Vector< T, InlineBufferCapacity, Allocator > &  a,
const Vector< T, InlineBufferCapacity, Allocator > &  b 
)
friend

Definition at line 930 of file BLI_vector.hh.

◆ operator==

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
bool operator== ( const Vector< T, InlineBufferCapacity, Allocator > &  a,
const Vector< T, InlineBufferCapacity, Allocator > &  b 
)
friend

Definition at line 925 of file BLI_vector.hh.

◆ Vector

template<typename T , int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T)), typename Allocator = GuardedAllocator>
template<typename OtherT , int64_t OtherInlineBufferCapacity, typename OtherAllocator >
friend class Vector
friend

Be a friend with other vector instantiations. This is necessary to implement some memory management logic.

Definition at line 110 of file BLI_vector.hh.


The documentation for this class was generated from the following file: