Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SynchronousChannelMergeEnumerator.cs
Go to the documentation of this file.
1
namespace
System.Linq.Parallel
;
2
3
internal
sealed
class
SynchronousChannelMergeEnumerator
<T> :
MergeEnumerator
<T>
4
{
5
private
readonly
SynchronousChannel<T>
[]
_channels
;
6
7
private
int
_channelIndex
;
8
9
private
T
_currentElement
;
10
11
public
override
T
Current
12
{
13
get
14
{
15
if
(
_channelIndex
== -1 ||
_channelIndex
==
_channels
.Length)
16
{
17
throw
new
InvalidOperationException
(
System
.
SR
.
PLINQ_CommonEnumerator_Current_NotStarted
);
18
}
19
return
_currentElement
;
20
}
21
}
22
23
internal
SynchronousChannelMergeEnumerator
(
QueryTaskGroupState
taskGroupState,
SynchronousChannel<T>
[] channels)
24
: base(taskGroupState)
25
{
26
_channels
= channels;
27
_channelIndex
= -1;
28
}
29
30
public
override
bool
MoveNext
()
31
{
32
if
(
_channelIndex
== -1)
33
{
34
_channelIndex
= 0;
35
}
36
while
(
_channelIndex
!=
_channels
.Length)
37
{
38
SynchronousChannel<T>
synchronousChannel =
_channels
[
_channelIndex
];
39
if
(synchronousChannel.
Count
== 0)
40
{
41
_channelIndex
++;
42
continue
;
43
}
44
_currentElement
= synchronousChannel.
Dequeue
();
45
return
true
;
46
}
47
return
false
;
48
}
49
}
System.InvalidOperationException
Definition
InvalidOperationException.cs:9
System.Linq.Parallel.MergeEnumerator
Definition
MergeEnumerator.cs:7
System.Linq.Parallel.QueryTaskGroupState
Definition
QueryTaskGroupState.cs:7
System.Linq.Parallel.SynchronousChannelMergeEnumerator.SynchronousChannelMergeEnumerator
SynchronousChannelMergeEnumerator(QueryTaskGroupState taskGroupState, SynchronousChannel< T >[] channels)
Definition
SynchronousChannelMergeEnumerator.cs:23
System.Linq.Parallel.SynchronousChannelMergeEnumerator._channels
readonly SynchronousChannel< T >[] _channels
Definition
SynchronousChannelMergeEnumerator.cs:5
System.Linq.Parallel.SynchronousChannelMergeEnumerator.MoveNext
override bool MoveNext()
Definition
SynchronousChannelMergeEnumerator.cs:30
System.Linq.Parallel.SynchronousChannelMergeEnumerator._channelIndex
int _channelIndex
Definition
SynchronousChannelMergeEnumerator.cs:7
System.Linq.Parallel.SynchronousChannelMergeEnumerator.Current
override T Current
Definition
SynchronousChannelMergeEnumerator.cs:12
System.Linq.Parallel.SynchronousChannelMergeEnumerator._currentElement
T _currentElement
Definition
SynchronousChannelMergeEnumerator.cs:9
System.Linq.Parallel.SynchronousChannelMergeEnumerator
Definition
SynchronousChannelMergeEnumerator.cs:4
System.Linq.Parallel.SynchronousChannel.Count
int Count
Definition
SynchronousChannel.cs:9
System.Linq.Parallel.SynchronousChannel.Dequeue
T Dequeue()
Definition
SynchronousChannel.cs:25
System.Linq.Parallel.SynchronousChannel
Definition
SynchronousChannel.cs:6
System.SR.PLINQ_CommonEnumerator_Current_NotStarted
static string PLINQ_CommonEnumerator_Current_NotStarted
Definition
SR.cs:24
System.SR
Definition
SR.cs:7
System.Linq.Parallel
Definition
AnyAllSearchOperator.cs:5
System
Definition
BlockingCollection.cs:8
source
System.Linq.Parallel
System.Linq.Parallel
SynchronousChannelMergeEnumerator.cs
Generated by
1.10.0