Show / Hide Table of Contents

    Class ResizableDirectMemoryBase

    Provides a base implementation for the resizable memory block with direct access (via unmanaged pointers).

    Предоставляет базовую реализацию для блока памяти c изменяемым размером и прямым доступом (через неуправляемые указатели).

    Inheritance
    Object
    ResizableDirectMemoryBase
    FileMappedResizableDirectMemory
    HeapResizableDirectMemory
    Implements
    IResizableDirectMemory
    IDirectMemory
    IMemory
    IDisposable
    Namespace: Platform.Memory
    Assembly: Platform.Memory.dll
    Syntax
    public abstract class ResizableDirectMemoryBase : DisposableBase, IResizableDirectMemory, IDirectMemory, IMemory, IDisposable

    Fields

    | Improve this Doc View Source

    MinimumCapacity

    Gets minimum capacity in bytes.

    Возвращает минимальную емкость в байтах.

    Declaration
    public static readonly long MinimumCapacity
    Field Value
    Type Description
    Int64

    Properties

    | Improve this Doc View Source

    AllowMultipleDisposeCalls

    Declaration
    protected override bool AllowMultipleDisposeCalls { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Pointer

    Gets the pointer to the beginning of this memory block.

    Возвращает указатель на начало блока памяти.

    Declaration
    public IntPtr Pointer { get; protected set; }
    Property Value
    Type Description
    IntPtr
    Exceptions
    Type Condition
    ObjectDisposedException

    The memory block is disposed.

    Блок памяти уже высвобожден.

    | Improve this Doc View Source

    ReservedCapacity

    Gets or sets the reserved capacity in bytes of this memory block.

    Возвращает или устаналивает зарезервированный размер блока памяти в байтах.

    Declaration
    public long ReservedCapacity { get; set; }
    Property Value
    Type Description
    Int64
    Remarks

    If less then zero the value is replaced with zero. Cannot be less than the used capacity of this memory block.

    Если меньше нуля, значение заменяется на ноль. Не может быть меньше используемой емкости блока памяти.

    Exceptions
    Type Condition
    ObjectDisposedException

    The memory block is disposed.

    Блок памяти уже высвобожден.

    ArgumentOutOfRangeException

    Attempted to set the reserved capacity to a value that is less than the used capacity.

    Была выполнена попытка установить зарезервированную емкость на значение, которое меньше используемой емкости.

    | Improve this Doc View Source

    Size

    Gets the size in bytes of this memory block.

    Возвращает размер блока памяти в байтах.

    Declaration
    public long Size { get; }
    Property Value
    Type Description
    Int64
    Exceptions
    Type Condition
    ObjectDisposedException

    The memory block is disposed.

    Блок памяти уже высвобожден.

    | Improve this Doc View Source

    UsedCapacity

    Gets or sets the used capacity in bytes of this memory block.

    Возвращает или устанавливает используемый размер в блоке памяти (в байтах).

    Declaration
    public long UsedCapacity { get; set; }
    Property Value
    Type Description
    Int64
    Remarks

    If less then zero the value is replaced with zero. Cannot be greater than the reserved capacity of this memory block.

    It is recommended to reduce the reserved capacity of the memory block to the used capacity (specified in this property) after the completion of the use of the memory block.

    Если меньше нуля, значение заменяется на ноль. Не может быть больше, чем зарезервированная емкость этого блока памяти.

    Рекомендуется уменьшать фактический размер блока памяти до используемого размера (указанного в этом свойстве) после завершения использования блока памяти.

    Exceptions
    Type Condition
    ObjectDisposedException

    The memory block is disposed.

    Блок памяти уже высвобожден.

    ArgumentOutOfRangeException

    Attempted to set the used capacity to a value that is greater than the reserved capacity or less than zero.

    Была выполнена попытка установить используемую емкость на значение, которое больше, чем зарезервированная емкость или меньше нуля.

    Methods

    | Improve this Doc View Source

    Dispose(Boolean, Boolean)

    Declaration
    protected override void Dispose(bool manual, bool wasDisposed)
    Parameters
    Type Name Description
    Boolean manual
    Boolean wasDisposed
    | Improve this Doc View Source

    DisposePointer(IntPtr, Int64)

    Executed when it is time to dispose Pointer.

    Выполняется, когда пришло время высвободить Pointer.

    Declaration
    protected abstract void DisposePointer(IntPtr pointer, long usedCapacity)
    Parameters
    Type Name Description
    IntPtr pointer

    The pointer to a memory block.

    Указатель на блок памяти.

    Int64 usedCapacity

    The used capacity of the memory block in bytes.

    Используемая емкость блока памяти в байтах.

    | Improve this Doc View Source

    OnReservedCapacityChanged(Int64, Int64)

    Executed on the event of change for ReservedCapacity property.

    Выполняется в случае изменения свойства ReservedCapacity.

    Declaration
    protected abstract void OnReservedCapacityChanged(long oldReservedCapacity, long newReservedCapacity)
    Parameters
    Type Name Description
    Int64 oldReservedCapacity

    The old reserved capacity of the memory block in bytes.

    Старая зарезервированная емкость блока памяти в байтах.

    Int64 newReservedCapacity

    The new reserved capacity of the memory block in bytes.

    Новая зарезервированная емкость блока памяти в байтах.

    Implements

    IResizableDirectMemory
    IDirectMemory
    IMemory
    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX