コード例 #1
0
 /// <summary>
 /// Reads an array of <typeparamref name="T"/> from the buffer.
 /// </summary>
 /// <typeparam name="T">A structure type</typeparam>
 /// <param name="destination">Array that will contain the values read from the buffer. The length of this array controls the number of elements to read.</param>
 /// <param name="bufferPosition">The offset within the buffer region of the shared memory to read from.</param>
 protected virtual void Read <T>(T[] destination, long bufferPosition = 0)
     where T : struct
 {
     FastStructure.ReadArray <T>(destination, (IntPtr)(BufferStartPtr + bufferPosition), 0, destination.Length);
 }
コード例 #2
0
 /// <summary>
 /// Reads a number of elements from a memory location into the provided buffer starting at the specified index.
 /// </summary>
 /// <typeparam name="T">The structure type</typeparam>
 /// <param name="destination">The destination buffer.</param>
 /// <param name="index">The start index within <paramref name="destination"/>.</param>
 /// <param name="count">The number of elements to read.</param>
 /// <param name="bufferPosition">The source offset within the buffer region of the shared memory.</param>
 protected virtual void ReadArray <T>(T[] destination, int index, int count, long bufferPosition)
     where T : struct
 {
     FastStructure.ReadArray <T>(destination, (IntPtr)(BufferStartPtr + bufferPosition), index, count);
 }
コード例 #3
0
 /// <summary>
 /// Reads an array of <typeparamref name="T"/> from the buffer
 /// </summary>
 /// <typeparam name="T">A structure type</typeparam>
 /// <param name="buffer">Array that will contain the values read from the buffer. The length of this array controls the number of elements to read.</param>
 /// <param name="bufferPosition">The offset within the buffer region of the shared memory to read from.</param>
 protected virtual void Read <T>(T[] buffer, long bufferPosition = 0)
     where T : struct
 {
     FastStructure.ReadArray <T>(buffer, (IntPtr)(BufferStartPtr + bufferPosition), 0, buffer.Length);
     //View.ReadArray(BufferOffset + bufferPosition, buffer, 0, buffer.Length);
 }