738 lines
24 KiB
HTML
738 lines
24 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Struct UnsafeQueue<T> | Misaki.HighPerformance </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Struct UnsafeQueue<T> | Misaki.HighPerformance ">
|
|
|
|
<meta name="description" content="A structure that implements a queue using unmanaged types for efficient memory management.">
|
|
<link rel="icon" href="../favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../logo.svg" alt="Misaki.HighPerformance">
|
|
Misaki.HighPerformance
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1">
|
|
|
|
|
|
|
|
<h1 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1" class="text-break">
|
|
Struct UnsafeQueue<T>
|
|
</h1>
|
|
|
|
<div class="facts text-secondary">
|
|
<dl><dt>Namespace</dt><dd><a class="xref" href="Misaki.html">Misaki</a>.<a class="xref" href="Misaki.HighPerformance.html">HighPerformance</a>.<a class="xref" href="Misaki.HighPerformance.LowLevel.html">LowLevel</a>.<a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.html">Collections</a></dd></dl>
|
|
<dl><dt>Assembly</dt><dd>Misaki.HighPerformance.LowLevel.dll</dd></dl>
|
|
</div>
|
|
|
|
<div class="markdown summary"><p>A structure that implements a queue using unmanaged types for efficient memory management.</p>
|
|
</div>
|
|
<div class="markdown conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public struct UnsafeQueue<T> : IUnsafeCollection<T>, IUnsafeCollection, IDisposable where T : unmanaged</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>Represents the type of elements stored in the queue, which must be an unmanaged type for performance and safety.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<dl class="typelist implements">
|
|
<dt>Implements</dt>
|
|
<dd>
|
|
<div><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.Contracts.IUnsafeCollection-1.html">IUnsafeCollection</a><T></div>
|
|
<div><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.Contracts.IUnsafeCollection.html">IUnsafeCollection</a></div>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<dl class="typelist inheritedMembers">
|
|
<dt>Inherited Members</dt>
|
|
<dd>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.equals">ValueType.Equals(object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode">ValueType.GetHashCode()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.tostring">ValueType.ToString()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="constructors">Constructors
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1__ctor_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.#ctor*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1__ctor" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.#ctor">
|
|
UnsafeQueue()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Initializes a new instance of UnsafeQueue with a default size of 1 and a persistent allocation handle.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public UnsafeQueue()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1__ctor_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.#ctor*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1__ctor_System_Int32_Misaki_HighPerformance_LowLevel_Buffer_AllocationHandle_Misaki_HighPerformance_LowLevel_Buffer_AllocationOption_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.#ctor(System.Int32,Misaki.HighPerformance.LowLevel.Buffer.AllocationHandle,Misaki.HighPerformance.LowLevel.Buffer.AllocationOption)">
|
|
UnsafeQueue(int, AllocationHandle, AllocationOption)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Initializes a new instance of UnsafeQueue with the specified initial capacity and allocation handle.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public UnsafeQueue(int capacity, AllocationHandle handle, AllocationOption allocationOption = AllocationOption.None)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>capacity</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The initial capacity of the queue.</p>
|
|
</dd>
|
|
<dt><code>handle</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationHandle.html">AllocationHandle</a></dt>
|
|
<dd><p>The allocation handle.</p>
|
|
</dd>
|
|
<dt><code>allocationOption</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationOption.html">AllocationOption</a></dt>
|
|
<dd><p>The allocation option.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="properties">Properties
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Capacity_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Capacity*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Capacity" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Capacity">
|
|
Capacity
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly int Capacity { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Count_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Count*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Count" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Count">
|
|
Count
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Gets the number of elements in a collection.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly int Count { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_IsCreated_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.IsCreated*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_IsCreated" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.IsCreated">
|
|
IsCreated
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Indicates whether the object has been created. Returns true if the object is created, otherwise false.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly bool IsCreated { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
<h4 class="section" id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_IsCreated_remarks">Remarks</h4>
|
|
<div class="markdown level1 remarks"><p>If MHP_ENABLE_STACKTRACE is not defined, this property will only check if the underlying pointer is not null, which may not be sufficient to determine if the collection is fully initialized and ready for use.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Item_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Item*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Item_System_Int32_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Item(System.Int32)">
|
|
this[int]
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly T this[int index] { get; set; }</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>index</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="methods">Methods
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Clear_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Clear*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Clear" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Clear">
|
|
Clear()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Removes all elements from the collection. The collection will be empty after this operation.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Clear()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Dequeue_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Dequeue*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Dequeue" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Dequeue">
|
|
Dequeue()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Removes and returns the element at the front of the queue. If the queue is empty, an exception is thrown.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public T Dequeue()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>The element that was removed from the front of the queue.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
|
|
<dd><p>Thrown when attempting to dequeue from an empty queue.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Dispose_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Dispose*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Dispose" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Dispose">
|
|
Dispose()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Enqueue_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Enqueue*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Enqueue__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Enqueue(`0@)">
|
|
Enqueue(scoped in T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Adds an element to the end of a collection, resizing if the current capacity is reached. The new element is
|
|
stored in a circular buffer.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Enqueue(scoped in T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>The item to be added to the collection.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_GetEnumerator_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.GetEnumerator*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_GetEnumerator" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.GetEnumerator">
|
|
GetEnumerator()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">[UnscopedRef]
|
|
public UnsafeQueue<T>.Enumerator GetEnumerator()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue-1.html">UnsafeQueue</a><T>.<a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue-1.Enumerator.html">Enumerator</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_GetUnsafePtr_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.GetUnsafePtr*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_GetUnsafePtr" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.GetUnsafePtr">
|
|
GetUnsafePtr()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Returns a pointer to an unmanaged memory location. This pointer can be used for low-level memory operations.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly void* GetUnsafePtr()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>The method returns a void pointer to the unsafe memory location.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Peek_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Peek*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Peek" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Peek">
|
|
Peek()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Returns a reference to the item at the front of the queue without removing it.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly ref T Peek()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>A reference to the item at the front of the queue.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
|
|
<dd><p>Thrown if the queue is empty.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Resize_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Resize*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_Resize_System_Int32_Misaki_HighPerformance_LowLevel_Buffer_AllocationOption_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.Resize(System.Int32,Misaki.HighPerformance.LowLevel.Buffer.AllocationOption)">
|
|
Resize(int, AllocationOption)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Changes the size of a collection to the specified value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Resize(int newSize, AllocationOption option = AllocationOption.None)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>newSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>Specifies the new size to which the collection should be adjusted.</p>
|
|
</dd>
|
|
<dt><code>option</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationOption.html">AllocationOption</a></dt>
|
|
<dd><p>Specifies allocation options that may affect how memory is managed during the resize operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_TryDequeue_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.TryDequeue*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_TryDequeue__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.TryDequeue(`0@)">
|
|
TryDequeue(out T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Attempts to remove and return an item from a collection. Returns a boolean indicating success or failure.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool TryDequeue(out T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>The output variable that will hold the dequeued item if the operation is successful.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>True if an item was successfully dequeued, otherwise false.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_TryPeek_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.TryPeek*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeQueue_1_TryPeek__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeQueue`1.TryPeek(`0@)">
|
|
TryPeek(out T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Attempts to return the object at the top of the collection without removing it.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly bool TryPeek(out T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>The item at the front of the queue if the operation is successful; otherwise, the default value of <code class="typeparamref">T</code>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if an object was returned successfully; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|