Blender
V3.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 () |
bool | is_invariant_maintained () const |
Definition at line 68 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::const_pointer = const T * |
Definition at line 72 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::const_reference = const T & |
Definition at line 74 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::pointer = T * |
Definition at line 71 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::reference = T & |
Definition at line 73 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::size_type = int64_t |
Definition at line 75 of file BLI_stack.hh.
using blender::Stack< T, InlineBufferCapacity, Allocator >::value_type = T |
Definition at line 70 of file BLI_stack.hh.
|
inlinenoexcept |
Initialize an empty stack. No heap allocation is done.
Definition at line 114 of file BLI_stack.hh.
|
inlinenoexcept |
Definition at line 126 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 134 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 148 of file BLI_stack.hh.
|
inline |
Definition at line 153 of file BLI_stack.hh.
References blender::StackChunk< T >::above, and T.
|
inlinenoexcept |
Definition at line 162 of file BLI_stack.hh.
References blender::StackChunk< T >::above, blender::StackChunk< T >::begin, blender::StackChunk< T >::below, and min.
|
inline |
Definition at line 190 of file BLI_stack.hh.
References blender::StackChunk< T >::above.
|
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 325 of file BLI_stack.hh.
References blender::StackChunk< T >::begin.
|
inline |
Returns true when the size is zero.
Definition at line 308 of file BLI_stack.hh.
Referenced by blender::fn::build_multi_function_procedure_for_fields(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::create_states_for_reachable_nodes(), blender::bke::node_field_inferencing::find_group_output_dependencies(), blender::fn::find_varying_fields(), blender::fn::InstructionScheduler::is_done(), blender::fn::ValueAllocator::obtain_OneSingle(), blender::fn::ValueAllocator::obtain_Span(), blender::fn::preprocess_field_tree(), propagate_reroute_type_from_start_socket(), blender::tests::TEST(), and blender::nodes::toposort_from_start_node().
|
inline |
Definition at line 333 of file BLI_stack.hh.
References blender::StackChunk< T >::begin.
Referenced by blender::tests::TEST().
|
inline |
Definition at line 200 of file BLI_stack.hh.
References blender::copy_assign_container().
|
inline |
Definition at line 205 of file BLI_stack.hh.
References blender::move_assign_container().
|
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 263 of file BLI_stack.hh.
References blender::StackChunk< T >::begin, and BLI_assert.
Referenced by blender::fn::build_multi_function_procedure_for_fields(), blender::fn::InstructionScheduler::peek(), blender::tests::TEST(), blender::nodes::toposort_from_start_node(), and blender::fn::InstructionScheduler::update_instruction_pointer().
|
inline |
Definition at line 269 of file BLI_stack.hh.
References blender::StackChunk< T >::begin, and BLI_assert.
|
inline |
Remove and return the top-most element from the stack. This invokes undefined behavior when the stack is empty.
Definition at line 242 of file BLI_stack.hh.
References blender::StackChunk< T >::begin, blender::StackChunk< T >::below, BLI_assert, blender::StackChunk< T >::capacity_end, and T.
Referenced by blender::fn::build_multi_function_procedure_for_fields(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::create_states_for_reachable_nodes(), blender::bke::node_field_inferencing::find_group_output_dependencies(), blender::fn::find_varying_fields(), blender::fn::ValueAllocator::obtain_OneSingle(), blender::fn::ValueAllocator::obtain_Span(), blender::fn::InstructionScheduler::pop(), blender::fn::preprocess_field_tree(), propagate_reroute_type_from_start_socket(), blender::tests::TEST(), and blender::nodes::toposort_from_start_node().
|
inline |
Add a new element to the top of the stack.
Definition at line 213 of file BLI_stack.hh.
References blender::Stack< T, InlineBufferCapacity, Allocator >::push_as().
Referenced by blender::fn::InstructionScheduler::add_owned_indices(), blender::fn::InstructionScheduler::add_referenced_indices(), blender::fn::build_multi_function_procedure_for_fields(), blender::modifiers::geometry_nodes::GeometryNodesEvaluator::create_states_for_reachable_nodes(), blender::bke::node_field_inferencing::find_group_output_dependencies(), blender::fn::find_varying_fields(), blender::fn::preprocess_field_tree(), propagate_reroute_type_from_start_socket(), blender::fn::ValueAllocator::release_value(), blender::tests::TEST(), and blender::nodes::toposort_from_start_node().
|
inline |
Definition at line 217 of file BLI_stack.hh.
References blender::Stack< T, InlineBufferCapacity, Allocator >::push_as().
|
inline |
Definition at line 222 of file BLI_stack.hh.
References blender::StackChunk< T >::capacity_end, and T.
Referenced by blender::Stack< T, InlineBufferCapacity, Allocator >::push(), 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 281 of file BLI_stack.hh.
References blender::StackChunk< T >::capacity_end, blender::Span< T >::data(), blender::Span< T >::drop_front(), blender::Span< T >::is_empty(), min, blender::Span< T >::size(), and blender::uninitialized_copy_n().
Referenced by blender::tests::TEST().
|
inline |
Returns the number of elements in the stack.
Definition at line 316 of file BLI_stack.hh.
Referenced by blender::tests::TEST().