示例#1
0
        /// <inheritdoc />
        public override RangeSeries <TKey, TValue, TCursor> Create()
        {
            if (State == CursorState.None && ThreadId == Environment.CurrentManagedThreadId)
            {
                State = CursorState.Initialized;
                return(this);
            }
            var clone = new RangeSeries <TKey, TValue, TCursor>(_series, _startKey, _endKey, _startInclusive, _endInclusive);

            clone.State = CursorState.Initialized;
            return(clone);
        }
示例#2
0
        /// <inheritdoc />
        public override RangeSeries <TKey, TValue, TCursor> Initialize()
        {
            if (State == CursorState.None && ThreadId == Environment.CurrentManagedThreadId)
            {
                _cursor = GetCursor <TKey, TValue, TCursor>(_series);
                State   = CursorState.Initialized;
                return(this);
            }
            var clone = new RangeSeries <TKey, TValue, TCursor>(_series, _startKey, _endKey, _startInclusive, _endInclusive);
            // NB recursive call but it should always hit the if case above
            var initialized = clone.Initialize();

            Debug.Assert(ReferenceEquals(clone, initialized));
            return(initialized);
        }
 // RangeSeries<TKey, TValue, TCursor>
 public static MapValuesSeries <TKey, TValue, TResult, RangeSeries <TKey, TValue, TCursor> > Map <TKey, TValue, TResult, TCursor>(
     this RangeSeries <TKey, TValue, TCursor> series, Func <TValue, TResult> selector)
     where TCursor : ICursor <TKey, TValue>
 {
     return(new MapValuesSeries <TKey, TValue, TResult, RangeSeries <TKey, TValue, TCursor> >(series, selector));
 }