コード例 #1
0
 /// <summary>
 /// Gets the block of contiguous time series entries for the specific time series stream container segment.
 /// </summary>
 /// <param name="fragment">The time series stream block to get the block of contiguous time series entries for.</param>
 /// <param name="lower">The lower date and time interval boundary to get the nodes for.</param>
 /// <param name="upper">The upper date and time interval boundary to get the nodes for.</param>
 /// <returns>The sequence of contiguous time series entries contained within the required time series stream container segment.</returns>
 public IEnumerable <T> Get(TimelineStream <T> .Fragment fragment, DateTime?lower = null, DateTime?upper = null)
 {
     if (fragment != null)
     {
         var lowerEntry = fragment.LowerEntry;
         if (lower != null)
         {
             while (lowerEntry?.Sample < lower)
             {
                 lowerEntry = lowerEntry.Next;
             }
         }
         var upperEntry = fragment.UpperEntry;
         if (upper != null)
         {
             while (upperEntry?.Sample > upper)
             {
                 upperEntry = upperEntry.Prev;
             }
         }
         if (lowerEntry != null && upperEntry != null)
         {
             return(new Incrementor.Collection(this, lowerEntry, upperEntry));
         }
         else
         {
             return(Array.Empty <T>());
         }
     }
     else
     {
         throw new ArgumentNullException(nameof(fragment));
     }
 }
コード例 #2
0
 /// <summary>
 /// Removes the array of nodes from the double linked collection.
 /// </summary>
 /// <param name="fragment">The time series stream block to get the block of contiguous time series entries for.</param>
 /// <param name="lower">The lower date and time interval boundary to remove the nodes for.</param>
 /// <param name="upper">The upper date and time interval boundary to remove the nodes for.</param>
 /// <returns>The specified array of nodes removed from the double linked collection.</returns>
 public Timeline <T> Remove(TimelineStream <T> .Fragment fragment, DateTime?lower = null, DateTime?upper = null)
 {
     return(CoreRemove(Get(fragment, lower, upper)));
 }