Blender  V3.3
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
blender::Span< T > Class Template Reference

#include <BLI_span.hh>

Inheritance diagram for blender::Span< T >:
blender::VArraySpan< bool > blender::VArraySpan< T >

Public Types

using value_type = T
 
using pointer = T *
 
using const_pointer = const T *
 
using reference = T &
 
using const_reference = const T &
 
using iterator = const T *
 
using size_type = int64_t
 

Public Member Functions

constexpr Span ()=default
 
constexpr Span (const T *start, int64_t size)
 
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >)) >
constexpr Span (const U *start, int64_t size)
 
constexpr Span (const std::initializer_list< T > &list)
 
constexpr Span (const std::vector< T > &vector)
 
template<std::size_t N>
constexpr Span (const std::array< T, N > &array)
 
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >)) >
constexpr Span (Span< U > span)
 
constexpr Span slice (int64_t start, int64_t size) const
 
constexpr Span slice (IndexRange range) const
 
constexpr Span drop_front (int64_t n) const
 
constexpr Span drop_back (int64_t n) const
 
constexpr Span take_front (int64_t n) const
 
constexpr Span take_back (int64_t n) const
 
constexpr const Tdata () const
 
constexpr const Tbegin () const
 
constexpr const Tend () const
 
constexpr std::reverse_iterator< const T * > rbegin () const
 
constexpr std::reverse_iterator< const T * > rend () const
 
constexpr const Toperator[] (int64_t index) const
 
constexpr int64_t size () const
 
constexpr bool is_empty () const
 
constexpr int64_t size_in_bytes () const
 
constexpr bool contains (const T &value) const
 
constexpr bool contains_ptr (const T *ptr) const
 
constexpr int64_t count (const T &value) const
 
constexpr const Tfirst () const
 
constexpr const Tlast (const int64_t n=0) const
 
constexpr T get (int64_t index, const T &fallback) const
 
constexpr bool has_duplicates__linear_search () const
 
constexpr bool intersects__linear_search (Span other) const
 
constexpr int64_t first_index (const T &search_value) const
 
constexpr int64_t first_index_try (const T &search_value) const
 
constexpr IndexRange index_range () const
 
template<typename NewT >
constexpr Span< NewT > cast () const
 
template<typename PrintLineF >
void print_as_lines (std::string name, PrintLineF print_line) const
 
void print_as_lines (std::string name) const
 

Protected Attributes

const Tdata_ = nullptr
 
int64_t size_ = 0
 

Friends

bool operator== (const Span< T > a, const Span< T > b)
 
bool operator!= (const Span< T > a, const Span< T > b)
 

Detailed Description

template<typename T>
class blender::Span< T >

References an array of type T that is owned by someone else. The data in the array cannot be modified.

Definition at line 73 of file BLI_span.hh.

Member Typedef Documentation

◆ const_pointer

template<typename T >
using blender::Span< T >::const_pointer = const T *

Definition at line 77 of file BLI_span.hh.

◆ const_reference

template<typename T >
using blender::Span< T >::const_reference = const T &

Definition at line 79 of file BLI_span.hh.

◆ iterator

template<typename T >
using blender::Span< T >::iterator = const T *

Definition at line 80 of file BLI_span.hh.

◆ pointer

template<typename T >
using blender::Span< T >::pointer = T *

Definition at line 76 of file BLI_span.hh.

◆ reference

template<typename T >
using blender::Span< T >::reference = T &

Definition at line 78 of file BLI_span.hh.

◆ size_type

template<typename T >
using blender::Span< T >::size_type = int64_t

Definition at line 81 of file BLI_span.hh.

◆ value_type

template<typename T >
using blender::Span< T >::value_type = T

Definition at line 75 of file BLI_span.hh.

Constructor & Destructor Documentation

◆ Span() [1/7]

template<typename T >
constexpr blender::Span< T >::Span ( )
constexprdefault

◆ Span() [2/7]

