public IEnumerator <T> GetCurrentData() { lock (this) { IEnumerator <T> enumerator = new SlidingIndex <T> .Enumerator(this); return(enumerator); } }
public Enumerator(SlidingIndex <T> slidingIndex) { foreach (InstantaneousIndex <T> indexEntry in slidingIndex._mainIndex) { //for older enteries which are not supposed to change if (indexEntry.ClockTime != Clock.CurrentTimeInSeconds) { _index.Add(indexEntry); } else { //index being modified currently _index.Add(indexEntry.Clone() as InstantaneousIndex <T>); } } _enumerator = _index.GetEnumerator(); }