Debian Codegraph @

external/rx/Rx/NET/Source/System.Reactive.Linq/Reactive/Joins/ActivePlan.cs

raw
1 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
3 using System.Collections.Generic;
4
5 namespace System.Reactive.Joins
6 {
7 internal abstract class ActivePlan
8 {
9 Dictionary<IJoinObserver, IJoinObserver> joinObservers = new Dictionary<IJoinObserver, IJoinObserver>();
10
11 internal abstract void Match();
12
13 protected void AddJoinObserver(IJoinObserver joinObserver)
14 {
15 joinObservers.Add(joinObserver, joinObserver);
16 }
17
18 protected void Dequeue()
19 {
20 foreach (var joinObserver in joinObservers.Values)
21 joinObserver.Dequeue();
22 }
23 }
24
25 internal class ActivePlan<T1> : ActivePlan
26 {
27 private readonly Action<T1> onNext;
28 private readonly Action onCompleted;
29 private readonly JoinObserver<T1> first;
30
31 internal ActivePlan(JoinObserver<T1> first, Action<T1> onNext, Action onCompleted)
32 {
33 this.onNext = onNext;
34 this.onCompleted = onCompleted;
35 this.first = first;
36 AddJoinObserver(first);
37 }
38
39 internal override void Match()
40 {
41 if (first.Queue.Count > 0)
42 {
43 var n1 = first.Queue.Peek();
44
45 if (n1.Kind == NotificationKind.OnCompleted)
46 onCompleted();
47 else
48 {
49 Dequeue();
50 onNext(n1.Value
51 );
52 }
53 }
54 }
55 }
56
57 internal class ActivePlan<T1, T2> : ActivePlan
58 {
59 private readonly Action<T1, T2> onNext;
60 private readonly Action onCompleted;
61 private readonly JoinObserver<T1> first;
62 private readonly JoinObserver<T2> second;
63
64 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, Action<T1, T2> onNext, Action onCompleted)
65 {
66 this.onNext = onNext;
67 this.onCompleted = onCompleted;
68 this.first = first;
69 this.second = second;
70 AddJoinObserver(first);
71 AddJoinObserver(second);
72 }
73
74 internal override void Match()
75 {
76 if (first.Queue.Count > 0
77 && second.Queue.Count > 0)
78 {
79 var n1 = first.Queue.Peek();
80 var n2 = second.Queue.Peek();
81
82 if ( n1.Kind == NotificationKind.OnCompleted
83 || n2.Kind == NotificationKind.OnCompleted)
84 onCompleted();
85 else
86 {
87 Dequeue();
88 onNext(n1.Value,
89 n2.Value
90 );
91 }
92 }
93 }
94 }
95
96 internal class ActivePlan<T1, T2, T3> : ActivePlan
97 {
98 private readonly Action<T1, T2, T3> onNext;
99 private readonly Action onCompleted;
100 private readonly JoinObserver<T1> first;
101 private readonly JoinObserver<T2> second;
102 private readonly JoinObserver<T3> third;
103
104 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third, Action<T1, T2, T3> onNext, Action onCompleted)
105 {
106 this.onNext = onNext;
107 this.onCompleted = onCompleted;
108 this.first = first;
109 this.second = second;
110 this.third = third;
111 AddJoinObserver(first);
112 AddJoinObserver(second);
113 AddJoinObserver(third);
114 }
115
116 internal override void Match()
117 {
118 if (first.Queue.Count > 0
119 && second.Queue.Count > 0
120 && third.Queue.Count > 0)
121 {
122 var n1 = first.Queue.Peek();
123 var n2 = second.Queue.Peek();
124 var n3 = third.Queue.Peek();
125
126 if ( n1.Kind == NotificationKind.OnCompleted
127 || n2.Kind == NotificationKind.OnCompleted
128 || n3.Kind == NotificationKind.OnCompleted)
129 onCompleted();
130 else
131 {
132 Dequeue();
133 onNext(n1.Value,
134 n2.Value,
135 n3.Value
136 );
137 }
138 }
139 }
140 }
141
142 internal class ActivePlan<T1, T2, T3, T4> : ActivePlan
143 {
144 private readonly Action<T1, T2, T3, T4> onNext;
145 private readonly Action onCompleted;
146 private readonly JoinObserver<T1> first;
147 private readonly JoinObserver<T2> second;
148 private readonly JoinObserver<T3> third;
149 private readonly JoinObserver<T4> fourth;
150
151 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third, JoinObserver<T4> fourth, Action<T1, T2, T3, T4> onNext, Action onCompleted)
152 {
153 this.onNext = onNext;
154 this.onCompleted = onCompleted;
155 this.first = first;
156 this.second = second;
157 this.third = third;
158 this.fourth = fourth;
159 AddJoinObserver(first);
160 AddJoinObserver(second);
161 AddJoinObserver(third);
162 AddJoinObserver(fourth);
163 }
164
165 internal override void Match()
166 {
167 if (first.Queue.Count > 0
168 && second.Queue.Count > 0
169 && third.Queue.Count > 0
170 && fourth.Queue.Count > 0)
171 {
172 var n1 = first.Queue.Peek();
173 var n2 = second.Queue.Peek();
174 var n3 = third.Queue.Peek();
175 var n4 = fourth.Queue.Peek();
176
177 if ( n1.Kind == NotificationKind.OnCompleted
178 || n2.Kind == NotificationKind.OnCompleted
179 || n3.Kind == NotificationKind.OnCompleted
180 || n4.Kind == NotificationKind.OnCompleted)
181 onCompleted();
182 else
183 {
184 Dequeue();
185 onNext(n1.Value,
186 n2.Value,
187 n3.Value,
188 n4.Value
189 );
190 }
191 }
192 }
193 }
194 #if !NO_LARGEARITY
195
196 internal class ActivePlan<T1, T2, T3, T4, T5> : ActivePlan
197 {
198 private readonly Action<T1, T2, T3, T4, T5> onNext;
199 private readonly Action onCompleted;
200 private readonly JoinObserver<T1> first;
201 private readonly JoinObserver<T2> second;
202 private readonly JoinObserver<T3> third;
203 private readonly JoinObserver<T4> fourth;
204 private readonly JoinObserver<T5> fifth;
205
206 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
207 JoinObserver<T4> fourth, JoinObserver<T5> fifth, Action<T1, T2, T3, T4, T5> onNext, Action onCompleted)
208 {
209 this.onNext = onNext;
210 this.onCompleted = onCompleted;
211 this.first = first;
212 this.second = second;
213 this.third = third;
214 this.fourth = fourth;
215 this.fifth = fifth;
216 AddJoinObserver(first);
217 AddJoinObserver(second);
218 AddJoinObserver(third);
219 AddJoinObserver(fourth);
220 AddJoinObserver(fifth);
221 }
222
223 internal override void Match()
224 {
225 if (first.Queue.Count > 0
226 && second.Queue.Count > 0
227 && third.Queue.Count > 0
228 && fourth.Queue.Count > 0
229 && fifth.Queue.Count > 0)
230 {
231 var n1 = first.Queue.Peek();
232 var n2 = second.Queue.Peek();
233 var n3 = third.Queue.Peek();
234 var n4 = fourth.Queue.Peek();
235 var n5 = fifth.Queue.Peek();
236
237 if ( n1.Kind == NotificationKind.OnCompleted
238 || n2.Kind == NotificationKind.OnCompleted
239 || n3.Kind == NotificationKind.OnCompleted
240 || n4.Kind == NotificationKind.OnCompleted
241 || n5.Kind == NotificationKind.OnCompleted)
242 onCompleted();
243 else
244 {
245 Dequeue();
246 onNext(n1.Value,
247 n2.Value,
248 n3.Value,
249 n4.Value,
250 n5.Value
251 );
252 }
253 }
254 }
255 }
256
257 internal class ActivePlan<T1, T2, T3, T4, T5, T6> : ActivePlan
258 {
259 private readonly Action<T1, T2, T3, T4, T5, T6> onNext;
260 private readonly Action onCompleted;
261 private readonly JoinObserver<T1> first;
262 private readonly JoinObserver<T2> second;
263 private readonly JoinObserver<T3> third;
264 private readonly JoinObserver<T4> fourth;
265 private readonly JoinObserver<T5> fifth;
266 private readonly JoinObserver<T6> sixth;
267
268 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
269 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth,
270 Action<T1, T2, T3, T4, T5, T6> onNext, Action onCompleted)
271 {
272 this.onNext = onNext;
273 this.onCompleted = onCompleted;
274 this.first = first;
275 this.second = second;
276 this.third = third;
277 this.fourth = fourth;
278 this.fifth = fifth;
279 this.sixth = sixth;
280 AddJoinObserver(first);
281 AddJoinObserver(second);
282 AddJoinObserver(third);
283 AddJoinObserver(fourth);
284 AddJoinObserver(fifth);
285 AddJoinObserver(sixth);
286 }
287
288 internal override void Match()
289 {
290 if (first.Queue.Count > 0
291 && second.Queue.Count > 0
292 && third.Queue.Count > 0
293 && fourth.Queue.Count > 0
294 && fifth.Queue.Count > 0
295 && sixth.Queue.Count > 0)
296 {
297 var n1 = first.Queue.Peek();
298 var n2 = second.Queue.Peek();
299 var n3 = third.Queue.Peek();
300 var n4 = fourth.Queue.Peek();
301 var n5 = fifth.Queue.Peek();
302 var n6 = sixth.Queue.Peek();
303
304 if ( n1.Kind == NotificationKind.OnCompleted
305 || n2.Kind == NotificationKind.OnCompleted
306 || n3.Kind == NotificationKind.OnCompleted
307 || n4.Kind == NotificationKind.OnCompleted
308 || n5.Kind == NotificationKind.OnCompleted
309 || n6.Kind == NotificationKind.OnCompleted)
310 onCompleted();
311 else
312 {
313 Dequeue();
314 onNext(n1.Value,
315 n2.Value,
316 n3.Value,
317 n4.Value,
318 n5.Value,
319 n6.Value
320 );
321 }
322 }
323 }
324 }
325
326 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7> : ActivePlan
327 {
328 private readonly Action<T1, T2, T3, T4, T5, T6, T7> onNext;
329 private readonly Action onCompleted;
330 private readonly JoinObserver<T1> first;
331 private readonly JoinObserver<T2> second;
332 private readonly JoinObserver<T3> third;
333 private readonly JoinObserver<T4> fourth;
334 private readonly JoinObserver<T5> fifth;
335 private readonly JoinObserver<T6> sixth;
336 private readonly JoinObserver<T7> seventh;
337
338 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
339 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
340 Action<T1, T2, T3, T4, T5, T6, T7> onNext, Action onCompleted)
341 {
342 this.onNext = onNext;
343 this.onCompleted = onCompleted;
344 this.first = first;
345 this.second = second;
346 this.third = third;
347 this.fourth = fourth;
348 this.fifth = fifth;
349 this.sixth = sixth;
350 this.seventh = seventh;
351 AddJoinObserver(first);
352 AddJoinObserver(second);
353 AddJoinObserver(third);
354 AddJoinObserver(fourth);
355 AddJoinObserver(fifth);
356 AddJoinObserver(sixth);
357 AddJoinObserver(seventh);
358 }
359
360 internal override void Match()
361 {
362 if (first.Queue.Count > 0
363 && second.Queue.Count > 0
364 && third.Queue.Count > 0
365 && fourth.Queue.Count > 0
366 && fifth.Queue.Count > 0
367 && sixth.Queue.Count > 0
368 && seventh.Queue.Count > 0)
369 {
370 var n1 = first.Queue.Peek();
371 var n2 = second.Queue.Peek();
372 var n3 = third.Queue.Peek();
373 var n4 = fourth.Queue.Peek();
374 var n5 = fifth.Queue.Peek();
375 var n6 = sixth.Queue.Peek();
376 var n7 = seventh.Queue.Peek();
377
378 if ( n1.Kind == NotificationKind.OnCompleted
379 || n2.Kind == NotificationKind.OnCompleted
380 || n3.Kind == NotificationKind.OnCompleted
381 || n4.Kind == NotificationKind.OnCompleted
382 || n5.Kind == NotificationKind.OnCompleted
383 || n6.Kind == NotificationKind.OnCompleted
384 || n7.Kind == NotificationKind.OnCompleted)
385 onCompleted();
386 else
387 {
388 Dequeue();
389 onNext(n1.Value,
390 n2.Value,
391 n3.Value,
392 n4.Value,
393 n5.Value,
394 n6.Value,
395 n7.Value
396 );
397 }
398 }
399 }
400 }
401
402 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8> : ActivePlan
403 {
404 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8> onNext;
405 private readonly Action onCompleted;
406 private readonly JoinObserver<T1> first;
407 private readonly JoinObserver<T2> second;
408 private readonly JoinObserver<T3> third;
409 private readonly JoinObserver<T4> fourth;
410 private readonly JoinObserver<T5> fifth;
411 private readonly JoinObserver<T6> sixth;
412 private readonly JoinObserver<T7> seventh;
413 private readonly JoinObserver<T8> eighth;
414
415 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
416 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
417 JoinObserver<T8> eighth,
418 Action<T1, T2, T3, T4, T5, T6, T7, T8> onNext, Action onCompleted)
419 {
420 this.onNext = onNext;
421 this.onCompleted = onCompleted;
422 this.first = first;
423 this.second = second;
424 this.third = third;
425 this.fourth = fourth;
426 this.fifth = fifth;
427 this.sixth = sixth;
428 this.seventh = seventh;
429 this.eighth = eighth;
430 AddJoinObserver(first);
431 AddJoinObserver(second);
432 AddJoinObserver(third);
433 AddJoinObserver(fourth);
434 AddJoinObserver(fifth);
435 AddJoinObserver(sixth);
436 AddJoinObserver(seventh);
437 AddJoinObserver(eighth);
438 }
439
440 internal override void Match()
441 {
442 if (first.Queue.Count > 0
443 && second.Queue.Count > 0
444 && third.Queue.Count > 0
445 && fourth.Queue.Count > 0
446 && fifth.Queue.Count > 0
447 && sixth.Queue.Count > 0
448 && seventh.Queue.Count > 0
449 && eighth.Queue.Count > 0)
450 {
451 var n1 = first.Queue.Peek();
452 var n2 = second.Queue.Peek();
453 var n3 = third.Queue.Peek();
454 var n4 = fourth.Queue.Peek();
455 var n5 = fifth.Queue.Peek();
456 var n6 = sixth.Queue.Peek();
457 var n7 = seventh.Queue.Peek();
458 var n8 = eighth.Queue.Peek();
459
460 if ( n1.Kind == NotificationKind.OnCompleted
461 || n2.Kind == NotificationKind.OnCompleted
462 || n3.Kind == NotificationKind.OnCompleted
463 || n4.Kind == NotificationKind.OnCompleted
464 || n5.Kind == NotificationKind.OnCompleted
465 || n6.Kind == NotificationKind.OnCompleted
466 || n7.Kind == NotificationKind.OnCompleted
467 || n8.Kind == NotificationKind.OnCompleted
468 )
469 onCompleted();
470 else
471 {
472 Dequeue();
473 onNext(n1.Value,
474 n2.Value,
475 n3.Value,
476 n4.Value,
477 n5.Value,
478 n6.Value,
479 n7.Value,
480 n8.Value
481 );
482 }
483 }
484 }
485 }
486
487 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9> : ActivePlan
488 {
489 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> onNext;
490 private readonly Action onCompleted;
491 private readonly JoinObserver<T1> first;
492 private readonly JoinObserver<T2> second;
493 private readonly JoinObserver<T3> third;
494 private readonly JoinObserver<T4> fourth;
495 private readonly JoinObserver<T5> fifth;
496 private readonly JoinObserver<T6> sixth;
497 private readonly JoinObserver<T7> seventh;
498 private readonly JoinObserver<T8> eighth;
499 private readonly JoinObserver<T9> ninth;
500
501 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
502 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
503 JoinObserver<T8> eighth, JoinObserver<T9> ninth,
504 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> onNext, Action onCompleted)
505 {
506 this.onNext = onNext;
507 this.onCompleted = onCompleted;
508 this.first = first;
509 this.second = second;
510 this.third = third;
511 this.fourth = fourth;
512 this.fifth = fifth;
513 this.sixth = sixth;
514 this.seventh = seventh;
515 this.eighth = eighth;
516 this.ninth = ninth;
517 AddJoinObserver(first);
518 AddJoinObserver(second);
519 AddJoinObserver(third);
520 AddJoinObserver(fourth);
521 AddJoinObserver(fifth);
522 AddJoinObserver(sixth);
523 AddJoinObserver(seventh);
524 AddJoinObserver(eighth);
525 AddJoinObserver(ninth);
526 }
527
528 internal override void Match()
529 {
530 if (first.Queue.Count > 0
531 && second.Queue.Count > 0
532 && third.Queue.Count > 0
533 && fourth.Queue.Count > 0
534 && fifth.Queue.Count > 0
535 && sixth.Queue.Count > 0
536 && seventh.Queue.Count > 0
537 && eighth.Queue.Count > 0
538 && ninth.Queue.Count > 0
539 )
540 {
541 var n1 = first.Queue.Peek();
542 var n2 = second.Queue.Peek();
543 var n3 = third.Queue.Peek();
544 var n4 = fourth.Queue.Peek();
545 var n5 = fifth.Queue.Peek();
546 var n6 = sixth.Queue.Peek();
547 var n7 = seventh.Queue.Peek();
548 var n8 = eighth.Queue.Peek();
549 var n9 = ninth.Queue.Peek();
550
551 if ( n1.Kind == NotificationKind.OnCompleted
552 || n2.Kind == NotificationKind.OnCompleted
553 || n3.Kind == NotificationKind.OnCompleted
554 || n4.Kind == NotificationKind.OnCompleted
555 || n5.Kind == NotificationKind.OnCompleted
556 || n6.Kind == NotificationKind.OnCompleted
557 || n7.Kind == NotificationKind.OnCompleted
558 || n8.Kind == NotificationKind.OnCompleted
559 || n9.Kind == NotificationKind.OnCompleted
560 )
561 onCompleted();
562 else
563 {
564 Dequeue();
565 onNext(n1.Value,
566 n2.Value,
567 n3.Value,
568 n4.Value,
569 n5.Value,
570 n6.Value,
571 n7.Value,
572 n8.Value,
573 n9.Value
574 );
575 }
576 }
577 }
578 }
579
580 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : ActivePlan
581 {
582 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> onNext;
583 private readonly Action onCompleted;
584 private readonly JoinObserver<T1> first;
585 private readonly JoinObserver<T2> second;
586 private readonly JoinObserver<T3> third;
587 private readonly JoinObserver<T4> fourth;
588 private readonly JoinObserver<T5> fifth;
589 private readonly JoinObserver<T6> sixth;
590 private readonly JoinObserver<T7> seventh;
591 private readonly JoinObserver<T8> eighth;
592 private readonly JoinObserver<T9> ninth;
593 private readonly JoinObserver<T10> tenth;
594
595 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
596 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
597 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth,
598 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> onNext, Action onCompleted)
599 {
600 this.onNext = onNext;
601 this.onCompleted = onCompleted;
602 this.first = first;
603 this.second = second;
604 this.third = third;
605 this.fourth = fourth;
606 this.fifth = fifth;
607 this.sixth = sixth;
608 this.seventh = seventh;
609 this.eighth = eighth;
610 this.ninth = ninth;
611 this.tenth = tenth;
612 AddJoinObserver(first);
613 AddJoinObserver(second);
614 AddJoinObserver(third);
615 AddJoinObserver(fourth);
616 AddJoinObserver(fifth);
617 AddJoinObserver(sixth);
618 AddJoinObserver(seventh);
619 AddJoinObserver(eighth);
620 AddJoinObserver(ninth);
621 AddJoinObserver(tenth);
622 }
623
624 internal override void Match()
625 {
626 if (first.Queue.Count > 0
627 && second.Queue.Count > 0
628 && third.Queue.Count > 0
629 && fourth.Queue.Count > 0
630 && fifth.Queue.Count > 0
631 && sixth.Queue.Count > 0
632 && seventh.Queue.Count > 0
633 && eighth.Queue.Count > 0
634 && ninth.Queue.Count > 0
635 && tenth.Queue.Count > 0
636 )
637 {
638 var n1 = first.Queue.Peek();
639 var n2 = second.Queue.Peek();
640 var n3 = third.Queue.Peek();
641 var n4 = fourth.Queue.Peek();
642 var n5 = fifth.Queue.Peek();
643 var n6 = sixth.Queue.Peek();
644 var n7 = seventh.Queue.Peek();
645 var n8 = eighth.Queue.Peek();
646 var n9 = ninth.Queue.Peek();
647 var n10 = tenth.Queue.Peek();
648
649 if ( n1.Kind == NotificationKind.OnCompleted
650 || n2.Kind == NotificationKind.OnCompleted
651 || n3.Kind == NotificationKind.OnCompleted
652 || n4.Kind == NotificationKind.OnCompleted
653 || n5.Kind == NotificationKind.OnCompleted
654 || n6.Kind == NotificationKind.OnCompleted
655 || n7.Kind == NotificationKind.OnCompleted
656 || n8.Kind == NotificationKind.OnCompleted
657 || n9.Kind == NotificationKind.OnCompleted
658 || n10.Kind == NotificationKind.OnCompleted
659 )
660 onCompleted();
661 else
662 {
663 Dequeue();
664 onNext(n1.Value,
665 n2.Value,
666 n3.Value,
667 n4.Value,
668 n5.Value,
669 n6.Value,
670 n7.Value,
671 n8.Value,
672 n9.Value,
673 n10.Value
674 );
675 }
676 }
677 }
678 }
679
680 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : ActivePlan
681 {
682 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> onNext;
683 private readonly Action onCompleted;
684 private readonly JoinObserver<T1> first;
685 private readonly JoinObserver<T2> second;
686 private readonly JoinObserver<T3> third;
687 private readonly JoinObserver<T4> fourth;
688 private readonly JoinObserver<T5> fifth;
689 private readonly JoinObserver<T6> sixth;
690 private readonly JoinObserver<T7> seventh;
691 private readonly JoinObserver<T8> eighth;
692 private readonly JoinObserver<T9> ninth;
693 private readonly JoinObserver<T10> tenth;
694 private readonly JoinObserver<T11> eleventh;
695
696 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
697 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
698 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
699 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> onNext, Action onCompleted)
700 {
701 this.onNext = onNext;
702 this.onCompleted = onCompleted;
703 this.first = first;
704 this.second = second;
705 this.third = third;
706 this.fourth = fourth;
707 this.fifth = fifth;
708 this.sixth = sixth;
709 this.seventh = seventh;
710 this.eighth = eighth;
711 this.ninth = ninth;
712 this.tenth = tenth;
713 this.eleventh = eleventh;
714 AddJoinObserver(first);
715 AddJoinObserver(second);
716 AddJoinObserver(third);
717 AddJoinObserver(fourth);
718 AddJoinObserver(fifth);
719 AddJoinObserver(sixth);
720 AddJoinObserver(seventh);
721 AddJoinObserver(eighth);
722 AddJoinObserver(ninth);
723 AddJoinObserver(tenth);
724 AddJoinObserver(eleventh);
725 }
726
727 internal override void Match()
728 {
729 if (first.Queue.Count > 0
730 && second.Queue.Count > 0
731 && third.Queue.Count > 0
732 && fourth.Queue.Count > 0
733 && fifth.Queue.Count > 0
734 && sixth.Queue.Count > 0
735 && seventh.Queue.Count > 0
736 && eighth.Queue.Count > 0
737 && ninth.Queue.Count > 0
738 && tenth.Queue.Count > 0
739 && eleventh.Queue.Count > 0
740 )
741 {
742 var n1 = first.Queue.Peek();
743 var n2 = second.Queue.Peek();
744 var n3 = third.Queue.Peek();
745 var n4 = fourth.Queue.Peek();
746 var n5 = fifth.Queue.Peek();
747 var n6 = sixth.Queue.Peek();
748 var n7 = seventh.Queue.Peek();
749 var n8 = eighth.Queue.Peek();
750 var n9 = ninth.Queue.Peek();
751 var n10 = tenth.Queue.Peek();
752 var n11 = eleventh.Queue.Peek();
753
754 if ( n1.Kind == NotificationKind.OnCompleted
755 || n2.Kind == NotificationKind.OnCompleted
756 || n3.Kind == NotificationKind.OnCompleted
757 || n4.Kind == NotificationKind.OnCompleted
758 || n5.Kind == NotificationKind.OnCompleted
759 || n6.Kind == NotificationKind.OnCompleted
760 || n7.Kind == NotificationKind.OnCompleted
761 || n8.Kind == NotificationKind.OnCompleted
762 || n9.Kind == NotificationKind.OnCompleted
763 || n10.Kind == NotificationKind.OnCompleted
764 || n11.Kind == NotificationKind.OnCompleted
765 )
766 onCompleted();
767 else
768 {
769 Dequeue();
770 onNext(n1.Value,
771 n2.Value,
772 n3.Value,
773 n4.Value,
774 n5.Value,
775 n6.Value,
776 n7.Value,
777 n8.Value,
778 n9.Value,
779 n10.Value,
780 n11.Value
781 );
782 }
783 }
784 }
785 }
786
787 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : ActivePlan
788 {
789 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> onNext;
790 private readonly Action onCompleted;
791 private readonly JoinObserver<T1> first;
792 private readonly JoinObserver<T2> second;
793 private readonly JoinObserver<T3> third;
794 private readonly JoinObserver<T4> fourth;
795 private readonly JoinObserver<T5> fifth;
796 private readonly JoinObserver<T6> sixth;
797 private readonly JoinObserver<T7> seventh;
798 private readonly JoinObserver<T8> eighth;
799 private readonly JoinObserver<T9> ninth;
800 private readonly JoinObserver<T10> tenth;
801 private readonly JoinObserver<T11> eleventh;
802 private readonly JoinObserver<T12> twelfth;
803
804 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
805 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
806 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
807 JoinObserver<T12> twelfth,
808 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> onNext, Action onCompleted)
809 {
810 this.onNext = onNext;
811 this.onCompleted = onCompleted;
812 this.first = first;
813 this.second = second;
814 this.third = third;
815 this.fourth = fourth;
816 this.fifth = fifth;
817 this.sixth = sixth;
818 this.seventh = seventh;
819 this.eighth = eighth;
820 this.ninth = ninth;
821 this.tenth = tenth;
822 this.eleventh = eleventh;
823 this.twelfth = twelfth;
824 AddJoinObserver(first);
825 AddJoinObserver(second);
826 AddJoinObserver(third);
827 AddJoinObserver(fourth);
828 AddJoinObserver(fifth);
829 AddJoinObserver(sixth);
830 AddJoinObserver(seventh);
831 AddJoinObserver(eighth);
832 AddJoinObserver(ninth);
833 AddJoinObserver(tenth);
834 AddJoinObserver(eleventh);
835 AddJoinObserver(twelfth);
836 }
837
838 internal override void Match()
839 {
840 if (first.Queue.Count > 0
841 && second.Queue.Count > 0
842 && third.Queue.Count > 0
843 && fourth.Queue.Count > 0
844 && fifth.Queue.Count > 0
845 && sixth.Queue.Count > 0
846 && seventh.Queue.Count > 0
847 && eighth.Queue.Count > 0
848 && ninth.Queue.Count > 0
849 && tenth.Queue.Count > 0
850 && eleventh.Queue.Count > 0
851 && twelfth.Queue.Count > 0
852 )
853 {
854 var n1 = first.Queue.Peek();
855 var n2 = second.Queue.Peek();
856 var n3 = third.Queue.Peek();
857 var n4 = fourth.Queue.Peek();
858 var n5 = fifth.Queue.Peek();
859 var n6 = sixth.Queue.Peek();
860 var n7 = seventh.Queue.Peek();
861 var n8 = eighth.Queue.Peek();
862 var n9 = ninth.Queue.Peek();
863 var n10 = tenth.Queue.Peek();
864 var n11 = eleventh.Queue.Peek();
865 var n12 = twelfth.Queue.Peek();
866
867 if ( n1.Kind == NotificationKind.OnCompleted
868 || n2.Kind == NotificationKind.OnCompleted
869 || n3.Kind == NotificationKind.OnCompleted
870 || n4.Kind == NotificationKind.OnCompleted
871 || n5.Kind == NotificationKind.OnCompleted
872 || n6.Kind == NotificationKind.OnCompleted
873 || n7.Kind == NotificationKind.OnCompleted
874 || n8.Kind == NotificationKind.OnCompleted
875 || n9.Kind == NotificationKind.OnCompleted
876 || n10.Kind == NotificationKind.OnCompleted
877 || n11.Kind == NotificationKind.OnCompleted
878 || n12.Kind == NotificationKind.OnCompleted
879 )
880 onCompleted();
881 else
882 {
883 Dequeue();
884 onNext(n1.Value,
885 n2.Value,
886 n3.Value,
887 n4.Value,
888 n5.Value,
889 n6.Value,
890 n7.Value,
891 n8.Value,
892 n9.Value,
893 n10.Value,
894 n11.Value,
895 n12.Value
896 );
897 }
898 }
899 }
900 }
901
902 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : ActivePlan
903 {
904 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> onNext;
905 private readonly Action onCompleted;
906 private readonly JoinObserver<T1> first;
907 private readonly JoinObserver<T2> second;
908 private readonly JoinObserver<T3> third;
909 private readonly JoinObserver<T4> fourth;
910 private readonly JoinObserver<T5> fifth;
911 private readonly JoinObserver<T6> sixth;
912 private readonly JoinObserver<T7> seventh;
913 private readonly JoinObserver<T8> eighth;
914 private readonly JoinObserver<T9> ninth;
915 private readonly JoinObserver<T10> tenth;
916 private readonly JoinObserver<T11> eleventh;
917 private readonly JoinObserver<T12> twelfth;
918 private readonly JoinObserver<T13> thirteenth;
919
920 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
921 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
922 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
923 JoinObserver<T12> twelfth, JoinObserver<T13> thirteenth,
924 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> onNext, Action onCompleted)
925 {
926 this.onNext = onNext;
927 this.onCompleted = onCompleted;
928 this.first = first;
929 this.second = second;
930 this.third = third;
931 this.fourth = fourth;
932 this.fifth = fifth;
933 this.sixth = sixth;
934 this.seventh = seventh;
935 this.eighth = eighth;
936 this.ninth = ninth;
937 this.tenth = tenth;
938 this.eleventh = eleventh;
939 this.twelfth = twelfth;
940 this.thirteenth = thirteenth;
941 AddJoinObserver(first);
942 AddJoinObserver(second);
943 AddJoinObserver(third);
944 AddJoinObserver(fourth);
945 AddJoinObserver(fifth);
946 AddJoinObserver(sixth);
947 AddJoinObserver(seventh);
948 AddJoinObserver(eighth);
949 AddJoinObserver(ninth);
950 AddJoinObserver(tenth);
951 AddJoinObserver(eleventh);
952 AddJoinObserver(twelfth);
953 AddJoinObserver(thirteenth);
954 }
955
956 internal override void Match()
957 {
958 if (first.Queue.Count > 0
959 && second.Queue.Count > 0
960 && third.Queue.Count > 0
961 && fourth.Queue.Count > 0
962 && fifth.Queue.Count > 0
963 && sixth.Queue.Count > 0
964 && seventh.Queue.Count > 0
965 && eighth.Queue.Count > 0
966 && ninth.Queue.Count > 0
967 && tenth.Queue.Count > 0
968 && eleventh.Queue.Count > 0
969 && twelfth.Queue.Count > 0
970 && thirteenth.Queue.Count > 0
971 )
972 {
973 var n1 = first.Queue.Peek();
974 var n2 = second.Queue.Peek();
975 var n3 = third.Queue.Peek();
976 var n4 = fourth.Queue.Peek();
977 var n5 = fifth.Queue.Peek();
978 var n6 = sixth.Queue.Peek();
979 var n7 = seventh.Queue.Peek();
980 var n8 = eighth.Queue.Peek();
981 var n9 = ninth.Queue.Peek();
982 var n10 = tenth.Queue.Peek();
983 var n11 = eleventh.Queue.Peek();
984 var n12 = twelfth.Queue.Peek();
985 var n13 = thirteenth.Queue.Peek();
986
987 if ( n1.Kind == NotificationKind.OnCompleted
988 || n2.Kind == NotificationKind.OnCompleted
989 || n3.Kind == NotificationKind.OnCompleted
990 || n4.Kind == NotificationKind.OnCompleted
991 || n5.Kind == NotificationKind.OnCompleted
992 || n6.Kind == NotificationKind.OnCompleted
993 || n7.Kind == NotificationKind.OnCompleted
994 || n8.Kind == NotificationKind.OnCompleted
995 || n9.Kind == NotificationKind.OnCompleted
996 || n10.Kind == NotificationKind.OnCompleted
997 || n11.Kind == NotificationKind.OnCompleted
998 || n12.Kind == NotificationKind.OnCompleted
999 || n13.Kind == NotificationKind.OnCompleted
1000 )
1001 onCompleted();
1002 else
1003 {
1004 Dequeue();
1005 onNext(n1.Value,
1006 n2.Value,
1007 n3.Value,
1008 n4.Value,
1009 n5.Value,
1010 n6.Value,
1011 n7.Value,
1012 n8.Value,
1013 n9.Value,
1014 n10.Value,
1015 n11.Value,
1016 n12.Value,
1017 n13.Value
1018 );
1019 }
1020 }
1021 }
1022 }
1023
1024 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : ActivePlan
1025 {
1026 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> onNext;
1027 private readonly Action onCompleted;
1028 private readonly JoinObserver<T1> first;
1029 private readonly JoinObserver<T2> second;
1030 private readonly JoinObserver<T3> third;
1031 private readonly JoinObserver<T4> fourth;
1032 private readonly JoinObserver<T5> fifth;
1033 private readonly JoinObserver<T6> sixth;
1034 private readonly JoinObserver<T7> seventh;
1035 private readonly JoinObserver<T8> eighth;
1036 private readonly JoinObserver<T9> ninth;
1037 private readonly JoinObserver<T10> tenth;
1038 private readonly JoinObserver<T11> eleventh;
1039 private readonly JoinObserver<T12> twelfth;
1040 private readonly JoinObserver<T13> thirteenth;
1041 private readonly JoinObserver<T14> fourteenth;
1042
1043 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
1044 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
1045 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
1046 JoinObserver<T12> twelfth, JoinObserver<T13> thirteenth, JoinObserver<T14> fourteenth,
1047 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> onNext, Action onCompleted)
1048 {
1049 this.onNext = onNext;
1050 this.onCompleted = onCompleted;
1051 this.first = first;
1052 this.second = second;
1053 this.third = third;
1054 this.fourth = fourth;
1055 this.fifth = fifth;
1056 this.sixth = sixth;
1057 this.seventh = seventh;
1058 this.eighth = eighth;
1059 this.ninth = ninth;
1060 this.tenth = tenth;
1061 this.eleventh = eleventh;
1062 this.twelfth = twelfth;
1063 this.thirteenth = thirteenth;
1064 this.fourteenth = fourteenth;
1065 AddJoinObserver(first);
1066 AddJoinObserver(second);
1067 AddJoinObserver(third);
1068 AddJoinObserver(fourth);
1069 AddJoinObserver(fifth);
1070 AddJoinObserver(sixth);
1071 AddJoinObserver(seventh);
1072 AddJoinObserver(eighth);
1073 AddJoinObserver(ninth);
1074 AddJoinObserver(tenth);
1075 AddJoinObserver(eleventh);
1076 AddJoinObserver(twelfth);
1077 AddJoinObserver(thirteenth);
1078 AddJoinObserver(fourteenth);
1079 }
1080
1081 internal override void Match()
1082 {
1083 if (first.Queue.Count > 0
1084 && second.Queue.Count > 0
1085 && third.Queue.Count > 0
1086 && fourth.Queue.Count > 0
1087 && fifth.Queue.Count > 0
1088 && sixth.Queue.Count > 0
1089 && seventh.Queue.Count > 0
1090 && eighth.Queue.Count > 0
1091 && ninth.Queue.Count > 0
1092 && tenth.Queue.Count > 0
1093 && eleventh.Queue.Count > 0
1094 && twelfth.Queue.Count > 0
1095 && thirteenth.Queue.Count > 0
1096 && fourteenth.Queue.Count > 0
1097 )
1098 {
1099 var n1 = first.Queue.Peek();
1100 var n2 = second.Queue.Peek();
1101 var n3 = third.Queue.Peek();
1102 var n4 = fourth.Queue.Peek();
1103 var n5 = fifth.Queue.Peek();
1104 var n6 = sixth.Queue.Peek();
1105 var n7 = seventh.Queue.Peek();
1106 var n8 = eighth.Queue.Peek();
1107 var n9 = ninth.Queue.Peek();
1108 var n10 = tenth.Queue.Peek();
1109 var n11 = eleventh.Queue.Peek();
1110 var n12 = twelfth.Queue.Peek();
1111 var n13 = thirteenth.Queue.Peek();
1112 var n14 = fourteenth.Queue.Peek();
1113
1114 if ( n1.Kind == NotificationKind.OnCompleted
1115 || n2.Kind == NotificationKind.OnCompleted
1116 || n3.Kind == NotificationKind.OnCompleted
1117 || n4.Kind == NotificationKind.OnCompleted
1118 || n5.Kind == NotificationKind.OnCompleted
1119 || n6.Kind == NotificationKind.OnCompleted
1120 || n7.Kind == NotificationKind.OnCompleted
1121 || n8.Kind == NotificationKind.OnCompleted
1122 || n9.Kind == NotificationKind.OnCompleted
1123 || n10.Kind == NotificationKind.OnCompleted
1124 || n11.Kind == NotificationKind.OnCompleted
1125 || n12.Kind == NotificationKind.OnCompleted
1126 || n13.Kind == NotificationKind.OnCompleted
1127 || n14.Kind == NotificationKind.OnCompleted
1128 )
1129 onCompleted();
1130 else
1131 {
1132 Dequeue();
1133 onNext(n1.Value,
1134 n2.Value,
1135 n3.Value,
1136 n4.Value,
1137 n5.Value,
1138 n6.Value,
1139 n7.Value,
1140 n8.Value,
1141 n9.Value,
1142 n10.Value,
1143 n11.Value,
1144 n12.Value,
1145 n13.Value,
1146 n14.Value
1147 );
1148 }
1149 }
1150 }
1151 }
1152
1153 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : ActivePlan
1154 {
1155 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> onNext;
1156 private readonly Action onCompleted;
1157 private readonly JoinObserver<T1> first;
1158 private readonly JoinObserver<T2> second;
1159 private readonly JoinObserver<T3> third;
1160 private readonly JoinObserver<T4> fourth;
1161 private readonly JoinObserver<T5> fifth;
1162 private readonly JoinObserver<T6> sixth;
1163 private readonly JoinObserver<T7> seventh;
1164 private readonly JoinObserver<T8> eighth;
1165 private readonly JoinObserver<T9> ninth;
1166 private readonly JoinObserver<T10> tenth;
1167 private readonly JoinObserver<T11> eleventh;
1168 private readonly JoinObserver<T12> twelfth;
1169 private readonly JoinObserver<T13> thirteenth;
1170 private readonly JoinObserver<T14> fourteenth;
1171 private readonly JoinObserver<T15> fifteenth;
1172
1173 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
1174 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
1175 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
1176 JoinObserver<T12> twelfth, JoinObserver<T13> thirteenth, JoinObserver<T14> fourteenth,
1177 JoinObserver<T15> fifteenth,
1178 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> onNext, Action onCompleted)
1179 {
1180 this.onNext = onNext;
1181 this.onCompleted = onCompleted;
1182 this.first = first;
1183 this.second = second;
1184 this.third = third;
1185 this.fourth = fourth;
1186 this.fifth = fifth;
1187 this.sixth = sixth;
1188 this.seventh = seventh;
1189 this.eighth = eighth;
1190 this.ninth = ninth;
1191 this.tenth = tenth;
1192 this.eleventh = eleventh;
1193 this.twelfth = twelfth;
1194 this.thirteenth = thirteenth;
1195 this.fourteenth = fourteenth;
1196 this.fifteenth = fifteenth;
1197 AddJoinObserver(first);
1198 AddJoinObserver(second);
1199 AddJoinObserver(third);
1200 AddJoinObserver(fourth);
1201 AddJoinObserver(fifth);
1202 AddJoinObserver(sixth);
1203 AddJoinObserver(seventh);
1204 AddJoinObserver(eighth);
1205 AddJoinObserver(ninth);
1206 AddJoinObserver(tenth);
1207 AddJoinObserver(eleventh);
1208 AddJoinObserver(twelfth);
1209 AddJoinObserver(thirteenth);
1210 AddJoinObserver(fourteenth);
1211 AddJoinObserver(fifteenth);
1212 }
1213
1214 internal override void Match()
1215 {
1216 if (first.Queue.Count > 0
1217 && second.Queue.Count > 0
1218 && third.Queue.Count > 0
1219 && fourth.Queue.Count > 0
1220 && fifth.Queue.Count > 0
1221 && sixth.Queue.Count > 0
1222 && seventh.Queue.Count > 0
1223 && eighth.Queue.Count > 0
1224 && ninth.Queue.Count > 0
1225 && tenth.Queue.Count > 0
1226 && eleventh.Queue.Count > 0
1227 && twelfth.Queue.Count > 0
1228 && thirteenth.Queue.Count > 0
1229 && fourteenth.Queue.Count > 0
1230 && fifteenth.Queue.Count > 0
1231 )
1232 {
1233 var n1 = first.Queue.Peek();
1234 var n2 = second.Queue.Peek();
1235 var n3 = third.Queue.Peek();
1236 var n4 = fourth.Queue.Peek();
1237 var n5 = fifth.Queue.Peek();
1238 var n6 = sixth.Queue.Peek();
1239 var n7 = seventh.Queue.Peek();
1240 var n8 = eighth.Queue.Peek();
1241 var n9 = ninth.Queue.Peek();
1242 var n10 = tenth.Queue.Peek();
1243 var n11 = eleventh.Queue.Peek();
1244 var n12 = twelfth.Queue.Peek();
1245 var n13 = thirteenth.Queue.Peek();
1246 var n14 = fourteenth.Queue.Peek();
1247 var n15 = fifteenth.Queue.Peek();
1248
1249 if ( n1.Kind == NotificationKind.OnCompleted
1250 || n2.Kind == NotificationKind.OnCompleted
1251 || n3.Kind == NotificationKind.OnCompleted
1252 || n4.Kind == NotificationKind.OnCompleted
1253 || n5.Kind == NotificationKind.OnCompleted
1254 || n6.Kind == NotificationKind.OnCompleted
1255 || n7.Kind == NotificationKind.OnCompleted
1256 || n8.Kind == NotificationKind.OnCompleted
1257 || n9.Kind == NotificationKind.OnCompleted
1258 || n10.Kind == NotificationKind.OnCompleted
1259 || n11.Kind == NotificationKind.OnCompleted
1260 || n12.Kind == NotificationKind.OnCompleted
1261 || n13.Kind == NotificationKind.OnCompleted
1262 || n14.Kind == NotificationKind.OnCompleted
1263 || n15.Kind == NotificationKind.OnCompleted
1264 )
1265 onCompleted();
1266 else
1267 {
1268 Dequeue();
1269 onNext(n1.Value,
1270 n2.Value,
1271 n3.Value,
1272 n4.Value,
1273 n5.Value,
1274 n6.Value,
1275 n7.Value,
1276 n8.Value,
1277 n9.Value,
1278 n10.Value,
1279 n11.Value,
1280 n12.Value,
1281 n13.Value,
1282 n14.Value,
1283 n15.Value
1284 );
1285 }
1286 }
1287 }
1288 }
1289
1290
1291 internal class ActivePlan<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : ActivePlan
1292 {
1293 private readonly Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> onNext;
1294 private readonly Action onCompleted;
1295 private readonly JoinObserver<T1> first;
1296 private readonly JoinObserver<T2> second;
1297 private readonly JoinObserver<T3> third;
1298 private readonly JoinObserver<T4> fourth;
1299 private readonly JoinObserver<T5> fifth;
1300 private readonly JoinObserver<T6> sixth;
1301 private readonly JoinObserver<T7> seventh;
1302 private readonly JoinObserver<T8> eighth;
1303 private readonly JoinObserver<T9> ninth;
1304 private readonly JoinObserver<T10> tenth;
1305 private readonly JoinObserver<T11> eleventh;
1306 private readonly JoinObserver<T12> twelfth;
1307 private readonly JoinObserver<T13> thirteenth;
1308 private readonly JoinObserver<T14> fourteenth;
1309 private readonly JoinObserver<T15> fifteenth;
1310 private readonly JoinObserver<T16> sixteenth;
1311
1312 internal ActivePlan(JoinObserver<T1> first, JoinObserver<T2> second, JoinObserver<T3> third,
1313 JoinObserver<T4> fourth, JoinObserver<T5> fifth, JoinObserver<T6> sixth, JoinObserver<T7> seventh,
1314 JoinObserver<T8> eighth, JoinObserver<T9> ninth, JoinObserver<T10> tenth, JoinObserver<T11> eleventh,
1315 JoinObserver<T12> twelfth, JoinObserver<T13> thirteenth, JoinObserver<T14> fourteenth,
1316 JoinObserver<T15> fifteenth, JoinObserver<T16> sixteenth,
1317 Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> onNext, Action onCompleted)
1318 {
1319 this.onNext = onNext;
1320 this.onCompleted = onCompleted;
1321 this.first = first;
1322 this.second = second;
1323 this.third = third;
1324 this.fourth = fourth;
1325 this.fifth = fifth;
1326 this.sixth = sixth;
1327 this.seventh = seventh;
1328 this.eighth = eighth;
1329 this.ninth = ninth;
1330 this.tenth = tenth;
1331 this.eleventh = eleventh;
1332 this.twelfth = twelfth;
1333 this.thirteenth = thirteenth;
1334 this.fourteenth = fourteenth;
1335 this.fifteenth = fifteenth;
1336 this.sixteenth = sixteenth;
1337 AddJoinObserver(first);
1338 AddJoinObserver(second);
1339 AddJoinObserver(third);
1340 AddJoinObserver(fourth);
1341 AddJoinObserver(fifth);
1342 AddJoinObserver(sixth);
1343 AddJoinObserver(seventh);
1344 AddJoinObserver(eighth);
1345 AddJoinObserver(ninth);
1346 AddJoinObserver(tenth);
1347 AddJoinObserver(eleventh);
1348 AddJoinObserver(twelfth);
1349 AddJoinObserver(thirteenth);
1350 AddJoinObserver(fourteenth);
1351 AddJoinObserver(fifteenth);
1352 AddJoinObserver(sixteenth);
1353 }
1354
1355 internal override void Match()
1356 {
1357 if (first.Queue.Count > 0
1358 && second.Queue.Count > 0
1359 && third.Queue.Count > 0
1360 && fourth.Queue.Count > 0
1361 && fifth.Queue.Count > 0
1362 && sixth.Queue.Count > 0
1363 && seventh.Queue.Count > 0
1364 && eighth.Queue.Count > 0
1365 && ninth.Queue.Count > 0
1366 && tenth.Queue.Count > 0
1367 && eleventh.Queue.Count > 0
1368 && twelfth.Queue.Count > 0
1369 && thirteenth.Queue.Count > 0
1370 && fourteenth.Queue.Count > 0
1371 && fifteenth.Queue.Count > 0
1372 && sixteenth.Queue.Count > 0
1373 )
1374 {
1375 var n1 = first.Queue.Peek();
1376 var n2 = second.Queue.Peek();
1377 var n3 = third.Queue.Peek();
1378 var n4 = fourth.Queue.Peek();
1379 var n5 = fifth.Queue.Peek();
1380 var n6 = sixth.Queue.Peek();
1381 var n7 = seventh.Queue.Peek();
1382 var n8 = eighth.Queue.Peek();
1383 var n9 = ninth.Queue.Peek();
1384 var n10 = tenth.Queue.Peek();
1385 var n11 = eleventh.Queue.Peek();
1386 var n12 = twelfth.Queue.Peek();
1387 var n13 = thirteenth.Queue.Peek();
1388 var n14 = fourteenth.Queue.Peek();
1389 var n15 = fifteenth.Queue.Peek();
1390 var n16 = sixteenth.Queue.Peek();
1391
1392 if ( n1.Kind == NotificationKind.OnCompleted
1393 || n2.Kind == NotificationKind.OnCompleted
1394 || n3.Kind == NotificationKind.OnCompleted
1395 || n4.Kind == NotificationKind.OnCompleted
1396 || n5.Kind == NotificationKind.OnCompleted
1397 || n6.Kind == NotificationKind.OnCompleted
1398 || n7.Kind == NotificationKind.OnCompleted
1399 || n8.Kind == NotificationKind.OnCompleted
1400 || n9.Kind == NotificationKind.OnCompleted
1401 || n10.Kind == NotificationKind.OnCompleted
1402 || n11.Kind == NotificationKind.OnCompleted
1403 || n12.Kind == NotificationKind.OnCompleted
1404 || n13.Kind == NotificationKind.OnCompleted
1405 || n14.Kind == NotificationKind.OnCompleted
1406 || n15.Kind == NotificationKind.OnCompleted
1407 || n16.Kind == NotificationKind.OnCompleted
1408 )
1409 onCompleted();
1410 else
1411 {
1412 Dequeue();
1413 onNext(n1.Value,
1414 n2.Value,
1415 n3.Value,
1416 n4.Value,
1417 n5.Value,
1418 n6.Value,
1419 n7.Value,
1420 n8.Value,
1421 n9.Value,
1422 n10.Value,
1423 n11.Value,
1424 n12.Value,
1425 n13.Value,
1426 n14.Value,
1427 n15.Value,
1428 n16.Value
1429 );
1430 }
1431 }
1432 }
1433 }
1434 #endif
1435 }