Class TaskParallelTransformationContext
Denotes a parallel transformation context using the TPL
Inherited Members
Namespace: NMF.Transformations.Parallel.Tasks
Assembly: NMF.Transformations.Parallel.dll
Syntax
public class TaskParallelTransformationContext : ITransformationEngineContext, ITransformationContext
Constructors
| Edit this page View SourceTaskParallelTransformationContext(Transformation)
Creates a new transformation context for the given transformation
Declaration
public TaskParallelTransformationContext(Transformation transformation)
Parameters
Type | Name | Description |
---|---|---|
Transformation | transformation | The transformation, a context should be generated for |
Properties
| Edit this page View SourceBag
Gets a Bag, where dynamic data can be added
Declaration
public dynamic Bag { get; }
Property Value
Type | Description |
---|---|
dynamic |
Remarks
The value of this property is an ExpandoObject, so that the bag can be easily extended with new properties
Computations
Gets all computations (for custom trace purposes)
Declaration
public IEnumerable<Computation> Computations { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Computation> |
Data
Gets a data dictionary, where data set during the transformation can be added
Declaration
public IDictionary<object, object> Data { get; }
Property Value
Type | Description |
---|---|
IDictionary<object, object> |
Input
Gets the input of the transformation context
Declaration
public object[] Input { get; set; }
Property Value
Type | Description |
---|---|
object[] |
Remarks
If the transformation has multiple inputs, this returns the first input
Inputs
Gets a collection of inputs
Declaration
public IList<object[]> Inputs { get; }
Property Value
Type | Description |
---|---|
IList<object[]> |
Output
Gets the output of the transformation context
Declaration
public object Output { get; }
Property Value
Type | Description |
---|---|
object |
Remarks
If the transformation has multiple outputs, this property returns the first output
Outputs
Gets a collection of outputs
Declaration
public IList<object> Outputs { get; }
Property Value
Type | Description |
---|---|
IList<object> |
Trace
Gets the object responsible for trace operations for this transformation context
Declaration
public ITransformationTrace Trace { get; }
Property Value
Type | Description |
---|---|
ITransformationTrace |
Transformation
Gets the parent transformation, that the context is based upon
Declaration
public Transformation Transformation { get; }
Property Value
Type | Description |
---|---|
Transformation |
Methods
| Edit this page View SourceAddTraceEntry(Computation)
Creates a trace entry for the given computation object
Declaration
protected virtual void AddTraceEntry(Computation computation)
Parameters
Type | Name | Description |
---|---|---|
Computation | computation | The computation that needs to be added to the trace |
Remarks
Override for custom trace entries. A null-check for the argument is not required.
CallTransformation(GeneralTransformationRule, object[], IEnumerable)
Calls the given transformation with the specified input
Declaration
public Computation CallTransformation(GeneralTransformationRule transformationRule, object[] input, IEnumerable context)
Parameters
Type | Name | Description |
---|---|---|
GeneralTransformationRule | transformationRule | The rule that should be applied |
object[] | input | The input for the transformation rule |
IEnumerable | context | The callers context |
Returns
Type | Description |
---|---|
Computation | The computation that handles this request |
ExecutePending()
Calls the transformation context to finish any things yet undone
Declaration
public void ExecutePending()
ExecutePendingComputations()
Executes all computations registered,but not already handled
Declaration
public void ExecutePendingComputations()
GetRule(Type[], Type)
Gets any rules that apply the given signature
Declaration
public GeneralTransformationRule GetRule(Type[] input, Type output)
Parameters
Type | Name | Description |
---|---|---|
Type[] | input | The input argument type list |
Type | output | The output type |
Returns
Type | Description |
---|---|
GeneralTransformationRule | A random rule that has the given signature |
GetRules(Type[], Type)
Gets all rules that apply the given signature
Declaration
public IEnumerable<GeneralTransformationRule> GetRules(Type[] input, Type output)
Parameters
Type | Name | Description |
---|---|---|
Type[] | input | The input argument type list |
Type | output | The output type |
Returns
Type | Description |
---|---|
IEnumerable<GeneralTransformationRule> | A collection with all the rules that have the given signature |
OnComputationCompleted(ComputationEventArgs)
Fires the ComputationCompleted event with the given event data
Declaration
protected virtual void OnComputationCompleted(ComputationEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ComputationEventArgs | e | The event data |
Events
| Edit this page View SourceComputationCompleted
Gets fired when a computation completes
Declaration
public event EventHandler<ComputationEventArgs> ComputationCompleted
Event Type
Type | Description |
---|---|
EventHandler<ComputationEventArgs> |