Show / Hide Table of Contents

Interface IGrowableBuffer<T>

Represents common interface for growable buffer writers.

Inherited Members
IDisposable.Dispose()
Namespace: DotNext.Buffers
Assembly: DotNext.dll
Syntax
public interface IGrowableBuffer<T> : IDisposable
Type Parameters
Name Description
T

The type of the elements in the buffer.

Remarks

This interface is intended to describe the shape of all buffer writer types in .NEXT family of libraries. It is not recommended to have custom implementation of this interface in your code.

Properties

| Improve this Doc View Source

Capacity

Gets the maximum number of elements that can hold this buffer.

Declaration
virtual long? Capacity { get; }
Property Value
Type Description
Nullable<Int64>

The maximum number of elements; or null if this buffer has no limits.

| Improve this Doc View Source

WrittenCount

Gets the number of written elements.

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

The writer has been disposed.

Methods

| Improve this Doc View Source

Clear()

Clears the contents of the writer.

Declaration
void Clear()
Exceptions
Type Condition
ObjectDisposedException

The writer has been disposed.

| Improve this Doc View Source

CopyTo(Span<T>)

Copies the contents of this writer to the specified memory block.

Declaration
int CopyTo(Span<T> output)
Parameters
Type Name Description
Span<T> output

The memory block to be modified.

Returns
Type Description
Int32

The actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The builder has been disposed.

| Improve this Doc View Source

CopyTo<TArg>(ReadOnlySpanAction<T, TArg>, TArg)

Passes the contents of this writer to the callback.

Declaration
void CopyTo<TArg>(ReadOnlySpanAction<T, TArg> callback, TArg arg)
Parameters
Type Name Description
ReadOnlySpanAction<T, TArg> callback

The callback used to accept the memory representing the contents of this builder.

TArg arg

The argument to be passed to the callback.

Type Parameters
Name Description
TArg

The type of the object that represents the state.

Remarks

The callback may be called multiple times.

Exceptions
Type Condition
ObjectDisposedException

The writer has been disposed.

| Improve this Doc View Source

Write(T)

Writes single element to this buffer.

Declaration
virtual void Write(T value)
Parameters
Type Name Description
T value

The value to be written.

Exceptions
Type Condition
ObjectDisposedException

The writer has been disposed.

| Improve this Doc View Source

Write(ReadOnlySpan<T>)

Writes the memory block.

Declaration
void Write(ReadOnlySpan<T> input)
Parameters
Type Name Description
ReadOnlySpan<T> input

The memory block to be written.

Exceptions
Type Condition
ObjectDisposedException

The writer has been disposed.

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX