Struct FixedMinHeap<T> | Semantic Traits | 0.2.8-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Struct FixedMinHeap<T>

    A data structure to store a fixed-size list of elements and their priorities where the root is always the minimum priority value

    Namespace: Unity.Semantic.Traits.Queries
    Syntax
    public struct FixedMinHeap<T> : IDisposable where T : struct
    Type Parameters
    Name Description
    T

    Type of data stored in the heap

    Constructors

    FixedMinHeap(Int32, Allocator)

    Constructs a new FixedMinHeap using the specified type of memory allocation.

    Declaration
    public FixedMinHeap(int capacity, Allocator allocator)
    Parameters
    Type Name Description
    Int32 capacity

    The maximum capacity of the heap.

    Allocator allocator

    A member of the Unity.Collections.Allocator enumeration.

    Properties

    Capacity

    Maximum capacity

    Declaration
    public int Capacity { get; }
    Property Value
    Type Description
    Int32

    Length

    Number of elements in the heap

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    Int32

    Max

    Get the largest element

    Declaration
    public T Max { get; }
    Property Value
    Type Description
    T

    Min

    Get the smallest element

    Declaration
    public T Min { get; }
    Property Value
    Type Description
    T

    Methods

    Dispose()

    Disposes of this container and deallocates its memory immediately.

    Declaration
    public void Dispose()

    RemoveMin()

    Remove the smallest element

    Declaration
    public void RemoveMin()

    TryInsert(Single, T)

    Try to insert a value in the heap

    Declaration
    public bool TryInsert(float priority, T data)
    Parameters
    Type Name Description
    Single priority

    Priority value to compare heap elements

    T data

    Data associated to a help element

    Returns
    Type Description
    Boolean

    Whether or not the element was inserted in the heap

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023