Table of Contents

Class DatasetProcessorOwner

Namespace
EncDotNet.S100.Datasets.Pipelines
Assembly
EncDotNet.S100.Core.dll

Owns loaded dataset processors by their host-stable MapDatasetId.

public sealed class DatasetProcessorOwner : IDisposable
Inheritance
DatasetProcessorOwner
Implements
Inherited Members

Remarks

This type lives with the aggregate dataset pipelines because it owns IDatasetProcessor instances but has no renderer, Mapsui, or UI dependency. It is the processor-lifecycle core intended for a future map session.

Registration transfers ownership only when TryRegister(MapDatasetId, IDatasetProcessor) returns true. Duplicate identities are rejected and remain owned by the caller. Removal prevents new acquisition immediately; disposal waits for active DatasetProcessorLease instances. Current disposable processors implement IDisposable, so this owner follows the same synchronous disposal contract.

Properties

Count

Gets the number of processors currently available to acquire.

public int Count { get; }

Property Value

int

Methods

Dispose()

Prevents new registration or acquisition and schedules every owned processor for disposal.

public void Dispose()

Remarks

Processors without active leases are disposed before this method returns. Leased processors are disposed by the last lease release. Repeated calls are no-ops.

GetDatasetIds()

Returns a point-in-time list of identities currently available to acquire.

public IReadOnlyList<MapDatasetId> GetDatasetIds()

Returns

IReadOnlyList<MapDatasetId>

A materialized identity snapshot.

Owns(MapDatasetId, IDatasetProcessor)

Returns whether this owner currently maps datasetId to the exact processor instance.

public bool Owns(MapDatasetId datasetId, IDatasetProcessor processor)

Parameters

datasetId MapDatasetId

The stable dataset identity.

processor IDatasetProcessor

The expected processor instance.

Returns

bool

true when the mapping is current.

Remove(MapDatasetId)

Removes and eventually disposes the processor identified by datasetId.

public bool Remove(MapDatasetId datasetId)

Parameters

datasetId MapDatasetId

The stable dataset identity.

Returns

bool

true when a processor was removed.

Remove(MapDatasetId, IDatasetProcessor)

Removes and eventually disposes the processor only when the identity still maps to expectedProcessor.

public bool Remove(MapDatasetId datasetId, IDatasetProcessor expectedProcessor)

Parameters

datasetId MapDatasetId

The stable dataset identity.

expectedProcessor IDatasetProcessor

The processor expected to be current.

Returns

bool

true when the expected mapping was removed.

TryAcquire(MapDatasetId, out DatasetProcessorLease?)

Attempts to acquire a lease for the processor identified by datasetId.

public bool TryAcquire(MapDatasetId datasetId, out DatasetProcessorLease? lease)

Parameters

datasetId MapDatasetId

The stable dataset identity.

lease DatasetProcessorLease

The acquired lease, or null when no processor is registered with that identity.

Returns

bool

true when a lease was acquired.

TryRegister(MapDatasetId, IDatasetProcessor)

Attempts to transfer ownership of processor to this owner under datasetId.

public bool TryRegister(MapDatasetId datasetId, IDatasetProcessor processor)

Parameters

datasetId MapDatasetId

The stable dataset identity.

processor IDatasetProcessor

The processor to own.

Returns

bool

true when ownership transferred; otherwise false when the identity was already registered.

Exceptions

ObjectDisposedException

The owner is disposed.