Table of Contents

Class GeneralTransformationRule

Namespace
NMF.Transformations.Core
Assembly
NMF.Transformations.Core.dll

This class represents the base class for a transformation rule

public abstract class GeneralTransformationRule
Inheritance
GeneralTransformationRule
Derived
Inherited Members

Constructors

GeneralTransformationRule()

Creates a new transformation rule

protected GeneralTransformationRule()

Properties

BaseRule

Gets the base rule, i.e. the rule the current rule can instantiate

public GeneralTransformationRule BaseRule { get; }

Property Value

GeneralTransformationRule

Dependencies

Gets a collection of dependencies for this transformation rule

public IList<ITransformationRuleDependency> Dependencies { get; }

Property Value

IList<ITransformationRuleDependency>

InputType

Gets the type signature of the input arguments of this transformation rule

public abstract Type[] InputType { get; }

Property Value

Type[]

IsUnique

Gets or sets a value indicating whether this transformation rule is unique per input and context

public bool IsUnique { get; set; }

Property Value

bool

NeedDependenciesForOutputCreation

Gets a value indicating whether the output for all dependencies must have been created before this rule creates the output

public virtual bool NeedDependenciesForOutputCreation { get; }

Property Value

bool

OutputDelayLevel

Gets or sets the output delay level

public byte OutputDelayLevel { get; protected set; }

Property Value

byte

Remarks

The default delay level is 0. The delay level has an influence on the availability of the trace data during output creation.

OutputType

Gets the type signature of the output type of this transformation

public abstract Type OutputType { get; }

Property Value

Type

Transformation

Gets the transformation, that this rule is assigned to

public Transformation Transformation { get; }

Property Value

Transformation

TransformationDelayLevel

Gets or sets the transformation delay level

public byte TransformationDelayLevel { get; protected set; }

Property Value

byte

Remarks

The default transformation delay level is 0. The delay has an influence when computations are made

Methods

Call(GeneralTransformationRule)

Requires the given transformation rule

public void Call(GeneralTransformationRule rule)

Parameters

rule GeneralTransformationRule

The transformation rule that should be required

Remarks

This version Always takes the input parameter as input for the dependent transformations. Thus, this method will throw an exception, if the types do not match

CreateComputation(object[], IComputationContext)

Creates a new Computation instance for this transformation rule or the given input

public abstract Computation CreateComputation(object[] input, IComputationContext context)

Parameters

input object[]

The input arguments for this computation

context IComputationContext

The context for this computation

Returns

Computation

A computation object

HasCompliantInput(Computation)

Gets a value indicating whether the given computation has a compliant input to be instantiated by the current transformation rule

public bool HasCompliantInput(Computation computation)

Parameters

computation Computation

The computation that is a candidate for instantiation

Returns

bool

True, if the input arguments match the input types of the current transformation rule, otherwise false

IsInstantiating(Computation)

Determines whether the current transformation rule can instantiate the output of the given computation

public bool IsInstantiating(Computation computation)

Parameters

computation Computation

The computation that may be instantiated by the current rule

Returns

bool

True, if the computation instantiates the given computation, otherwise false

MarkInstantiatingFor(GeneralTransformationRule)

Marks the current transformation rule instantiating for the specified rule

public void MarkInstantiatingFor(GeneralTransformationRule rule)

Parameters

rule GeneralTransformationRule

The base transformation rule

MarkInstantiatingFor(GeneralTransformationRule, Predicate<Computation>)

Marks the current transformation rule instantiating for the specified rule

public void MarkInstantiatingFor(GeneralTransformationRule rule, Predicate<Computation> filter)

Parameters

rule GeneralTransformationRule

The base transformation rule

filter Predicate<Computation>

A method that filters the possible computations

Remarks

Note that in this version, the filter method is also responsible for checking the types!

RegisterDependencies()

Registers all the dependencies (both calling and non-calling) and additional configuration

public virtual void RegisterDependencies()

Remarks

This method is called during initialization of the entire transformation and is independent of any transformation contexts. However, this method may rely on the Transformation-property.

Require(GeneralTransformationRule)

Requires the given transformation rule

public void Require(GeneralTransformationRule rule)

Parameters

rule GeneralTransformationRule

The transformation rule that should be required

Remarks

This version Always takes the input parameter as input for the dependent transformations. Thus, this method will throw an exception, if the types do not match