コード例 #1
0
        /// <summary>
        /// Creates a new iterator instance.
        /// </summary>
        /// <param name="sequence">An existing sequence instance.</param>
        /// <exception cref="System.ArgumentNullException">if sequence is null.</exception>
        public QuotesRangeSingleIterator(QuotesRangeSingleSequence sequence)
        {
            if (sequence == null)
            {
                throw new ArgumentNullException(nameof(sequence), "Sequence parameter can not be null.");
            }

            this.Sequence = sequence;

            this.iterator = new QuotesSingleIterator(sequence.Storage, sequence.Symbol, sequence.StartTime, sequence.EndTime, sequence.Depth);
            var range = new Range <Quote>(sequence.LowerBound, sequence.UpperBound);

            var index = sequence.LowerBound;

            for (; (index < sequence.UpperBound) && this.iterator.Continue; ++index)
            {
                range[index] = this.iterator.Current;
                this.iterator.NextTick();
            }

            if (index == sequence.UpperBound)
            {
                this.Current  = range;
                this.Continue = true;
            }
            else
            {
                this.Continue = false;
            }
        }
コード例 #2
0
        public QuotesRangeSingleEnumerator(QuotesRangeSingleSequence sequence)
        {
            if (sequence == null)
            {
                throw new ArgumentNullException(nameof(sequence), "Sequence parameter can not be null.");
            }

            this.sequence = sequence;
        }