Class ScyllaQueueDOTS<T>.Builder
Fluent builder for constructing a ScyllaQueueDOTS<T> with a discoverable, named-parameter configuration API.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaQueueDOTS<T>.Builder
Remarks
Obtain a builder via CreateBuilder(). Configure it with the fluent methods, then call Build() or BuildConcrete() (which are functionally identical since this type has no synchronized wrapper).
WithAllocator(Allocator) is mandatory - calling Build() or BuildConcrete() without it throws InvalidOperationException.
Default configuration if no methods are called beyond WithAllocator(Allocator):
capacity 4, overwrite-on-full disabled,
Unity.Collections.NativeArrayOptions.UninitializedMemory.
var queue = ScyllaQueueDOTS<int>.CreateBuilder()
.WithCapacity(256)
.WithAllocator(Allocator.Persistent)
.OverwriteOnFull()
.Build();
Methods
Build()
Builds and returns the configured ScyllaQueueDOTS<T> instance.
Declaration
public ScyllaQueueDOTS<T> Build()
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T> | A fully initialized ScyllaQueueDOTS<T> ready for use. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when WithAllocator(Allocator) has not been called before this method. An allocator is required because native memory cannot be allocated without one. |
BuildConcrete()
Builds and returns the configured ScyllaQueueDOTS<T> instance. Functionally identical to Build() because this type does not have a synchronized wrapper; provided for API consistency with other Scylla collection builders.
Declaration
public ScyllaQueueDOTS<T> BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T> | A fully initialized ScyllaQueueDOTS<T> ready for use. |
Remarks
Unlike BuildConcrete(), this method never throws due to a synchronized configuration, because ScyllaQueueDOTS<T> does not support synchronized wrappers.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when WithAllocator(Allocator) has not been called before this method. |
OverwriteOnFull(bool)
Enables or disables the overwrite-on-full policy for the queue being built.
Declaration
public ScyllaQueueDOTS<T>.Builder OverwriteOnFull(bool value = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value |
|
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T>.Builder | This builder instance for method chaining. |
WithAllocator(Allocator)
Sets the Unity native allocator for the queue's internal buffer.
Declaration
public ScyllaQueueDOTS<T>.Builder WithAllocator(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | The allocator to use. Must not be Unity.Collections.Allocator.None. Common choices:
|
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T>.Builder | This builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
WithCapacity(int)
Sets the fixed capacity of the queue - the maximum number of elements it can hold.
Declaration
public ScyllaQueueDOTS<T>.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The fixed buffer capacity. Non-negative values are accepted; values less than
|
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T>.Builder | This builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |
WithNativeArrayOptions(NativeArrayOptions)
Sets the Unity.Collections.NativeArrayOptions forwarded to the internal Unity.Collections.NativeArray<T> constructor.
Declaration
public ScyllaQueueDOTS<T>.Builder WithNativeArrayOptions(NativeArrayOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeArrayOptions | options | Unity.Collections.NativeArrayOptions.UninitializedMemory (the default) skips zero-initialization for maximum allocation performance. Use Unity.Collections.NativeArrayOptions.ClearMemory when a deterministic initial buffer state is required. |
Returns
| Type | Description |
|---|---|
| ScyllaQueueDOTS<T>.Builder | This builder instance for method chaining. |