Class Transformation
This is the base class for transformations
Inherited Members
Namespace: NMF.Transformations.Core
Assembly: NMF.Transformations.Core.dll
Syntax
public abstract class Transformation
Properties
| Edit this page View SourceIsInitialized
Gets a value indicating whether the transformation has been initialized yet
Declaration
public bool IsInitialized { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
IsRulesRegistered
Gets a value indicating whether the transformation has registered its rules requirements
Declaration
public bool IsRulesRegistered { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
MaxOutputDelay
Gets the maximum output delay level
Declaration
public virtual byte MaxOutputDelay { get; }
Property Value
Type | Description |
---|---|
byte |
MaxTransformationDelay
Gets the maximum transformation delay level
Declaration
public virtual byte MaxTransformationDelay { get; }
Property Value
Type | Description |
---|---|
byte |
Patterns
Gets a collection of pattern objects used within the transformation
Declaration
public ICollection<ITransformationPattern> Patterns { get; }
Property Value
Type | Description |
---|---|
ICollection<ITransformationPattern> |
Rules
Gets a collection of all rules of this transformation
Declaration
public IList<GeneralTransformationRule> Rules { get; }
Property Value
Type | Description |
---|---|
IList<GeneralTransformationRule> |
Methods
| Edit this page View SourceComputeInstantiatingTransformationRulePath(Computation)
Computes the path of transformation rules for a given input
Declaration
public virtual Stack<GeneralTransformationRule> ComputeInstantiatingTransformationRulePath(Computation computation)
Parameters
Type | Name | Description |
---|---|---|
Computation | computation | The computation for which to compute the instantiating rule path |
Returns
Type | Description |
---|---|
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
Declaration
public virtual ITransformationContext CreateContext()
Returns
Type | Description |
---|---|
ITransformationContext |
CreateRules()
Creates the transformation rules for this transformation
Declaration
protected abstract IEnumerable<GeneralTransformationRule> CreateRules()
Returns
Type | Description |
---|---|
IEnumerable<GeneralTransformationRule> | A collection of transformation rules |
CreateRulesInternal()
Creates the rules of this transformation
Declaration
protected void CreateRulesInternal()
GetRuleForRuleType(Type)
Gets the rule with the specified type (exact match)
Declaration
public virtual GeneralTransformationRule GetRuleForRuleType(Type transformationRule)
Parameters
Type | Name | Description |
---|---|---|
Type | transformationRule | The type of the transformation rule |
Returns
Type | Description |
---|---|
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
Declaration
public virtual GeneralTransformationRule GetRuleForTypeSignature(Type[] inputTypes, Type outputType)
Parameters
Type | Name | Description |
---|---|---|
Type[] | inputTypes | The input argument type list |
Type | outputType | The output type |
Returns
Type | Description |
---|---|
GeneralTransformationRule | A random rule that has the given signature |
GetRulesExact(Type[], Type)
Gets all rules that apply the given signature exactly
Declaration
public virtual IEnumerable<GeneralTransformationRule> GetRulesExact(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 |
GetRulesForInputTypes(params Type[])
Gets the applicable rules for the given input type signature
Declaration
public virtual IEnumerable<GeneralTransformationRule> GetRulesForInputTypes(params Type[] input)
Parameters
Type | Name | Description |
---|---|---|
Type[] | input | The signature of the input types |
Returns
Type | Description |
---|---|
IEnumerable<GeneralTransformationRule> | A collection of rules that are applicable for this signature |
GetRulesForRuleType(Type)
Gets all rules with the specified type (exact match)
Declaration
public virtual IEnumerable<GeneralTransformationRule> GetRulesForRuleType(Type transformationRule)
Parameters
Type | Name | Description |
---|---|---|
Type | transformationRule | The type of the transformation rules |
Returns
Type | Description |
---|---|
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
Declaration
public virtual IEnumerable<GeneralTransformationRule> GetRulesForTypeSignature(Type[] inputTypes, Type outputType)
Parameters
Type | Name | Description |
---|---|---|
Type[] | inputTypes | The input argument type list |
Type | outputType | The output type |
Returns
Type | Description |
---|---|
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
Declaration
public IEnumerable<GeneralTransformationRule> GetRulesForTypeSignature(Type[] input, Type output, bool exact)
Parameters
Type | Name | Description |
---|---|---|
Type[] | input | The input argument type list |
Type | output | The output type |
bool | exact | A value indicating whether the signatures must match exactly |
Returns
Type | Description |
---|---|
IEnumerable<GeneralTransformationRule> | A collection with all the rules that have the given signature |
Initialize()
Initializes the transformation
Declaration
public virtual void Initialize()
RegisterRules()
Registers the rules of this transformation
Declaration
public virtual void RegisterRules()