Class ScyllaDisjointSetDOTS.Builder
Provides a fluent API for configuring and constructing ScyllaDisjointSetDOTS instances with a required allocator and an optional element count.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaDisjointSetDOTS.Builder
Remarks
Obtain a builder via CreateBuilder(). Configure it with the chainable methods, then call Build() to receive the finished ScyllaDisjointSetDOTS struct. WithAllocator(Allocator) must be called before Build().
Methods
Build()
Builds and returns the configured ScyllaDisjointSetDOTS instance.
Declaration
public ScyllaDisjointSetDOTS Build()
Returns
| Type | Description |
|---|---|
| ScyllaDisjointSetDOTS | A newly allocated ScyllaDisjointSetDOTS with every element in its own singleton component. The caller is responsible for calling Dispose() when finished. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when WithAllocator(Allocator) has not been called prior to building. |
WithAllocator(Allocator)
Configures the Unity Collections allocator used for the native parent and rank buffers.
Declaration
public ScyllaDisjointSetDOTS.Builder WithAllocator(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | The allocator to use. Must not be Unity.Collections.Allocator.None or Unity.Collections.Allocator.Invalid. This parameter is required; calling Build() without first calling this method throws InvalidOperationException. |
Returns
| Type | Description |
|---|---|
| ScyllaDisjointSetDOTS.Builder | This ScyllaDisjointSetDOTS.Builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
WithCapacity(int)
Configures the number of elements in the disjoint set to be built.
Declaration
public ScyllaDisjointSetDOTS.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The desired element count. Elements will be addressable as indices
|
Returns
| Type | Description |
|---|---|
| ScyllaDisjointSetDOTS.Builder | This ScyllaDisjointSetDOTS.Builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |