Table of Contents

Interface IReadingsRegistry

Namespace
Acuit.Pinpoint.IO.Testing
Assembly
Acuit.Pinpoint.IO.Testing.Abstractions.dll

A readings registry.

public interface IReadingsRegistry
Extension Methods

Properties

PolledReadingsObservable

Gets the polled readings observable.

IObservable<Timestamped<IReadingCollection>> PolledReadingsObservable { get; }

Property Value

IObservable<Timestamped<IReadingCollection>>

Remarks

Subscriptions to this observable will receive the last known set of polled readings followed by readings from subsequent polls. Implementations can use System.Reactive.Subjects.BehaviorSubject<T> to produce this behavior.

ReadingDescriptors

Gets the collection of all registered readings.

IReadingDescriptorCollection ReadingDescriptors { get; }

Property Value

IReadingDescriptorCollection

Methods

GetReadingDataSource(string)

Gets a reading data source.

IReadingDataSource GetReadingDataSource(string readingName)

Parameters

readingName string

The reading name.

Returns

IReadingDataSource

The reading data source.

Exceptions

ArgumentNullException

readingName is null.

KeyNotFoundException

readingName does not specify a known reading.

RegisterPolledProvider(IPolledReadingsProvider)

Registers a readings provider that should be continously polled for values.

IDisposable RegisterPolledProvider(IPolledReadingsProvider provider)

Parameters

provider IPolledReadingsProvider

The readings provider.

Returns

IDisposable

A disposable that can be used to unregister the provider.

Remarks

The IPolledReadingsProvider should be initialized and ready to poll when this is called. For example, devices that implement IInitializableOptions for asynchronous initialization should be sure to wait to register their polled provider until after the asynchronous initialization is complete.

Exceptions

ArgumentNullException

provider is null.

Events

PolledReadingsError

Raised when an error occurs while attempting to poll readings from polled reading providers. This will be raised from the thread poool.

event EventHandler<ReadingsErrorEventArgs> PolledReadingsError

Event Type

EventHandler<ReadingsErrorEventArgs>