Class DataFlowNode<TInstruction>
Represents a single node in a data flow graph.
public class DataFlowNode<TInstruction> : IIdentifiedNode, INode where TInstruction : notnull
Type Parameters
TInstructionThe type of contents to store in the node.
- Inheritance
-
DataFlowNode<TInstruction>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
DataFlowNode(TInstruction?)
Creates a new data flow graph node.
public DataFlowNode(TInstruction? instruction)
Parameters
instructionTInstructionThe contents of the node.
Properties
InDegree
Gets a value indicating the number of incoming edges that this node is incident to.
public int InDegree { get; }
Property Value
Instruction
Gets the contents of the node.
public TInstruction? Instruction { get; set; }
Property Value
- TInstruction
IsExternal
Gets a value indicating whether the data flow node represents an external data source.
public virtual bool IsExternal { get; }
Property Value
Offset
Gets or sets the offset associated to the data flow node.
public long Offset { get; set; }
Property Value
OutDegree
Gets a value indicating the number of outgoing edges that this node is incident to.
public int OutDegree { get; }
Property Value
ParentGraph
Gets the data flow graph this node is a part of.
public DataFlowGraph<TInstruction>? ParentGraph { get; }
Property Value
- DataFlowGraph<TInstruction>
StackDependencies
Gets a collection of values allocated on a stack that this node depends on.
public StackDependencyCollection<TInstruction> StackDependencies { get; }
Property Value
- StackDependencyCollection<TInstruction>
VariableDependencies
Gets a collection of values that are assigned to variables that this node depends on.
public VariableDependencyCollection<TInstruction> VariableDependencies { get; }
Property Value
- VariableDependencyCollection<TInstruction>
Methods
Disconnect()
Removes all incident edges (both incoming and outgoing edges) from the node, effectively isolating the node in the graph.
public void Disconnect()
GetDependants()
Obtains a collection of nodes that depend on this node.
public IEnumerable<DataFlowNode<TInstruction>> GetDependants()
Returns
- IEnumerable<DataFlowNode<TInstruction>>
The dependant nodes.
GetIncomingEdges()
Obtains a collection of edges that refer to dependent nodes.
public IEnumerable<DataFlowEdge<TInstruction>> GetIncomingEdges()
Returns
- IEnumerable<DataFlowEdge<TInstruction>>
The edges.
GetOutgoingEdges()
Obtains a collection of edges encoding all the dependencies that this node has.
public IEnumerable<DataFlowEdge<TInstruction>> GetOutgoingEdges()
Returns
- IEnumerable<DataFlowEdge<TInstruction>>
The edges.
ToString()
public override string ToString()
Returns
UpdateOffset()
Synchronizes the node's offset with the offset of the embedded instruction.
public void UpdateOffset()