Class ScyllaDequeDOTS<T>.Builder
Fluent builder for configuring and constructing ScyllaDequeDOTS<T> instances.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaDequeDOTS<T>.Builder
Remarks
Obtain a builder by calling CreateBuilder(). Chain configuration methods and finish with Build() or BuildConcrete() (both return the concrete ScyllaDequeDOTS<T> struct since no synchronized wrapper exists for DOTS types). WithAllocator(Allocator) is mandatory; all other configuration methods are optional.
Methods
Build()
Constructs and returns the configured ScyllaDequeDOTS<T> instance.
Declaration
public ScyllaDequeDOTS<T> Build()
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T> | A fully initialized ScyllaDequeDOTS<T> ready for use. |
Remarks
The caller is responsible for disposing the returned instance. Because ScyllaDequeDOTS<T> does not have a synchronized wrapper, this method and BuildConcrete() are functionally identical.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when WithAllocator(Allocator) has not been called before this method. An allocator is required to allocate the internal Unity.Collections.NativeArray<T> buffer. |
BuildConcrete()
Constructs and returns the configured ScyllaDequeDOTS<T> instance. Functionally identical to Build() since ScyllaDequeDOTS<T> has no synchronized wrapper variant.
Declaration
public ScyllaDequeDOTS<T> BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T> | A fully initialized ScyllaDequeDOTS<T> ready for use. |
Remarks
This method exists for API consistency with other Scylla collection builders (such as the
managed ScyllaDeque<T>.Builder) that distinguish between Build()
(returns interface) and BuildConcrete() (returns concrete type). For DOTS collections
there is no interface-returning variant, so both methods behave identically.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when WithAllocator(Allocator) has not been called before this method. |
OverwriteOnFull(bool)
Enables or disables overwrite-on-full behavior on the deque being built.
When enabled, pushing onto a full deque evicts the element at the opposite end rather than
returning false (push-front evicts back, push-back evicts front).
Declaration
public ScyllaDequeDOTS<T>.Builder OverwriteOnFull(bool value = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value |
|
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T>.Builder | This builder instance for method chaining. |
WithAllocator(Allocator)
Sets the memory allocator for the internal Unity.Collections.NativeArray<T> buffer. This method must be called before Build() or BuildConcrete().
Declaration
public ScyllaDequeDOTS<T>.Builder WithAllocator(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | The Unity Unity.Collections.Allocator to use. Must not be Unity.Collections.Allocator.None.
|
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T>.Builder | This builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
WithCapacity(int)
Sets the fixed capacity of the deque's backing native buffer.
Declaration
public ScyllaDequeDOTS<T>.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The desired fixed capacity. Must be |
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T>.Builder | This builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |
WithNativeArrayOptions(NativeArrayOptions)
Sets the Unity.Collections.NativeArrayOptions used when allocating the internal buffer. Controls whether the memory is zero-initialized at allocation time.
Declaration
public ScyllaDequeDOTS<T>.Builder WithNativeArrayOptions(NativeArrayOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeArrayOptions | options | Unity.Collections.NativeArrayOptions.UninitializedMemory (default) for maximum allocation performance; Unity.Collections.NativeArrayOptions.ClearMemory to zero-initialize the buffer at allocation time (required when inspecting unwritten slots before any pushes). |
Returns
| Type | Description |
|---|---|
| ScyllaDequeDOTS<T>.Builder | This builder instance for method chaining. |