Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HashLookupBuilder.cs
Go to the documentation of this file.
1
using
System.Threading
;
2
3
namespace
System.Linq.Parallel
;
4
5
internal
abstract
class
HashLookupBuilder
<TElement, TOrderKey, THashKey>
6
{
7
protected
interface
IBaseHashBuilder
<TBaseElement, TBaseOrderKey>
8
{
9
bool
Add
(THashKey hashKey, TBaseElement element, TBaseOrderKey orderKey);
10
}
11
12
public
abstract
HashJoinHashLookup<THashKey, TElement, TOrderKey>
BuildHashLookup
(
CancellationToken
cancellationToken
);
13
14
protected
void
BuildBaseHashLookup<TBaseBuilder, TBaseElement, TBaseOrderKey>
(
QueryOperatorEnumerator
<
Pair<TBaseElement, THashKey>
, TBaseOrderKey> dataSource, TBaseBuilder baseHashBuilder,
CancellationToken
cancellationToken
) where TBaseBuilder :
IBaseHashBuilder<TBaseElement, TBaseOrderKey>
15
{
16
Pair<TBaseElement, THashKey>
currentElement =
default
(
Pair<TBaseElement, THashKey>
);
17
TBaseOrderKey currentKey =
default
(TBaseOrderKey);
18
int
num = 0;
19
while
(dataSource.MoveNext(ref currentElement, ref currentKey))
20
{
21
if
((num++ & 0x3F) == 0)
22
{
23
cancellationToken
.ThrowIfCancellationRequested();
24
}
25
TBaseElement
first
= currentElement.
First
;
26
THashKey
second
= currentElement.
Second
;
27
if
(
second
!=
null
)
28
{
29
baseHashBuilder.Add(
second
,
first
, currentKey);
30
}
31
}
32
}
33
34
public
void
Dispose
()
35
{
36
Dispose
(disposing:
true
);
37
}
38
39
protected
virtual
void
Dispose
(
bool
disposing)
40
{
41
}
42
}
System.Linq.Parallel.HashJoinHashLookup
Definition
HashJoinHashLookup.cs:4
System.Linq.Parallel.HashLookupBuilder.BuildHashLookup
HashJoinHashLookup< THashKey, TElement, TOrderKey > BuildHashLookup(CancellationToken cancellationToken)
System.Linq.Parallel.HashLookupBuilder.BuildBaseHashLookup< TBaseBuilder, TBaseElement, TBaseOrderKey >
void BuildBaseHashLookup< TBaseBuilder, TBaseElement, TBaseOrderKey >(QueryOperatorEnumerator< Pair< TBaseElement, THashKey >, TBaseOrderKey > dataSource, TBaseBuilder baseHashBuilder, CancellationToken cancellationToken)
Definition
HashLookupBuilder.cs:14
System.Linq.Parallel.HashLookupBuilder.Dispose
virtual void Dispose(bool disposing)
Definition
HashLookupBuilder.cs:39
System.Linq.Parallel.HashLookupBuilder.Dispose
void Dispose()
Definition
HashLookupBuilder.cs:34
System.Linq.Parallel.HashLookupBuilder
Definition
HashLookupBuilder.cs:6
System.Linq.Parallel.QueryOperatorEnumerator
Definition
QueryOperatorEnumerator.cs:8
System.Linq.Parallel.HashLookupBuilder.IBaseHashBuilder.Add
bool Add(THashKey hashKey, TBaseElement element, TBaseOrderKey orderKey)
System.Linq.Parallel.HashLookupBuilder.IBaseHashBuilder
Definition
HashLookupBuilder.cs:8
System.Linq.Parallel
Definition
AnyAllSearchOperator.cs:5
System.Linq.ExceptionArgument.first
@ first
System.Linq.ExceptionArgument.second
@ second
System.Threading
Definition
TaskToApm.cs:3
System.ExceptionArgument.cancellationToken
@ cancellationToken
System.Linq.Parallel.Pair.First
T First
Definition
Pair.cs:10
System.Linq.Parallel.Pair.Second
U Second
Definition
Pair.cs:22
System.Linq.Parallel.Pair
Definition
Pair.cs:4
System.Threading.CancellationToken
Definition
CancellationToken.cs:8
source
System.Linq.Parallel
System.Linq.Parallel
HashLookupBuilder.cs
Generated by
1.10.0