-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIPinnedMemory.cs
More file actions
62 lines (58 loc) · 2.14 KB
/
Copy pathIPinnedMemory.cs
File metadata and controls
62 lines (58 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
using System.Collections.Generic;
namespace RapidField.SolidInstruments.Collections
{
/// <summary>
/// Represents a fixed-length bit field that is pinned in memory.
/// </summary>
/// <typeparam name="T">
/// The element type of the memory field.
/// </typeparam>
public interface IPinnedMemory<T> : IEnumerable<T>, IPinnedMemory, IReadOnlyPinnedMemory<T>
where T : struct, IComparable<T>, IEquatable<T>
{
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
/// <param name="index">
/// The index of the element to access.
/// </param>
/// <returns>
/// The element at the specified index if one exists.
/// </returns>
/// <exception cref="IndexOutOfRangeException">
/// The specified index is out of range.
/// </exception>
public new T this[Int32 index]
{
get;
set;
}
/// <summary>
/// Gets a <see cref="Span{T}" /> for the current <see cref="IPinnedMemory{T}" />.
/// </summary>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Span<T> Span
{
get;
}
}
/// <summary>
/// Represents a fixed-length bit field that is pinned in memory.
/// </summary>
public interface IPinnedMemory : IReadOnlyPinnedMemory
{
/// <summary>
/// Overwrites the current <see cref="IPinnedMemory" /> with default values.
/// </summary>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public void OverwriteWithZeros();
}
}