Class ObservableProvider
Value streams kept per (entity, attribute name), of any value types.
Requesting a held attribute with another value type throws
AttributeTypeMismatchException; a missing stream is
null. The type specifier's value membership is not checked per
value of the stream.
public class ObservableProvider : IObservableProvider
- Inheritance
-
ObservableProvider
- Implements
- Inherited Members
Constructors
ObservableProvider(IEntityAttributeValueTypeSpecifier)
public ObservableProvider(IEntityAttributeValueTypeSpecifier typeSpecifier)
Parameters
typeSpecifierIEntityAttributeValueTypeSpecifier
Properties
TypeSpecifier
The entities and attributes this provider answers for.
public IEntityAttributeValueTypeSpecifier TypeSpecifier { get; }
Property Value
Methods
Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, IObservable<V>)>)
Adds streams; returns this provider for chaining.
public ObservableProvider Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, IObservable<V>)> entries) where V : struct
Parameters
entriesIEnumerable<(IEntityIdentifier, IAttribute<V>, IObservable<V>)>
Returns
Type Parameters
V
Add<V>(IEntityIdentifier, IAttribute<V>, IObservable<V>)
Adds a stream; returns this provider for chaining.
public ObservableProvider Add<V>(IEntityIdentifier identifier, IAttribute<V> attribute, IObservable<V> values) where V : struct
Parameters
identifierIEntityIdentifierattributeIAttribute<V>valuesIObservable<V>
Returns
Type Parameters
V
GetObservable<V>(IEntityIdentifier, IAttribute<V>)
The value stream of the entity's attribute, or null when there is none.
public IObservable<V>? GetObservable<V>(IEntityIdentifier identifier, IAttribute<V> attribute) where V : struct
Parameters
identifierIEntityIdentifierattributeIAttribute<V>
Returns
- IObservable<V>
Type Parameters
V
Exceptions
- AttributeTypeMismatchException
The provider holds the attribute with another value type.