template<typename T >
constexpr blender::Span< T >::Span ( const T start,
int64_t  size 
)
inlineconstexpr

Definition at line 93 of file BLI_span.hh.

References BLI_assert, and blender::Span< T >::size().

◆ Span() [3/7]

template<typename T >
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >)) >
constexpr blender::Span< T >::Span ( const U start,
int64_t  size 
)
inlineconstexpr

Definition at line 99 of file BLI_span.hh.

References BLI_assert, and blender::Span< T >::size().

◆ Span() [4/7]

template<typename T >
constexpr blender::Span< T >::Span ( const std::initializer_list< T > &  list)
inlineconstexpr

Reference an initializer_list. Note that the data in the initializer_list is only valid until the expression containing it is fully computed.

Do: call_function_with_array({1, 2, 3, 4});

Don't: Span<int> span = {1, 2, 3, 4}; call_function_with_array(span);

Definition at line 115 of file BLI_span.hh.

◆ Span() [5/7]

template<typename T >
constexpr blender::Span< T >::Span ( const std::vector< T > &  vector)
inlineconstexpr

Definition at line 120 of file BLI_span.hh.

◆ Span() [6/7]

template<typename T >
template<std::size_t N>
constexpr blender::Span< T >::Span ( const std::array< T, N > &  array)
inlineconstexpr

Definition at line 125 of file BLI_span.hh.

◆ Span() [7/7]

template<typename T >
template<typename U , BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >)) >
constexpr blender::Span< T >::Span ( Span< U span)
inlineconstexpr

Support implicit conversions like the one below: Span<T *> -> Span<const T *>

Definition at line 134 of file BLI_span.hh.

Member Function Documentation

◆ begin()

template<typename T >
constexpr const T* blender::Span< T >::begin ( ) const
inlineconstexpr

◆ cast()

template<typename T >
template<typename NewT >
constexpr Span<NewT> blender::Span< T >::cast ( ) const
inlineconstexpr

Returns a new Span to the same underlying memory buffer. No conversions are done.

Definition at line 409 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, blender::Span< T >::size_, and T.

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

◆ contains()

template<typename T >
constexpr bool blender::Span< T >::contains ( const T value) const
inlineconstexpr

◆ contains_ptr()

template<typename T >
constexpr bool blender::Span< T >::contains_ptr ( const T ptr) const
inlineconstexpr

Does a constant time check to see if the pointer points to a value in the referenced array. Return true if it is, otherwise false.

Definition at line 279 of file BLI_span.hh.

References blender::Span< T >::begin(), blender::Span< T >::end(), and ptr.

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

◆ count()

template<typename T >
constexpr int64_t blender::Span< T >::count ( const T value) const
inlineconstexpr

Does a linear search to count how often the value is in the array. Returns the number of occurrences.

Definition at line 288 of file BLI_span.hh.

References counter, element, and T.

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

◆ data()

template<typename T >
constexpr const T* blender::Span< T >::data ( ) const
inlineconstexpr

◆ drop_back()

template<typename T >
constexpr Span blender::Span< T >::drop_back ( int64_t  n) const
inlineconstexpr

Returns a new Span with n elements removed from the beginning. This invokes undefined behavior when n is negative.

Definition at line 170 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, blender::Span< T >::size_, and blender::Span< T >::Span().

Referenced by compute_geometry(), blender::nodes::geometry_nodes_eval_log::ModifierLog::find_node_by_spreadsheet_editor_context(), and blender::tests::TEST().

◆ drop_front()

template<typename T >
constexpr Span blender::Span< T >::drop_front ( int64_t  n) const
inlineconstexpr

◆ end()

template<typename T >
constexpr const T* blender::Span< T >::end ( ) const
inlineconstexpr

◆ first()

template<typename T >
constexpr const T& blender::Span< T >::first ( ) const
inlineconstexpr

◆ first_index()

