|
Blender V5.3
|
#include <BLI_stack.hh>
Public Types | |
| using | value_type = T |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | size_type = int64_t |
Public Member Functions | |
| Stack (Allocator allocator={}) noexcept | |
| Stack (NoExceptConstructor, Allocator allocator={}) noexcept | |
| Stack (Span< T > values, Allocator allocator={}) | |
| Stack (const std::initializer_list< T > &values, Allocator allocator={}) | |
| Stack (const Stack &other) | |
| Stack (Stack &&other) noexcept(std::is_nothrow_move_constructible_v< T >) | |
| ~Stack () | |
| Stack & | operator= (const Stack &other) |
| Stack & | operator= (Stack &&other) |
| void | push (const T &value) |
| void | push (T &&value) |
| template<typename... ForwardT> | |
| void | push_as (ForwardT &&...value) |
| T | pop () |
| T & | peek () |
| const T & | peek () const |
| void | push_multiple (Span< T > values) |
| bool | is_empty () const |
| int64_t | size () const |
| void | clear () |
| void | clear_and_shrink () |
| bool | is_invariant_maintained () const |
| T | Type of the elements that are stored in the stack. |
| InlineBufferCapacity | The number of values that can be stored in this stack, without doing a heap allocation. Sometimes it can make sense to increase this value a lot. The memory in the inline buffer is not initialized when it is not needed. |
| Allocator | The allocator used by this stack. Should rarely be changed, except when you don't want that MEM_* is used internally. |
Definition at line 72 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::const_pointer = const T * |
Definition at line 76 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::const_reference = const T & |
Definition at line 78 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::pointer = T * |
Definition at line 75 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::reference = T & |
Definition at line 77 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::size_type = int64_t |
Definition at line 79 of file BLI_stack.hh.
| using blender::Stack< T, InlineBufferCapacity, Allocator >::value_type = T |
Definition at line 74 of file BLI_stack.hh.
|
inlinenoexcept |
Initialize an empty stack. No heap allocation is done.
Definition at line 118 of file BLI_stack.hh.
Referenced by blender::io::otio::add_nested_items(), and blender::Stack< T, InlineBufferCapacity, RawAllocator >< RawVector< FunctionRef< void()>, 0 >, 0 >::clear_and_shrink().
|
inlinenoexcept |
Definition at line 130 of file BLI_stack.hh.
|
inline |
Create a new stack that contains the given elements. The values are pushed to the stack in the order they are in the array.
Definition at line 136 of file BLI_stack.hh.
|
inline |
Create a new stack that contains the given elements. The values are pushed to the stack in the order they are in the array.
Example: Stack<int> stack = {4, 5, 6}; assert(stack.pop() == 6); assert(stack.pop() == 5);
Definition at line 150 of file BLI_stack.hh.
|
inline |
Definition at line 155 of file BLI_stack.hh.
|
inlinenoexcept |
Definition at line 164 of file BLI_stack.hh.
|
inline |
Definition at line 192 of file BLI_stack.hh.
|
inline |
Removes all elements from the stack. The memory is not freed, so it is more efficient to reuse the stack than to create a new one.
Definition at line 327 of file BLI_stack.hh.
|
inline |
Removes all elements from the stack and frees any allocated memory.
Definition at line 337 of file BLI_stack.hh.
|
inline |
Returns true when the size is zero.
Definition at line 310 of file BLI_stack.hh.
Referenced by blender::bmesh_find_doubles_by_distance_connected_impl(), blender::fn::build_multi_function_procedure_for_fields(), blender::index_mask::compute_eval_order(), blender::compositor::compute_number_of_needed_buffers(), blender::compositor::compute_schedule(), blender::deg::deg_graph_flush_visibility_flags(), blender::ed::greasepencil::dilate(), blender::fn::FieldHashDeep::ensure(), blender::ed::greasepencil::erode(), blender::index_mask::evaluate_coarse_and_split_until_segments_are_short(), blender::bke::node_structure_type_inferencing::find_dynamic_output_linked_inputs(), blender::nodes::find_origin_sockets_through_contexts(), blender::nodes::eval_log::NodeTreeLog::find_socket_value_log(), blender::nodes::find_target_sockets_through_contexts(), blender::fn::find_varying_fields(), blender::ed::greasepencil::flood_fill(), blender::geometry::foreach_connected_curve(), blender::nodes::LazyFunctionForExtractingReferenceSet::gather_references_from_field(), blender::gpu_nodes_tag(), blender::nodes::node_geo_enable_output_cc::is_linked_to_group_output(), blender::bke::iter_backwards_ex(), blender::iter_shader_to_rgba_depth_count(), blender::kdtree_find_nearest_cb(), blender::kdtree_find_nearest_n_with_len_squared_cb(), blender::kdtree_range_search_cb(), blender::kdtree_range_search_with_len_squared_cb(), blender::lib_query_unused_ids_find_used_dependencies(), blender::loose_data_gather_instanciated_objects_for_viewlayer(), blender::ui::menu_items_from_ui_create(), blender::ed::space_node::mute_links_exec(), blender::bke::node_is_connected_to_output(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::fn::preprocess_field_tree(), blender::bke::greasepencil::LayerGroup::print_nodes(), blender::ComputeContext::print_stack(), blender::geometry::ramer_douglas_peucker(), blender::ed::greasepencil::ramer_douglas_peucker_simplify(), blender::bke::pbvh::search_callback_occluded(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::bke::node_tree_runtime::toposort_from_start_node().
|
inline |
Definition at line 344 of file BLI_stack.hh.
Referenced by blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Definition at line 202 of file BLI_stack.hh.
|
inline |
Definition at line 207 of file BLI_stack.hh.
|
inline |
Get a reference to the top-most element without removing it from the stack. This invokes undefined behavior when the stack is empty.
Definition at line 265 of file BLI_stack.hh.
Referenced by blender::fn::build_multi_function_procedure_for_fields(), blender::index_mask::compute_eval_order(), blender::compositor::compute_number_of_needed_buffers(), blender::compositor::compute_schedule(), blender::geometry::foreach_connected_curve(), blender::lazy_threading::HintReceiver::HintReceiver(), blender::lazy_threading::send_hint(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::bke::node_tree_runtime::toposort_from_start_node(), blender::lazy_threading::HintReceiver::~HintReceiver(), and blender::lazy_threading::ReceiverIsolation::~ReceiverIsolation().
|
inline |
Definition at line 271 of file BLI_stack.hh.
|
inline |
Remove and return the top-most element from the stack. This invokes undefined behavior when the stack is empty.
Definition at line 244 of file BLI_stack.hh.
Referenced by blender::bmesh_find_doubles_by_distance_connected_impl(), blender::fn::build_multi_function_procedure_for_fields(), blender::index_mask::compute_eval_order(), blender::compositor::compute_number_of_needed_buffers(), blender::compositor::compute_schedule(), blender::deg::deg_graph_flush_visibility_flags(), blender::ed::greasepencil::dilate(), blender::fn::FieldHashDeep::ensure(), blender::ed::greasepencil::erode(), blender::index_mask::evaluate_coarse_and_split_until_segments_are_short(), blender::bke::node_structure_type_inferencing::find_dynamic_output_linked_inputs(), blender::nodes::find_origin_sockets_through_contexts(), blender::nodes::eval_log::NodeTreeLog::find_socket_value_log(), blender::nodes::find_target_sockets_through_contexts(), blender::fn::find_varying_fields(), blender::ed::greasepencil::flood_fill(), blender::geometry::foreach_connected_curve(), blender::nodes::LazyFunctionForExtractingReferenceSet::gather_references_from_field(), blender::gpu_nodes_tag(), blender::nodes::node_geo_enable_output_cc::is_linked_to_group_output(), blender::bke::iter_backwards_ex(), blender::iter_shader_to_rgba_depth_count(), blender::kdtree_find_nearest_cb(), blender::kdtree_find_nearest_n_with_len_squared_cb(), blender::kdtree_range_search_cb(), blender::kdtree_range_search_with_len_squared_cb(), blender::lib_query_unused_ids_find_used_dependencies(), blender::loose_data_gather_instanciated_objects_for_viewlayer(), blender::ui::menu_items_from_ui_create(), blender::ed::space_node::mute_links_exec(), blender::bke::node_is_connected_to_output(), blender::fn::multi_function::ValueAllocator::obtain_OneSingle(), blender::fn::multi_function::ValueAllocator::obtain_Span(), blender::fn::preprocess_field_tree(), blender::bke::greasepencil::LayerGroup::print_nodes(), blender::ComputeContext::print_stack(), blender::geometry::ramer_douglas_peucker(), blender::ed::greasepencil::ramer_douglas_peucker_simplify(), blender::bke::pbvh::search_callback_occluded(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::bke::node_tree_runtime::toposort_from_start_node(), and blender::lazy_threading::ReceiverIsolation::~ReceiverIsolation().
|
inline |
Add a new element to the top of the stack.
Definition at line 215 of file BLI_stack.hh.
Referenced by blender::bmesh_find_doubles_by_distance_connected_impl(), blender::fn::build_multi_function_procedure_for_fields(), blender::index_mask::compute_eval_order(), blender::compositor::compute_number_of_needed_buffers(), blender::deg::deg_graph_flush_visibility_flags(), blender::ed::greasepencil::dilate(), blender::fn::FieldHashDeep::ensure(), blender::ed::greasepencil::erode(), blender::index_mask::evaluate_coarse_and_split_until_segments_are_short(), blender::bke::node_structure_type_inferencing::find_dynamic_output_linked_inputs(), blender::nodes::find_origin_sockets_through_contexts(), blender::nodes::eval_log::NodeTreeLog::find_socket_value_log(), blender::nodes::find_target_sockets_through_contexts(), blender::fn::find_varying_fields(), blender::ed::greasepencil::flood_fill(), blender::geometry::foreach_connected_curve(), blender::nodes::LazyFunctionForExtractingReferenceSet::gather_references_from_field(), blender::compositor::get_output_nodes(), blender::gpu_nodes_tag(), blender::nodes::node_geo_enable_output_cc::is_linked_to_group_output(), blender::bke::iter_backwards_ex(), blender::iter_shader_to_rgba_depth_count(), blender::kdtree_find_nearest_cb(), blender::kdtree_find_nearest_n_with_len_squared_cb(), blender::kdtree_range_search_cb(), blender::kdtree_range_search_with_len_squared_cb(), blender::lib_query_unused_ids_find_used_dependencies(), blender::ui::menu_items_from_ui_create(), blender::ui::menu_types_add_from_keymap_items(), blender::bke::node_is_connected_to_output(), blender::fn::preprocess_field_tree(), blender::bke::greasepencil::LayerGroup::print_nodes(), blender::ComputeContext::print_stack(), blender::geometry::ramer_douglas_peucker(), blender::ed::greasepencil::ramer_douglas_peucker_simplify(), blender::fn::multi_function::ValueAllocator::release_value(), blender::bke::pbvh::search_callback_occluded(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::bke::node_tree_runtime::toposort_from_start_node().
|
inline |
Definition at line 219 of file BLI_stack.hh.
|
inline |
Definition at line 224 of file BLI_stack.hh.
Referenced by blender::loose_data_gather_instanciated_objects_for_viewlayer(), blender::lazy_threading::ReceiverIsolation::ReceiverIsolation(), and blender::tests::TEST().
|
inline |
Add multiple elements to the stack. The values are pushed in the order they are in the array. This method is more efficient than pushing multiple elements individually and might cause less heap allocations.
Definition at line 283 of file BLI_stack.hh.
Referenced by blender::compositor::compute_schedule(), blender::ed::space_node::mute_links_exec(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Returns the number of elements in the stack.
Definition at line 318 of file BLI_stack.hh.
Referenced by blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().