public SegmentIterator GetEnumerator() { global::System.IntPtr cPtr = PocketSphinxPINVOKE.SegmentList_GetEnumerator(swigCPtr); SegmentIterator ret = (cPtr == global::System.IntPtr.Zero) ? null : new SegmentIterator(cPtr, true); return(ret); }
/// <summary> /// Sets the time range bounds for the cell pass filter to return relevant cell passes for /// </summary> /// <param name="hasTimeFilter"></param> /// <param name="iteratorStartTime"></param> /// <param name="iteratorEndTime"></param> public void SetTimeRange(bool hasTimeFilter, DateTime iteratorStartTime, DateTime iteratorEndTime) { IteratorStartTime = hasTimeFilter ? iteratorStartTime: Consts.MIN_DATETIME_AS_UTC; IteratorEndTime = hasTimeFilter ? iteratorEndTime : Consts.MAX_DATETIME_AS_UTC; // if we have a attached segment iterator then also set its date range SegmentIterator?.SetTimeRange(iteratorStartTime, iteratorEndTime); }
/// <summary> /// Moves to the next segment in the list of segments the cell pass iterator is iterating over /// </summary> protected void MoveToNextSegment() { SegmentIterator.MoveToNextSubGridSegment(); if (SegmentIterator.CurrentSubGridSegment != null) { InitialiseForNewSegment(); } else { cellInSegmentIndex = finishCellInSegmentIndex; } }
/// <summary> /// Initialise the cell pass iterator using the segment iterator given to it /// </summary> public void Initialise() { if (SegmentIterator == null) { throw new TRexSubGridProcessingException("No segment iterator assigned"); } lastReturnedCellPassTime = SegmentIterator.IterationDirection == IterationDirection.Forwards ? Consts.MIN_DATETIME_AS_UTC : Consts.MAX_DATETIME_AS_UTC; SegmentIterator.InitialiseIterator(); SegmentIterator.MoveToFirstSubGridSegment(); if (SegmentIterator.CurrentSubGridSegment != null) { InitialiseForNewSegment(); } }
public void Copy(int startIndex, int length, T[] array, int arrayStartIndex) { Validate.Begin().IsNotNull <T[]>(array, "array").Check().IsNotNegative(startIndex, "startIndex").IsNotNegative(length, "length").Check().IsRangeValid(this.Count, startIndex, length, "this").IsRangeValid(array.Length, arrayStartIndex, length, "array").Check(); if (length != 0) { int num = startIndex + length; int destinationIndex = arrayStartIndex; SegmentIterator <T> iterator = new SegmentIterator <T>((SegmentedList <T>) this, startIndex); int count = length; while (iterator.ListIndex < num) { int segmentSubIndex = iterator.SegmentSubIndex; int num5 = iterator.ClampForwardCountToListEndOrNextSegment(count); Array.Copy(iterator.Segment, segmentSubIndex, array, destinationIndex, num5); count -= num5; destinationIndex += num5; iterator.ListIndex += num5; } } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SegmentIterator obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
/// <summary> /// Sets the range of elevations for which cell passes will be returned in this iteration /// </summary> /// <param name="minElevation"></param> /// <param name="maxElevation"></param> public void SetIteratorElevationRange(double minElevation, double maxElevation) => SegmentIterator.SetIteratorElevationRange(minElevation, maxElevation);
public void SetUp() { _puzzle = new Puzzle(_testPuzzle); _iterator = new SegmentIterator(_puzzle); }