template<typename T >
constexpr int64_t blender::Span< T >::first_index ( const T search_value) const
inlineconstexpr

Returns the index of the first occurrence of the given value. This invokes undefined behavior when the value is not in the array.

Definition at line 377 of file BLI_span.hh.

References BLI_assert, and blender::Span< T >::first_index_try().

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

◆ first_index_try()

template<typename T >
constexpr int64_t blender::Span< T >::first_index_try ( const T search_value) const
inlineconstexpr

Returns the index of the first occurrence of the given value or -1 if it does not exist.

Definition at line 387 of file BLI_span.hh.

References blender::Span< T >::data_, and blender::Span< T >::size_.

Referenced by blender::Span< T >::first_index().

◆ get()

template<typename T >
constexpr T blender::Span< T >::get ( int64_t  index,
const T fallback 
) const
inlineconstexpr

Returns the element at the given index. If the index is out of range, return the fallback value.

Definition at line 324 of file BLI_span.hh.

References blender::Span< T >::data_.

Referenced by compute_vertex_mask__armature_mode(), and blender::tests::TEST().

◆ has_duplicates__linear_search()

template<typename T >
constexpr bool blender::Span< T >::has_duplicates__linear_search ( ) const
inlineconstexpr

Check if the array contains duplicates. Does a linear search for every element. So the total running time is O(n^2). Only use this for small arrays.

Definition at line 336 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, blender::Span< T >::size_, and T.

◆ index_range()

template<typename T >
constexpr IndexRange blender::Span< T >::index_range ( ) const
inlineconstexpr

Utility to make it more convenient to iterate over all indices that can be used with this array.

Definition at line 401 of file BLI_span.hh.

