Class StackContext
A transformation context whose state at a point in the transformation is given by a stack.
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
public class StackContext
Fields
InputStack
Stack holding transformation info for elements on the path down the input tree to the
input cursor (the location currently being transformed).
Declaration
public List<TransformInfo> InputStack
Field Value
Properties
Depth
The depth of the current point in the transformation
Declaration
public int Depth { get; }
Property Value
Methods
AddStatementAfter(IStatement, IStatement)
Adds a statement after the statement which is currently being processed.
Declaration
public void AddStatementAfter(IStatement ancestorStatement, IStatement statementToAdd)
Parameters
AddStatementAfterAncestorIndex(Int32, IStatement, Boolean)
Adds a statement after the ancestor statement at the specified index, optionally converting
the statement before it is added.
Declaration
public virtual void AddStatementAfterAncestorIndex(int ancestorIndex, IStatement statementToAdd, bool convertBeforeAdding = false)
Parameters
AddStatementAfterCurrent(IStatement)
Adds a statement which will be inserted after the current statement has been transformed.
Declaration
public void AddStatementAfterCurrent(IStatement statementToAdd)
Parameters
AddStatementBeforeAncestorIndex(Int32, IStatement, Boolean)
Adds a statement immediately before the output element for the ancestor index given.
Declaration
public virtual void AddStatementBeforeAncestorIndex(int ancInd, IStatement stmt, bool convertBeforeAdding = false)
Parameters
AddStatementBeforeCurrent(IStatement)
Adds a statement immediately before the statement currently being processed.
Declaration
public virtual void AddStatementBeforeCurrent(IStatement statementToAdd)
Parameters
AddStatementsAfter(IStatement, IEnumerable<IStatement>)
Adds a collection of statements after the statement which is currently being processed.
Declaration
public void AddStatementsAfter(IStatement ancestorStatement, IEnumerable<IStatement> statementsToAdd)
Parameters
AddStatementsAfterAncestorIndex(Int32, IEnumerable<IStatement>, Boolean)
Adds mulitple statements after the ancestor statement at the specified index, optionally converting
the statement before it is added.
Declaration
public void AddStatementsAfterAncestorIndex(int ancestorIndex, IEnumerable<IStatement> statementsToAdd, bool convertBeforeAdding = false)
Parameters
AddStatementsAfterCurrent(IEnumerable<IStatement>)
Declaration
public void AddStatementsAfterCurrent(IEnumerable<IStatement> statementsToAdd)
Parameters
AddStatementsBeforeAncestorIndex(Int32, IEnumerable<IStatement>, Boolean)
Adds statements immediately before the output element for the ancestor index given.
Declaration
public void AddStatementsBeforeAncestorIndex(int ancInd, IEnumerable<IStatement> stmts, bool convertBeforeAdding = false)
Parameters
AddStatementsBeforeCurrent(IEnumerable<IStatement>)
Declaration
public void AddStatementsBeforeCurrent(IEnumerable<IStatement> statementsToAdd)
Parameters
FindAncestor<T>()
Finds the closest ancestor of the specified type (or assignable to that type) in the input path.
Declaration
public T FindAncestor<T>()
where T : class
Returns
Type Parameters
FindAncestorIndex<T>()
Finds the index of the closest ancestor of the specified type (or assignable to that type) in the input path, or -1 if none.
Declaration
public int FindAncestorIndex<T>()
Returns
Type Parameters
FindAncestorNotSelf<T>()
Finds the closest ancestor of the specified type (or assignable to that type) in the input path, excluding the current item.
Declaration
public T FindAncestorNotSelf<T>()
where T : class
Returns
Type Parameters
FindAncestorNotSelfIndex<T>()
Finds the index of the closest ancestor of the specified type (or assignable to that type) in the input path.
Declaration
public int FindAncestorNotSelfIndex<T>()
Returns
Type Parameters
FindAncestors<T>()
Finds all ancestors assignable to type T, in high-to-low order.
Declaration
public List<T> FindAncestors<T>()
Returns
Type Parameters
FindAncestors<T>(Int32)
Finds all ancestors assignable to type T, in high-to-low order, up to and excluding the specified ancestor index.
Declaration
public List<T> FindAncestors<T>(int ancIndex)
Parameters
Type |
Name |
Description |
Int32 |
ancIndex |
|
Returns
Type Parameters
FindAncestorsBelow<T>(Int32)
Finds all ancestors assignable to type T, in high-to-low order, whose index is greater than the specified ancestor index.
Declaration
public List<T> FindAncestorsBelow<T>(int ancIndex)
Parameters
Type |
Name |
Description |
Int32 |
ancIndex |
|
Returns
Type Parameters
FindOutputForAncestor<TAnc, TTransformed>()
Returns the transformed output for the closest ancestor of the specified type.
Declaration
public TTransformed FindOutputForAncestor<TAnc, TTransformed>()
Returns
Type |
Description |
TTransformed |
|
Type Parameters
Name |
Description |
TAnc |
|
TTransformed |
|
FindTopAncestor<T>()
Finds the highest ancestor of the specified type (or assignable to that type) in the input path.
Declaration
public T FindTopAncestor<T>()
Returns
Type Parameters
FindTopAncestorIndex<T>()
Finds the index of the highest ancestor of the specified type (or assignable to that type) in the input path.
Declaration
public int FindTopAncestorIndex<T>()
Returns
Type Parameters
GetAncestor(Int32)
Returns the ancestor object at the specified index in the transformation stack.
Declaration
public object GetAncestor(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
GetAncestorIndex(Object)
Returns the index in the transformation stack of the specified ancestor object,
or -1 if the object is not an ancestor.
Declaration
public int GetAncestorIndex(object ancestor)
Parameters
Type |
Name |
Description |
Object |
ancestor |
|
Returns
GetOutputForAncestorIndex<TTransformed>(Int32)
Returns the transformed output for the ancestor at the specified index.
Declaration
public TTransformed GetOutputForAncestorIndex<TTransformed>(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
Type |
Description |
TTransformed |
|
Type Parameters
Name |
Description |
TTransformed |
|
SetPrimaryOutput(Object)
Sets the primary output of the last opened input object.
Declaration
public virtual void SetPrimaryOutput(object outputItem)
Parameters
Type |
Name |
Description |
Object |
outputItem |
|