public void Enqueue(UnacknowledgedData data) { if (Max.HasValue) { Set(data, Max.GetValueOrDefault() + 1); } else { Set(data, 0); } }
void CheckMinAndMax() { if (Max.HasValue && !UnacknowledgedData.ContainsKey(Max.GetValueOrDefault())) { Max = null; } if (Min.HasValue && !UnacknowledgedData.ContainsKey(Min.GetValueOrDefault())) { Min = null; } }
public void Set(UnacknowledgedData data, int frameIndex) { UnacknowledgedData [frameIndex] = data; if (Max.HasValue) { Max = Math.Max(Max.GetValueOrDefault(), frameIndex); } else { Max = frameIndex; } if (Min.HasValue) { Min = Math.Min(Min.GetValueOrDefault(), frameIndex); } else { Min = frameIndex; } CheckMinAndMax(); }