-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIReadOnlyPinnedMemory.cs
More file actions
77 lines (71 loc) · 2.42 KB
/
Copy pathIReadOnlyPinnedMemory.cs
File metadata and controls
77 lines (71 loc) · 2.42 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// =================================================================================================================================
// 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 read-only, fixed-length bit field that is pinned in memory.
/// </summary>
/// <typeparam name="T">
/// The element type of the memory field.
/// </typeparam>
public interface IReadOnlyPinnedMemory<T> : IEnumerable<T>, IReadOnlyPinnedMemory
where T : struct, IComparable<T>, IEquatable<T>
{
/// <summary>
/// Gets 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 T this[Int32 index]
{
get;
}
/// <summary>
/// Gets a <see cref="ReadOnlySpan{T}" /> for the current <see cref="IReadOnlyPinnedMemory{T}" />.
/// </summary>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public ReadOnlySpan<T> ReadOnlySpan
{
get;
}
}
/// <summary>
/// Represents a read-only, fixed-length bit field that is pinned in memory.
/// </summary>
public interface IReadOnlyPinnedMemory : IAsyncDisposable, IDisposable
{
/// <summary>
/// Gets a value indicating whether or not the memory field is empty.
/// </summary>
public Boolean IsEmpty
{
get;
}
/// <summary>
/// Gets the number of elements comprising the memory field.
/// </summary>
public Int32 Length
{
get;
}
/// <summary>
/// Gets the length of the memory field, in bytes.
/// </summary>
public Int32 LengthInBytes
{
get;
}
}
}