Class PointerBufferProvider
public class PointerBufferProvider : IBufferProvider, IDisposable
- Inheritance
-
PointerBufferProvider
- Implements
- Inherited Members
Constructors
PointerBufferProvider(bool, nint, int, IDisposable?)
public PointerBufferProvider(bool isReadOnly, nint pointer, int size, IDisposable? disposer = null)
Parameters
isReadOnly
boolpointer
nintsize
intdisposer
IDisposable
Properties
IsReadOnly
True if the buffer is read only.
public bool IsReadOnly { get; }
Property Value
Pointer
public nint Pointer { get; }
Property Value
Size
Size of the buffer in bytes.
public int Size { get; }
Property Value
Methods
Acquire(bool, TimeSpan?)
Acquire a lock to this buffer provider.
public BufferLock Acquire(bool isReadonly = true, TimeSpan? timeout = null)
Parameters
Returns
- BufferLock
The lock instance if successfull.
CopyTo(IBufferProvider, TimeSpan?)
Copy this buffer contents to another buffer.
public void CopyTo(IBufferProvider destination, TimeSpan? timeout = null)
Parameters
destination
IBufferProviderThe destination buffer.
timeout
TimeSpan?Lock acquire time out.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
TryAcquire(out BufferLock, bool, TimeSpan?)
Try to acquire a lock to this buffer provider.
public bool TryAcquire(out BufferLock @lock, bool isReadonly = true, TimeSpan? timeout = null)
Parameters
lock
BufferLockThe lock object, when true.
isReadonly
boolTrue if for a readonly lock.
timeout
TimeSpan?Lock acquire time out.
Returns
- bool
True if the lock was acquired.