GetNextNonEmptyQueue() private method

Find the next non empty queue starting at queue queueIndex+1
private GetNextNonEmptyQueue ( int queueIndex ) : int
queueIndex int The index-1 to start from
return int
Exemplo n.º 1
0
 public void Reset()
 {
     _version    = _priorityQueue._version;
     _queueIndex = _priorityQueue.GetNextNonEmptyQueue(-1);
     if (_queueIndex >= 0)
     {
         _enumerator = _priorityQueue._queues[_queueIndex].GetEnumerator();
     }
     else
     {
         _enumerator = null;
     }
 }
Exemplo n.º 2
0
 public PriorityQueueEnumerator(PriorityQueue priorityQueue)
 {
     _priorityQueue = priorityQueue;
     _version       = _priorityQueue._version;
     _queueIndex    = _priorityQueue.GetNextNonEmptyQueue(-1);
     _enumerator    = _queueIndex >= 0 ? _priorityQueue._queues[_queueIndex].GetEnumerator() : null;
 }
Exemplo n.º 3
0
 public PriorityQueueEnumerator(PriorityQueue priorityQueue)
 {
     _priorityQueue = priorityQueue;
     _version       = _priorityQueue._version;
     _queueIndex    = _priorityQueue.GetNextNonEmptyQueue(-1);
     if (_queueIndex >= 0)
     {
         _enumerator = _priorityQueue._queues[_queueIndex].GetEnumerator();
     }
     else
     {
         _enumerator = null;
     }
 }
Exemplo n.º 4
0
            public bool MoveNext()
            {
                if (null == _enumerator)
                {
                    return(false);
                }

                if (_version != _priorityQueue._version)
                {
                    throw new InvalidOperationException("The collection has been modified");
                }
                if (!_enumerator.MoveNext())
                {
                    _queueIndex = _priorityQueue.GetNextNonEmptyQueue(_queueIndex);
                    if (-1 == _queueIndex)
                    {
                        return(false);
                    }
                    _enumerator = _priorityQueue._queues[_queueIndex].GetEnumerator();
                    _enumerator.MoveNext();
                    return(true);
                }
                return(true);
            }
Exemplo n.º 5
0
			public PriorityQueueEnumerator(PriorityQueue priorityQueue)
			{
				_priorityQueue = priorityQueue;
				_version = _priorityQueue._version;
				_queueIndex = _priorityQueue.GetNextNonEmptyQueue(-1);
				if (_queueIndex >= 0)
				{
					_enumerator = _priorityQueue._queues[_queueIndex].GetEnumerator();
				}
				else
				{
					_enumerator = null;
				}
			}
Exemplo n.º 6
0
 public void Reset()
 {
     _version    = _priorityQueue._version;
     _queueIndex = _priorityQueue.GetNextNonEmptyQueue(-1);
     _enumerator = _queueIndex >= 0 ? _priorityQueue._queues[_queueIndex].GetEnumerator() : null;
 }
Exemplo n.º 7
0
 public PriorityQueueEnumerator(PriorityQueue priorityQueue)
 {
     _priorityQueue = priorityQueue;
     _version = _priorityQueue._version;
     _queueIndex = _priorityQueue.GetNextNonEmptyQueue(-1);
     _enumerator = _queueIndex >= 0 ? _priorityQueue._queues[_queueIndex].GetEnumerator() : null;
 }