#include <BLI_span.hh>
template<typename
T>
class Span< T >
References an array of type T that is owned by someone else. The data in the array cannot be modified.
- Examples
- /usr/src/RPM/BUILD/blender5.3-5.3.0/source/blender/blenkernel/BKE_grease_pencil.hh.
Definition at line 74 of file BLI_span.hh.
◆ const_pointer
◆ const_reference
◆ iterator
◆ pointer
◆ reference
◆ size_type
◆ value_type
◆ Span() [1/7]
Create a reference to an empty array.
Referenced by blender::BKE_armature_deform_coords_with_mesh(), blender::BKE_attribute_domain(), blender::BKE_attribute_from_index(), blender::BKE_attribute_to_index(), blender::blend_write(), blender::draw::bmesh_normals_domain(), blender::bke::pbvh::pixels::copy_pixels(), blender::depends_on_time(), blender::draw::extract_vert_idx_loose_geom_subdiv(), blender::nodes::get_bake_draw_context(), main(), blender::bke::mesh_skin_to_legacy(), blender::bke::mix_deform_verts(), blender::node_interface_single_value_to_structure_type(), blender::object_asset_dimensions_property(), blender::Vector< BMVert *, 64 >::operator Span< BMVert * >(), blender::Vector< SubdivCCGCoord, 256 >::operator Span< U >(), blender::ed::animation::pastebuf_find_matching_copybuf_item(), blender::bke::GreasePencilDrawingEditHints::positions(), blender::io::usd::USDBasisCurvesReader::read_curve_sample(), blender::sculptsession_update(), blender::GVMutableArrayImpl_For_VMutableArray< T >::set_all(), blender::geometry::sort_indices_by_weights(), blender::ed::spreadsheet::spreadsheet_table_move_to_front(), blender::ed::spreadsheet::spreadsheet_table_remove_unused_columns(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), and blender::update_depsgraph().
◆ Span() [2/7]
◆ Span() [3/7]
template<typename
U>
requires (is_span_convertible_pointer_v<
U,
T>)
◆ Span() [4/7]
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 118 of file BLI_span.hh.
◆ Span() [5/7]
◆ Span() [6/7]
◆ Span() [7/7]
template<typename
U>
requires (is_span_convertible_pointer_v<
U,
T>)
◆ begin()
◆ cast()
Returns a new Span to the same underlying memory buffer. No conversions are done.
Definition at line 422 of file BLI_span.hh.
◆ contains()
Does a linear search to see of the value is in the array. Returns true if it is, otherwise false.
Definition at line 281 of file BLI_span.hh.
◆ contains_ptr()
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 295 of file BLI_span.hh.
◆ count()
Does a linear search to count how often the value is in the array. Returns the number of occurrences.
Definition at line 304 of file BLI_span.hh.
◆ data()
Returns the pointer to the beginning of the referenced array. This may be nullptr when the size is zero.
Definition at line 219 of file BLI_span.hh.
◆ drop_back()
Returns a new Span with n elements removed from the end. This invokes undefined behavior when n is negative.
Definition at line 186 of file BLI_span.hh.
◆ drop_front()
Returns a new Span with n elements removed from the beginning. This invokes undefined behavior when n is negative.
Definition at line 175 of file BLI_span.hh.
◆ end()
◆ first()
Return a reference to the first element in the array. This invokes undefined behavior when the array is empty.
Definition at line 319 of file BLI_span.hh.
◆ first_index()
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 381 of file BLI_span.hh.
◆ first_index_try()
Returns the index of the first occurrence of the given value or -1 if it does not exist.
Definition at line 391 of file BLI_span.hh.
◆ has_duplicates__linear_search()
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 340 of file BLI_span.hh.
◆ hash()
◆ index_range()
Utility to make it more convenient to iterate over all indices that can be used with this array.
Definition at line 405 of file BLI_span.hh.
◆ intersects__linear_search()
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 362 of file BLI_span.hh.
◆ is_empty()
Returns true if the size is zero.
Definition at line 264 of file BLI_span.hh.
◆ last()
Returns a reference to the nth last element. This invokes undefined behavior when the span is too short.
Definition at line 329 of file BLI_span.hh.
◆ operator[]()
Access an element in the array. This invokes undefined behavior when the index is out of bounds.
Definition at line 246 of file BLI_span.hh.
◆ rbegin()
◆ rend()
◆ size()
Returns the number of elements in the referenced array.
Definition at line 256 of file BLI_span.hh.
◆ size_in_bytes()
Returns the number of bytes referenced by this Span.
Definition at line 272 of file BLI_span.hh.
◆ slice() [1/2]
◆ slice() [2/2]
Returns a contiguous part of the array. This invokes undefined behavior when the start or size is negative.
Definition at line 141 of file BLI_span.hh.
◆ slice_safe() [1/2]
Returns a contiguous part of the array. This invokes undefined behavior when the start or size is negative. Clamps the size of the new span so it fits in the current one.
Definition at line 158 of file BLI_span.hh.
◆ slice_safe() [2/2]
◆ take_back()
Returns a new Span that only contains the last n elements. This invokes undefined behavior when n is negative.
Definition at line 208 of file BLI_span.hh.
◆ take_front()
Returns a new Span that only contains the first n elements. This invokes undefined behavior when n is negative.
Definition at line 197 of file BLI_span.hh.
◆ operator!=
◆ operator==
| bool operator== |
( |
const Span< T > | a, |
|
|
const Span< T > | b ) |
|
friend |
◆ data_
◆ size_
The documentation for this class was generated from the following files: