Struct UnsafeAppendBuffer
An unmanaged, untyped, heterogeneous buffer.
Implements
Namespace: Unity.Collections.LowLevel.Unsafe
Assembly: solution.dll
Syntax
public struct UnsafeAppendBuffer : INativeDisposable
Remarks
The values written to an individual append buffer can be of different types.
Constructors
| Name | Description |
|---|---|
| UnsafeAppendBuffer(int, int, AllocatorHandle) | Initializes and returns an instance of UnsafeAppendBuffer. |
| UnsafeAppendBuffer(void*, int) | Initializes and returns an instance of UnsafeAppendBuffer that aliases an existing buffer. |
Fields
| Name | Description |
|---|---|
| Alignment | The byte alignment used when allocating the internal buffer. |
| Allocator | The allocator used to create the internal buffer. |
| Capacity | The size in bytes of the internal buffer. |
| Length | The size in bytes of the currently-used portion of the internal buffer. |
| Ptr | The internal buffer where the content is stored. |
Properties
| Name | Description |
|---|---|
| IsCreated | Whether this append buffer has been allocated (and not yet deallocated). |
| IsEmpty | Whether the append buffer is empty. |
Methods
| Name | Description |
|---|---|
| Add(void*, int) | Appends an element to the end of this append buffer. |
| AddArray<T>(void*, int) | Appends the elements of a buffer to the end of this append buffer. |
| Add<T>(NativeArray<T>) | Appends all elements of an array to the end of this append buffer. |
| Add<T>(T) | Appends an element to the end of this append buffer. |
| AsReader() | Returns a reader for this append buffer. |
| Dispose() | Releases all resources (memory and safety handles). |
| Dispose(JobHandle) | Creates and schedules a job that will dispose this append buffer. |
| Pop(void*, int) | Removes and copies the last element of this append buffer. |
| Pop<T>() | Removes and returns the last element of this append buffer. |
| Reset() | Sets the length to 0. |
| ResizeUninitialized(int) | Sets the length in bytes. |
| SetCapacity(int) | Sets the size in bytes of the internal buffer. |