Show / Hide Table of Contents

Class ExpressionRewriterLeafCollection<TTarget>

Represents a collection of leaf rules.

Inheritance
System.Object
ExpressionRewriterLeafCollection<TTarget>
Implements
System.Collections.Generic.IEnumerable<Leaf<ExpressionTreeBase, TTarget>>
System.Collections.IEnumerable
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class ExpressionRewriterLeafCollection<TTarget> : Object, IEnumerable<Leaf<ExpressionTreeBase, TTarget>>, IEnumerable where TTarget : ITree
Type Parameters
Name Description
TTarget

Type of the target tree nodes.

Methods

Add<TLeaf>(Expression<Func<TLeaf, TTarget>>, Int32)

Adds a new leaf rule.

Declaration
public void Add<TLeaf>(Expression<Func<TLeaf, TTarget>> convert, int cost)
    where TLeaf : Expression
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TLeaf, TTarget>> convert

Lambda expression representing the conversion from the source tree leaf node to the target tree node.

System.Int32 cost

Cost to apply the rule.

Type Parameters
Name Description
TLeaf

Type of the source tree leaf node. This type should be a subtype of Expression.

Add<TLeaf>(Expression<Func<TLeaf, TTarget>>, Expression<Func<TLeaf, Boolean>>, Int32)

Adds a new leaf rule.

Declaration
public void Add<TLeaf>(Expression<Func<TLeaf, TTarget>> convert, Expression<Func<TLeaf, bool>> predicate, int cost)
    where TLeaf : Expression
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TLeaf, TTarget>> convert

Lambda expression representing the conversion from the source tree leaf node to the target tree node.

System.Linq.Expressions.Expression<System.Func<TLeaf, System.Boolean>> predicate

Lambda expression representing the predicate to apply to evaluate applicability of the rule to a source tree leaf node.

System.Int32 cost

Cost to apply the rule.

Type Parameters
Name Description
TLeaf

Type of the source tree leaf node. This type should be a subtype of Expression.

GetEnumerator()

Gets an enumerator to iterate over the leaf rules in the collection.

Declaration
public IEnumerator<Leaf<ExpressionTreeBase, TTarget>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<Leaf<ExpressionTreeBase, TTarget>>

Enumerator to iterate over the leaf rules in the collection.

Implements

System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable
In This Article
Back to top Generated by DocFX