forked from microsoft/GraphEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIAccessor.cs
More file actions
41 lines (37 loc) · 1.21 KB
/
IAccessor.cs
File metadata and controls
41 lines (37 loc) · 1.21 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
// Graph Engine
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Trinity.TSL.Lib;
namespace Trinity.Storage
{
/// <summary>
/// Represents an accessor that owns a buffer.
/// </summary>
public interface IAccessor
{
/// <summary>
/// Get the pointer to the underlying buffer.
/// Note, the pointer always point to the beginning of the buffer,
/// and there may be metadata instead of actual data.
/// </summary>
unsafe byte* GetUnderlyingBufferPointer();
/// <summary>
/// Get the byte array representation of the underlying buffer.
/// </summary>
byte[] ToByteArray();
/// <summary>
/// Get the length of the buffer.
/// </summary>
int GetBufferLength();
/// <summary>
/// Provides an interface for resizing a field of the accessor. Usually called by a sub-accessor.
/// </summary>
ResizeFunctionDelegate ResizeFunction { get; set; }
}
}