-
Notifications
You must be signed in to change notification settings - Fork 30
/
AllValueEnumerable.cs
40 lines (35 loc) · 1.23 KB
/
AllValueEnumerable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* This is a .NET port of the original Java version, which was written by
* Gil Tene as described in
* https://github.com/HdrHistogram/HdrHistogram
* and released to the public domain, as explained at
* http://creativecommons.org/publicdomain/zero/1.0/
*/
using System.Collections;
using System.Collections.Generic;
namespace HdrHistogram.Iteration
{
/// <summary>
/// An enumerator of <see cref="HistogramIterationValue"/> through the histogram using a <see cref="AllValuesEnumerator"/>
/// </summary>
internal sealed class AllValueEnumerable : IEnumerable<HistogramIterationValue>
{
private readonly HistogramBase _histogram;
/// <summary>
/// The constructor for the <see cref="AllValueEnumerable"/>
/// </summary>
/// <param name="histogram">The <see cref="HistogramBase"/> to enumerate the values from.</param>
public AllValueEnumerable(HistogramBase histogram)
{
_histogram = histogram;
}
public IEnumerator<HistogramIterationValue> GetEnumerator()
{
return new AllValuesEnumerator(_histogram);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}