Table of Contents

Class Transformation

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

This is the base class for transformations

public abstract class Transformation
Inheritance
Transformation
Derived
Inherited Members

Properties

IsInitialized

Gets a value indicating whether the transformation has been initialized yet

public bool IsInitialized { get; protected set; }

Property Value

bool

IsRulesRegistered

Gets a value indicating whether the transformation has registered its rules requirements

public bool IsRulesRegistered { get; protected set; }

Property Value

bool

MaxOutputDelay

Gets the maximum output delay level

public virtual byte MaxOutputDelay { get; }

Property Value

byte

MaxTransformationDelay

Gets the maximum transformation delay level

public virtual byte MaxTransformationDelay { get; }

Property Value

byte

Patterns

Gets a collection of pattern objects used within the transformation

public ICollection<ITransformationPattern> Patterns { get; }

Property Value

ICollection<ITransformationPattern>

Rules

Gets a collection of all rules of this transformation

public IList<GeneralTransformationRule> Rules { get; }

Property Value

IList<GeneralTransformationRule>

Methods

ComputeInstantiatingTransformationRulePath(Computation)

Computes the path of transformation rules for a given input

public virtual Stack<GeneralTransformationRule> ComputeInstantiatingTransformationRulePath(Computation computation)

Parameters

computation Computation

The computation for which to compute the instantiating rule path

Returns

Stack<GeneralTransformationRule>

A stack of transformation rules that are involved with the output creation. The top element of the stack should be able to instantiate the output (i.e. must not be abstract)

CreateContext()

Creates a new transformation context

public virtual ITransformationContext CreateContext()

Returns

ITransformationContext

CreateRules()

Creates the transformation rules for this transformation

protected abstract IEnumerable<GeneralTransformationRule> CreateRules()

Returns

IEnumerable<GeneralTransformationRule>

A collection of transformation rules

CreateRulesInternal()

Creates the rules of this transformation

protected void CreateRulesInternal()

GetRuleForRuleType(Type)

Gets the rule with the specified type (exact match)

public virtual GeneralTransformationRule GetRuleForRuleType(Type transformationRule)

Parameters

transformationRule Type

The type of the transformation rule

Returns

GeneralTransformationRule

The transformation rule with this type or null, if there is none

Remarks

This method assumes there is only one transformation rule per type

GetRuleForTypeSignature(Type[], Type)

Gets any rules that apply the given signature

public virtual GeneralTransformationRule GetRuleForTypeSignature(Type[] inputTypes, Type outputType)

Parameters

inputTypes Type[]

The input argument type list

outputType Type

The output type

Returns

GeneralTransformationRule

A random rule that has the given signature

GetRulesExact(Type[], Type)

Gets all rules that apply the given signature exactly

public virtual IEnumerable<GeneralTransformationRule> GetRulesExact(Type[] input, Type output)

Parameters

input Type[]

The input argument type list

output Type

The output type

Returns

IEnumerable<GeneralTransformationRule>

A collection with all the rules that have the given signature

GetRulesForInputTypes(params Type[])

Gets the applicable rules for the given input type signature

public virtual IEnumerable<GeneralTransformationRule> GetRulesForInputTypes(params Type[] input)

Parameters

input Type[]

The signature of the input types

Returns

IEnumerable<GeneralTransformationRule>

A collection of rules that are applicable for this signature

GetRulesForRuleType(Type)

Gets all rules with the specified type (exact match)

public virtual IEnumerable<GeneralTransformationRule> GetRulesForRuleType(Type transformationRule)

Parameters

transformationRule Type

The type of the transformation rules

Returns

IEnumerable<GeneralTransformationRule>

A collection of all rules with this type

Remarks

This method assumes there is only one transformation rule per type

GetRulesForTypeSignature(Type[], Type)

Gets all rules that apply the given signature

public virtual IEnumerable<GeneralTransformationRule> GetRulesForTypeSignature(Type[] inputTypes, Type outputType)

Parameters

inputTypes Type[]

The input argument type list

outputType Type

The output type

Returns

IEnumerable<GeneralTransformationRule>

A collection with all the rules that have the given signature

GetRulesForTypeSignature(Type[], Type, bool)

Gets all rules that apply the given signature

public IEnumerable<GeneralTransformationRule> GetRulesForTypeSignature(Type[] input, Type output, bool exact)

Parameters

input Type[]

The input argument type list

output Type

The output type

exact bool

A value indicating whether the signatures must match exactly

Returns

IEnumerable<GeneralTransformationRule>

A collection with all the rules that have the given signature

Initialize()

Initializes the transformation

public virtual void Initialize()

RegisterRules()

Registers the rules of this transformation

public virtual void RegisterRules()