Class Pipeline<TIn, TOut>
Defines a multi-threaded pipeline that runs in-process.
Implements
Inherited Members
Namespace: DNVGL.One.Compute.WorkExecution.ExecutionModel
Assembly: DNVGL.One.Compute.WorkExecution.dll
Syntax
public class Pipeline<TIn, TOut> : ExecutableWorkBase<TIn, TOut>, IFlowModelItem, IExecutableWork<TIn, TOut>, IComputationalWork, IPipeline, ICanBuildComputationalWork
Type Parameters
Name | Description |
---|---|
TIn | The type of the input. |
TOut | The type of the output. |
Constructors
View SourcePipeline(IPipelineSource<TIn>, SequentialWork, IPipelineSink<TOut>)
Initializes a new instance of the Pipeline<TIn, TOut> class.
Declaration
public Pipeline(IPipelineSource<TIn> source, SequentialWork work, IPipelineSink<TOut> sink)
Parameters
Type | Name | Description |
---|---|---|
IPipelineSource<TIn> | source | The source. |
SequentialWork | work | The sequential work of processing each item provided by the source. |
IPipelineSink<TOut> | sink | The sink that receives the output of the pipeline. |
Properties
View SourceNumberOfChannels
Gets or sets the number of parallel processing channels.
Declaration
public int NumberOfChannels { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of processing channels. |
PipelineSource
Gets the pipeline source.
Declaration
public IPipelineSource<TIn> PipelineSource { get; }
Property Value
Type | Description |
---|---|
IPipelineSource<TIn> | The pipeline source. |
Sink
Gets the pipeline sink.
Declaration
public IPipelineSink<TOut> Sink { get; }
Property Value
Type | Description |
---|---|
IPipelineSink<TOut> | The pipeline sink. |
Work
Gets the work performed by the processing pipeline.
Declaration
public SequentialWork Work { get; }
Property Value
Type | Description |
---|---|
SequentialWork | The work performed by the processing pipeline. |
Methods
View SourceBuild(IExecutableWorkBuilder)
Builds computational work using the given IExecutableWorkBuilder.
Declaration
public IComputationalWork Build(IExecutableWorkBuilder workBuilder)
Parameters
Type | Name | Description |
---|---|---|
IExecutableWorkBuilder | workBuilder | The work builder. |
Returns
Type | Description |
---|---|
IComputationalWork | An IComputationalWork representation of the WorkItem. |
GetDescendants()
Gets the descendants.
Declaration
public override IEnumerable<WorkItem> GetDescendants()
Returns
Type | Description |
---|---|
IEnumerable<WorkItem> | Descendant items. |
Overrides
View SourceProcess(TIn, IExecutionContext)
Processes the specified input.
Declaration
protected override TOut Process(TIn input, IExecutionContext executionContext)
Parameters
Type | Name | Description |
---|---|---|
TIn | input | The input. |
IExecutionContext | executionContext | The execution context. |
Returns
Type | Description |
---|---|
TOut | Processing result. May be null. |
Overrides
Explicit Interface Implementations
View SourceIPipeline.Push(Object)
Pushes the specified input to be processed by the pipeline.
Declaration
void IPipeline.Push(object input)
Parameters
Type | Name | Description |
---|---|---|
System.Object | input | The input. |