References blender::Span< T >::size_.

Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), add_interpolated_polys_to_new_mesh(), attribute_search_update_fn(), blender::geometry::bezier_positions_to_nurbs(), bm_face_create_from_mpoly(), blender::geometry::calculate_angles(), blender::geometry::calculate_bezier_handles_bezier_mode(), blender::geometry::calculate_bezier_handles_poly_mode(), blender::geometry::calculate_fillet_positions(), blender::nodes::calculate_uvs(), blender::geometry::catmull_rom_to_bezier_handles(), blender::nodes::node_geo_distribute_points_on_faces_cc::compute_attribute_outputs(), compute_interpolated_polygons(), blender::nodes::node_geo_delete_geometry_cc::copy_data_based_on_map(), blender::bke::copy_indices_to_offset_ranges(), blender::nodes::node_geo_delete_geometry_cc::copy_masked_polys_to_new_mesh(), copy_masked_vertices_to_new_mesh(), blender::nodes::node_geo_delete_geometry_cc::copy_masked_vertices_to_new_mesh(), blender::bke::curves::copy_point_data(), blender::nodes::node_geo_input_mesh_edge_angle_cc::create_edge_map(), blender::ed::space_node::create_inspection_string_for_gfield(), blender::nodes::node_geo_extrude_mesh_cc::create_vert_to_edge_map(), curves_batch_cache_fill_segments_proc_pos(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_byte_color(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float_vector(), ED_spreadsheet_context_path_exists(), blender::fn::evaluate_fields(), blender::ed::sculpt_paint::ShrinkCurvesEffect::execute(), blender::ed::sculpt_paint::ScaleCurvesEffect::execute(), 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::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::bke::curves::fill_curve_counts(), blender::fn::find_varying_fields(), blender::geometry::gather_realize_tasks_for_instances(), generate_unique_instance_ids(), blender::string_search::get_shortest_word_index_that_startswith(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::string_search::get_word_index_that_fuzzy_matches(), blender::IndexMask::index_range(), blender::bke::curves::nurbs::interpolate_to_evaluated(), interpolate_to_evaluated_impl(), blender::bke::curves::nurbs::interpolate_to_evaluated_rational(), blender::nodes::node_geo_join_geometry_cc::join_components(), make_duplis_geometry_set_impl(), blender::bke::VArray_For_SplineToPoint< T >::materialize(), blender::bke::VArray_For_SplineToPoint< T >::materialize_to_uninitialized(), blender::nodes::node_geo_extrude_mesh_cc::mesh_calculate_polys_of_edge(), blender::bounds::min_max(), blender::bounds::min_max_with_radii(), blender::ed::space_node::node_draw_nodetree(), blender::ed::space_node::node_uiblocks_init(), blender::ed::space_node::node_update_nodetree(), blender::ed::sculpt_paint::PinchOperationExecutor::restore_segment_lengths(), blender::geometry::retrieve_attribute_spans(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::geometry::ReverseUVSampler::sample_many(), blender::nodes::node_geo_scale_elements_cc::scale_vertex_islands_on_axis(), blender::nodes::node_geo_scale_elements_cc::scale_vertex_islands_uniformly(), blender::string_search::score_query_against_words(), blender::nodes::search_link_ops_for_declarations(), blender::bke::curves::bezier::segment_is_vector(), selected_indices_from_vertex_group(), selection_array_from_vertex_group(), blender::fn::MFCallInstruction::set_params(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::geometry::subdivide_bezier_positions(), blender::ui::template_breadcrumbs(), blender::bke::tests::TEST(), blender::length_parameterize::tests::test_uniform_lengths(), blender::nodes::node_geo_duplicate_elements_cc::threaded_mapped_copy(), blender::nodes::node_geo_distribute_points_on_faces_cc::update_elimination_mask_based_on_density_factors(), blender::geometry::weld_edge_ctx_alloc(), blender::geometry::weld_poly_loop_ctx_alloc(), blender::geometry::weld_vert_ctx_alloc_and_setup(), and blender::geometry::weld_vert_groups_setup().

◆ intersects__linear_search()

template<typename T >
constexpr bool blender::Span< T >::intersects__linear_search ( Span< T other) const
inlineconstexpr

Returns true when this and the other array have an element in common. This should only be called on small arrays, because it has a running time of O(n*m) where n and m are the sizes of the arrays.

Definition at line 358 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::contains(), blender::Span< T >::data_, blender::Span< T >::size_, and T.

◆ is_empty()

template<typename T >
constexpr bool blender::Span< T >::is_empty ( ) const
inlineconstexpr

Returns true if the size is zero.

Definition at line 248 of file BLI_span.hh.

References blender::Span< T >::size_.

Referenced by blender::fn::MFProcedureBuilder::add_call(), calculate_weld(), blender::nodes::GeoNodeExecParams::check_input_geometry_set(), compute_geometry(), blender::IndexMask::contained_in(), blender::compositor::NodeOperationBuilder::convert_to_operations(), blender::ed::space_node::create_inspection_string_for_geometry(), blender::ed::space_node::create_inspection_string_for_gfield(), blender::geometry::create_result_ids(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float_vector(), ED_spreadsheet_context_path_exists(), ED_spreadsheet_context_path_is_active(), blender::fn::evaluate_fields(), blender::bke::CurvesGeometry::evaluated_length_total_for_curve(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::fn::materialize_detail::execute_materialized(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_mesh_tasks(), blender::geometry::execute_realize_pointcloud_tasks(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::forward_to_sockets_with_same_type(), blender::geometry::gather_realize_tasks_for_instances(), blender::IndexMask::indices_are_valid_index_mask(), blender::IndexMask::invert(), blender::IndexMask::is_empty(), Spline::length(), blender::geometry::mesh_merge_by_distance_connected(), blender::bounds::min_max(), blender::bounds::min_max_with_radii(), modifyGeometry(), blender::ed::space_node::node_add_error_message_button(), blender::nodes::NodeTreeRef::NodeTreeRef(), blender::Stack< T, InlineBufferCapacity, Allocator >::push_multiple(), blender::nodes::node_geo_distribute_points_on_faces_cc::sample_mesh_surface(), blender::ed::curves::snap_curves_to_surface::snap_curves_to_surface_exec_object(), blender::tests::TEST(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), and blender::bke::NodeTreeMainUpdater::update_rooted().

◆ last()

template<typename T >
constexpr const T& blender::Span< T >::last ( const int64_t  n = 0) const
inlineconstexpr

Returns a reference to the nth last element. This invokes undefined behavior when the span is too short.

Definition at line 313 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, and blender::Span< T >::size_.

Referenced by blender::length_parameterize::accumulate_lengths(), blender::geometry::calculate_angles(), blender::bke::curves::bezier::calculate_auto_handles(), blender::bke::curves::bezier::calculate_evaluated_positions(), blender::geometry::catmull_rom_to_bezier_handles(), blender::IndexMask::contained_in(), blender::ed::space_node::create_inspection_string_for_geometry(), ED_spreadsheet_context_path_is_active(), blender::bke::CurvesGeometry::evaluated_length_total_for_curve(), blender::bke::CurvesGeometry::evaluated_points_num(), BezierSpline::evaluated_points_num(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_mesh_tasks(), blender::geometry::execute_realize_pointcloud_tasks(), blender::geometry::fillet_curves(), blender::nodes::geometry_nodes_eval_log::ModifierLog::find_node_by_spreadsheet_editor_context(), blender::io::obj::fixup_invalid_polygon(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::IndexMask::is_range(), blender::IndexMask::last(), blender::bke::curves::bezier::last_cyclic_segment_is_vector(), Spline::length(), blender::geometry::limit_radii(), blender::IndexMask::min_array_size(), blender::bke::point_attribute_materialize(), blender::bke::point_attribute_materialize_to_uninitialized(), blender::length_parameterize::sample_at_length(), blender::nodes::node_geo_curve_sample_cc::sample_indices_and_factors_to_compressed(), blender::nodes::node_geo_curve_sample_cc::sample_indices_and_lengths(), blender::length_parameterize::sample_uniform(), blender::geometry::subdivide_curves(), blender::tests::TEST(), blender::length_parameterize::tests::test_uniform_lengths(), blender::nodes::node_geo_duplicate_elements_cc::threaded_id_offset_copy(), and blender::nodes::node_geo_duplicate_elements_cc::threaded_slice_fill().

◆ operator[]()

template<typename T >
constexpr const T& blender::Span< T >::operator[] ( int64_t  index) const
inlineconstexpr

Access an element in the array. This invokes undefined behavior when the index is out of bounds.

Definition at line 230 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, and blender::Span< T >::size_.

◆ print_as_lines() [1/2]

template<typename T >
void blender::Span< T >::print_as_lines ( std::string  name) const
inline

A debug utility to print the content of the span. Every element be printed on a separate line.

Definition at line 447 of file BLI_span.hh.

References blender::Span< T >::print_as_lines(), and T.

◆ print_as_lines() [2/2]

template<typename T >
template<typename PrintLineF >
void blender::Span< T >::print_as_lines ( std::string  name,
PrintLineF  print_line 
) const
inline

A debug utility to print the content of the Span. Every element will be printed on a separate line using the given callback.

Definition at line 433 of file BLI_span.hh.

References blender::Span< T >::size_, and T.

Referenced by blender::Span< T >::print_as_lines().

◆ rbegin()

template<typename T >
constexpr std::reverse_iterator<const T *> blender::Span< T >::rbegin ( ) const
inlineconstexpr

Definition at line 217 of file BLI_span.hh.

References blender::Span< T >::end().

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

◆ rend()

template<typename T >
constexpr std::reverse_iterator<const T *> blender::Span< T >::rend ( ) const
inlineconstexpr

Definition at line 221 of file BLI_span.hh.

References blender::Span< T >::begin().

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

◆ size()

template<typename T >
constexpr int64_t blender::Span< T >::size ( ) const
inlineconstexpr

Returns the number of elements in the referenced array.

Definition at line 240 of file BLI_span.hh.

References blender::Span< T >::size_.

Referenced by blender::length_parameterize::accumulate_lengths(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), add_interp_verts_copy_edges_to_new_mesh(), add_interpolated_polys_to_new_mesh(), InstancesComponent::almost_unique_ids(), blender::IndexMask::as_range(), attribute_search_update_fn(), bm_face_create_from_mpoly(), blender::fn::build_multi_function_procedure_for_fields(), calculate_basis_for_point(), blender::bke::curves::nurbs::calculate_basis_for_point(), blender::bke::curves::bezier::calculate_evaluated_offsets(), blender::bke::curves::bezier::calculate_evaluated_positions(), NURBSpline::calculate_knots(), blender::length_parameterize::tests::calculate_lengths(), blender::geometry::catmull_rom_to_bezier_handles(), blender::geometry::catmull_rom_to_nurbs_positions(), compute_interpolated_polygons(), compute_masked_vertices(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_edges_from_edge_selection(), 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_poly_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_polygons_from_vertex_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_vertices_and_edges_from_edge_selection(), blender::nodes::node_geo_delete_geometry_cc::compute_selected_vertices_from_vertex_selection(), computed_masked_polygons(), blender::IndexMask::contained_in(), blender::MutableSpan< T >::copy_from(), blender::nodes::node_geo_delete_geometry_cc::copy_masked_edges_to_new_mesh(), copy_masked_edges_to_new_mesh(), copy_masked_vertices_to_new_mesh(), blender::nodes::node_geo_delete_geometry_cc::copy_masked_vertices_to_new_mesh(), blender::bke::idprop::create_array(), blender::geometry::create_curve_from_vert_indices(), blender::ed::space_node::create_inspection_string_for_gfield(), blender::geometry::create_nurbs_to_bezier_handles(), blender::gpu::ShaderInterface::debug_print(), blender::meshintersect::direct_mesh_boolean(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_byte_color(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float_vector(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), ED_spreadsheet_context_path_is_active(), blender::fn::evaluate_fields(), blender::VectorAdaptor< T >::extend(), blender::draw::extract_lines_loose_geom_subdiv(), blender::IndexMask::extract_ranges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::geometry::find_curve_neighbors(), blender::ed::curves::convert_to_particle_system::find_mface_for_root_position(), blender::io::obj::fixup_invalid_polygon(), blender::VArray< T >::ForDerivedSpan(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::forward_to_sockets_with_same_type(), generate_unique_instance_ids(), blender::nodes::DOutputSocket::get_active_corresponding_group_output_socket(), get_dupliface_transform_from_coords(), gpu_select_query_end(), blender::IndexMask::indices_are_valid_index_mask(), blender::geometry::interpolate_position_with_interpolation(), blender::geometry::interpolate_position_without_interpolation(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::length_parameterize::interpolate_to_masked(), blender::IndexMask::invert(), blender::IndexMask::is_range(), blender::nodes::node_geo_join_geometry_cc::join_components(), blender::io::obj::linked_sockets_to_dest_id(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::log_socket_value(), blender::nodes::geometry_nodes_eval_log::NodeLog::lookup_socket_log(), blender::string_search::match_word_initials(), merge_uvs_for_vertex(), blender::bke::mesh_surface_sample::MeshAttributeInterpolator::MeshAttributeInterpolator(), blender::IndexMask::min_array_size(), blender::bounds::min_max_with_radii(), modifyGeometry(), blender::fn::procedure_optimization::move_destructs_up(), blender::ed::space_node::node_uiblocks_init(), blender::nodes::NodeTreeRef::NodeTreeRef(), blender::dot::NodeWithSocketsRef::NodeWithSocketsRef(), blender::bke::offsets_to_range(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::gpu::Shader::print_log(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::Stack< T, InlineBufferCapacity, Allocator >::push_multiple(), blender::bke::CustomDataAttributes::reorder(), blender::geometry::ReverseUVSampler::ReverseUVSampler(), blender::length_parameterize::sample_at_length(), blender::length_parameterize::sample_at_lengths(), blender::geometry::ReverseUVSampler::sample_many(), blender::length_parameterize::sample_uniform(), Spline::sample_uniform_index_factors(), blender::string_search::score_query_against_words(), selection_array_from_vertex_group(), blender::fn::MFCallInstruction::set_params(), blender::io::obj::set_property_of_socket(), blender::IndexMask::size(), blender::Span< T >::slice(), blender::Span< T >::Span(), blender::bke::tests::TEST(), blender::tests::TEST(), blender::tests::test_ref_from_initializer_list(), blender::length_parameterize::tests::test_uniform_lengths(), blender::nodes::node_geo_duplicate_elements_cc::threaded_id_offset_copy(), blender::nodes::node_geo_duplicate_elements_cc::threaded_slice_fill(), blender::nodes::toposort_from_start_node(), blender::gpu::GLShader::transform_feedback_names_set(), blender::bke::BuiltinPointAttributeProvider< T >::try_get_for_read(), blender::bke::DynamicPointAttributeProvider::try_get_for_read(), blender::bke::NodeTreeMainUpdater::update_rooted(), blender::VArray< T >::VArray(), blender::nodes::node_geo_extrude_mesh_cc::vert_indices_from_edges(), blender::geometry::weld_edge_ctx_alloc(), blender::geometry::weld_poly_loop_ctx_alloc(), blender::geometry::weld_vert_ctx_alloc_and_setup(), and blender::geometry::weld_vert_groups_setup().

◆ size_in_bytes()

template<typename T >
constexpr int64_t blender::Span< T >::size_in_bytes ( ) const
inlineconstexpr

Returns the number of bytes referenced by this Span.

Definition at line 256 of file BLI_span.hh.

References blender::Span< T >::size_, and T.

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

◆ slice() [1/2]

template<typename T >
constexpr Span blender::Span< T >::slice ( IndexRange  range) const
inlineconstexpr

◆ slice() [2/2]

template<typename T >
constexpr Span blender::Span< T >::slice ( int64_t  start,
int64_t  size 
) const
inlineconstexpr

◆ take_back()

template<typename T >
constexpr Span blender::Span< T >::take_back ( int64_t  n) const
inlineconstexpr

Returns a new Span that only contains the last n elements. This invokes undefined behavior when n is negative.

Definition at line 192 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, blender::Span< T >::size_, and blender::Span< T >::Span().

Referenced by blender::nodes::node_geo_edge_paths_to_curves_cc::edge_paths_to_curves_convert(), blender::length_parameterize::tests::TEST(), and blender::tests::TEST().

◆ take_front()

template<typename T >
constexpr Span blender::Span< T >::take_front ( int64_t  n) const
inlineconstexpr

Returns a new Span that only contains the first n elements. This invokes undefined behavior when n is negative.

Definition at line 181 of file BLI_span.hh.

References BLI_assert, blender::Span< T >::data_, blender::Span< T >::size_, and blender::Span< T >::Span().

Referenced by blender::InplacePriorityQueue< T, FirstHasHigherPriority >::active_indices(), and blender::tests::TEST().

Friends And Related Function Documentation

◆ operator!=

template<typename T >
bool operator!= ( const Span< T a,
const Span< T b 
)
friend

Definition at line 424 of file BLI_span.hh.

◆ operator==

template<typename T >
bool operator== ( const Span< T a,
const Span< T b 
)
friend

Definition at line 416 of file BLI_span.hh.

Member Data Documentation

◆ data_

template<typename T >
const T* blender::Span< T >::data_ = nullptr
protected

◆ size_

template<typename T >
int64_t blender::Span< T >::size_ = 0
protected

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