Class ScyllaPriorityQueueDOTS<TValue>.Builder
Fluent builder for configuring and constructing ScyllaPriorityQueueDOTS<TValue> instances.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaPriorityQueueDOTS<TValue>.Builder
Remarks
WithAllocator(Allocator) must be called before Build() or BuildConcrete(). All other settings are optional and have sensible defaults.
Methods
Build()
Builds and returns the configured ScyllaPriorityQueueDOTS instance.
Declaration
public ScyllaPriorityQueueDOTS<TValue> Build()
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue> | The configured ScyllaPriorityQueueDOTS instance |
Remarks
Validates that WithAllocator(Allocator) has been called before constructing the priority queue. Since ScyllaPriorityQueueDOTS doesn't have a synchronized wrapper, this method returns the concrete type directly.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when allocator has not been set via WithAllocator() |
BuildConcrete()
Builds and returns the concrete ScyllaPriorityQueueDOTS instance. This method is functionally identical to Build() since ScyllaPriorityQueueDOTS doesn't have a synchronized wrapper.
Declaration
public ScyllaPriorityQueueDOTS<TValue> BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue> | The configured ScyllaPriorityQueueDOTS instance |
Remarks
Validates that WithAllocator(Allocator) has been called before constructing the priority queue. This method exists for API consistency with other collection builders, but returns the same type as Build().
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when allocator has not been set via WithAllocator() |
MaxHeap()
Configures the priority queue as a max-heap (largest priority first).
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder MaxHeap()
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |
Remarks
Items with larger priority values are dequeued first.
MinHeap()
Configures the priority queue as a min-heap (smallest priority first).
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder MinHeap()
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |
Remarks
This is the default ordering. Items with smaller priority values are dequeued first.
WithAllocator(Allocator)
Sets the memory allocator for native containers. This method must be called before Build() or BuildConcrete().
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder WithAllocator(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | Memory allocator for native containers (must not be Allocator.None) |
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |
Remarks
Allocator Selection:
- Allocator.Persistent: Long-lived priority queue (recommended for most game scenarios)
- Allocator.TempJob: Priority queue used within a single frame across jobs
- Allocator.Temp: Short-lived priority queue used within a single frame
Validation:
Allocator.None is not allowed and will throw an ArgumentException.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when allocator is Allocator.None |
WithCapacity(int)
Sets the fixed capacity of the priority queue.
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The fixed capacity. Must be at least 0. If negative, will be clamped to 1 during construction. |
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |
Remarks
The capacity will be rounded up to at least 1 during construction.
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when capacity is negative |
WithNativeArrayOptions(NativeArrayOptions)
Sets the native array initialization options.
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder WithNativeArrayOptions(NativeArrayOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeArrayOptions | options | Native array initialization options (default: UninitializedMemory) |
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |
WithOrder(ScyllaPriorityQueueOrder)
Sets the heap order explicitly.
Declaration
public ScyllaPriorityQueueDOTS<TValue>.Builder WithOrder(ScyllaPriorityQueueOrder order)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaPriorityQueueOrder | order | The heap order (Min or Max) |
Returns
| Type | Description |
|---|---|
| ScyllaPriorityQueueDOTS<TValue>.Builder | This builder instance for method chaining |