| | | 1 | | using System.Threading.Tasks.Dataflow; |
| | | 2 | | |
| | | 3 | | namespace CounterpointCollective.Dataflow.Encapsulation |
| | | 4 | | { |
| | | 5 | | /// <exclude /> |
| | | 6 | | public static class EncapsulationExtensions |
| | | 7 | | { |
| | | 8 | | public static IReceivableSourceBlock<T> EncapsulateAsSourceBlock<T>(this IDataflowBlock b1, ISourceBlock<T> b2) |
| | 1 | 9 | | => new EncapsulatedSourceBlock<T>(b1, b2); |
| | | 10 | | |
| | | 11 | | public static IPropagatorBlock<TInput, TOutput> Encapsulate<TInput, TOutput>( |
| | | 12 | | this ITargetBlock<TInput> b1, |
| | | 13 | | ISourceBlock<TOutput> b2 |
| | | 14 | | ) |
| | 0 | 15 | | => DataflowBlock.Encapsulate(b1, b2); |
| | | 16 | | |
| | | 17 | | public static ITargetBlock<T> EncapsulateAsTargetBlock<T>(this ITargetBlock<T> targetSide, IDataflowBlock b2) |
| | 1 | 18 | | => new EncapsulatedTargetBlock<T>(targetSide, b2); |
| | | 19 | | |
| | | 20 | | public static IDataflowBlock EncapsulateAsDataflowBlock(this IDataflowBlock b1, IDataflowBlock b2) |
| | 0 | 21 | | => new EncapsulatedDataflowBlock(b1, b2); |
| | | 22 | | } |
| | | 23 | | } |