Class DatasetProcessorOwner
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
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
datasetIdMapDatasetIdThe stable dataset identity.
processorIDatasetProcessorThe expected processor instance.
Returns
Remove(MapDatasetId)
Removes and eventually disposes the processor identified by
datasetId.
public bool Remove(MapDatasetId datasetId)
Parameters
datasetIdMapDatasetIdThe stable dataset identity.
Returns
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
datasetIdMapDatasetIdThe stable dataset identity.
expectedProcessorIDatasetProcessorThe processor expected to be current.
Returns
TryAcquire(MapDatasetId, out DatasetProcessorLease?)
Attempts to acquire a lease for the processor identified by
datasetId.
public bool TryAcquire(MapDatasetId datasetId, out DatasetProcessorLease? lease)
Parameters
datasetIdMapDatasetIdThe stable dataset identity.
leaseDatasetProcessorLeaseThe acquired lease, or null when no processor is registered with that identity.
Returns
TryRegister(MapDatasetId, IDatasetProcessor)
Attempts to transfer ownership of processor to this
owner under datasetId.
public bool TryRegister(MapDatasetId datasetId, IDatasetProcessor processor)
Parameters
datasetIdMapDatasetIdThe stable dataset identity.
processorIDatasetProcessorThe processor to own.
Returns
Exceptions
- ObjectDisposedException
The owner is disposed.