Class TaskProvider
Tasks of values kept per (entity, attribute name), of any value types.
Requesting a held attribute with another value type throws
AttributeTypeMismatchException; a missing task is null.
The type specifier's value membership is not checked: the value is not
known before the task completes.
public class TaskProvider : ITaskProvider
- Inheritance
-
TaskProvider
- Implements
- Inherited Members
Constructors
TaskProvider(IEntityAttributeValueTypeSpecifier)
public TaskProvider(IEntityAttributeValueTypeSpecifier typeSpecifier)
Parameters
typeSpecifierIEntityAttributeValueTypeSpecifier
Properties
TypeSpecifier
public IEntityAttributeValueTypeSpecifier TypeSpecifier { get; }
Property Value
Methods
Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, Task<V>)>)
Adds tasks; returns this provider for chaining.
public TaskProvider Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, Task<V>)> entries) where V : struct
Parameters
entriesIEnumerable<(IEntityIdentifier, IAttribute<V>, Task<V>)>
Returns
Type Parameters
V
Add<V>(IEntityIdentifier, IAttribute<V>, Task<V>)
Adds a task; returns this provider for chaining.
public TaskProvider Add<V>(IEntityIdentifier identifier, IAttribute<V> attribute, Task<V> task) where V : struct
Parameters
identifierIEntityIdentifierattributeIAttribute<V>taskTask<V>
Returns
Type Parameters
V
GetTask<V>(IEntityIdentifier, IAttribute<V>)
The task for the entity's attribute, or null when there is none.
public Task<V>? GetTask<V>(IEntityIdentifier identifier, IAttribute<V> attribute) where V : struct
Parameters
identifierIEntityIdentifierattributeIAttribute<V>
Returns
- Task<V>
Type Parameters
V
Exceptions
- AttributeTypeMismatchException
The provider holds the attribute with another value type.