コード例 #1
0
        public IEnumerator <T> GetCurrentData()
        {
            lock (this)
            {
                IEnumerator <T> enumerator = new SlidingIndex <T> .Enumerator(this);

                return(enumerator);
            }
        }
コード例 #2
0
            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();
            }