TimeSeriesDataCollectionExtensions Class
HAKOM.TSM.Net.Api.Data.TimeSeries.Extensions
Section titled “HAKOM.TSM.Net.Api.Data.TimeSeries.Extensions”Class for extending the ITimeSeriesDataCollection<TValue> functionality.
public static class TimeSeriesDataCollectionExtensionsInheritance System.Object 🡒 TimeSeriesDataCollectionExtensions
Methods
Section titled “Methods”TimeSeriesDataCollectionExtensions.Memoized<TValue>(this ITimeSeriesDataCollection<TValue>) Method
Section titled “TimeSeriesDataCollectionExtensions.Memoized<TValue>(this ITimeSeriesDataCollection<TValue>) Method”Memoizes an ITimeSeriesDataCollection<TValue> to cache the ITimeSeriesData<TValue> and be able to reuse the data while avoiding multiple calls to the Storage to reread the ITimeSeriesData<TValue>.
public static HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> Memoized<TValue>(this HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue> timeSeriesDataCollection) where TValue : System.IEquatable<TValue>, System.IComparable<TValue>;Type parameters
Section titled “Type parameters”TValue
The type of the data for ITimeSeriesData<TValue>.
Parameters
Section titled “Parameters”timeSeriesDataCollection HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
The ITimeSeriesDataCollection<TValue> to memoize.
Returns
Section titled “Returns”HAKOM.TSM.Net.Api.Data.TimeSeries.ITimeSeriesDataCollection<TValue>
A memoized ITimeSeriesDataCollection<TValue> where the underlying ITimeSeriesData<TValue>
can be used multiple times without rereading it from the Storage.
Remarks
Section titled “Remarks”The cache is kept once an enumeration has run to completion. If every enumerator is disposed while the underlying read is still in progress, the partial cache and the underlying storage read are released — so an abandoned enumeration does not hold on to a database connection — and the next enumeration rereads the data from the Storage.
An error of the underlying read is replayed to every enumerator, including the ones created afterwards, instead of ending the series. Advancing an enumerator which has already been disposed throws an System.ObjectDisposedException.
The returned collection is not thread safe: enumerate it from one reader at a time, as concurrent enumerators corrupt the cache and can release the underlying read while another enumerator is still using it.