public CallFlowNode AddCallNode( IRoutineLocation location, IEnumerable <Expression> arguments = null, IEnumerable <FlowVariable> returnAssignments = null, CallKind kind = CallKind.Static, FlowNodeFlags flags = FlowNodeFlags.None) { Contract.Requires <InvalidOperationException>(this.Graph != null); Contract.Requires <ArgumentNullException>(location != null, nameof(location)); Contract.Requires <ArgumentException>(kind != CallKind.ObjectCreation || location.IsConstructor, nameof(kind)); var nodeId = this.nodeIdProvider.GenerateNewId(); var node = new CallFlowNode( this.Graph, nodeId, flags, location, arguments ?? Enumerable.Empty <Expression>(), returnAssignments ?? Enumerable.Empty <FlowVariable>(), kind); this.Graph.MutableNodes.Add(node); Contract.Assert(nodeId.Value == this.Graph.MutableNodes.IndexOf(node)); return(node); }
internal EnterFlowNode(FlowGraph graph, FlowNodeId id, FlowNodeFlags flags, IEnumerable <FlowVariable> parameters) : base(graph, id, flags) { Contract.Requires(parameters != null); this.Parameters = parameters.ToImmutableArray(); }
internal InnerFlowNode(FlowGraph graph, FlowNodeId id, FlowNodeFlags flags, IEnumerable <Operation> operations) : base(graph, id, flags) { Contract.Requires(operations != null); this.Operations = operations.ToImmutableArray(); }
internal ReturnFlowNode(FlowGraph graph, FlowNodeId id, FlowNodeFlags flags, IEnumerable <Expression> returnValues) : base(graph, id, flags) { Contract.Requires(returnValues != null); this.ReturnValues = returnValues.ToImmutableArray(); }
public NodeConfig(FlowNodeFilter cat, string desc, FlowNodeFlags nodeFlags, FlowNodeType nodeType, InputPortConfig[] inputPorts, OutputPortConfig[] outputPorts) : this() { flags = nodeFlags; filter = cat; description = desc; type = nodeType; inputs = inputPorts.Cast<object>().ToArray(); outputs = outputPorts.Cast<object>().ToArray(); }
public NodeConfig(FlowNodeFilter cat, string desc, FlowNodeFlags nodeFlags, FlowNodeType nodeType, InputPortConfig[] inputPorts, OutputPortConfig[] outputPorts) : this() { flags = nodeFlags; filter = cat; description = desc; type = nodeType; inputs = inputPorts.Cast <object>().ToArray(); outputs = outputPorts.Cast <object>().ToArray(); }
internal FlowNode(FlowGraph graph, FlowNodeId id, FlowNodeFlags flags) { Contract.Requires(graph != null); Contract.Requires(id.IsValid); this.Graph = graph; this.Id = id; this.Flags = flags; this.IngoingEdges = this.MutableIngoingEdges; this.OutgoingEdges = this.MutableOutgoingEdges; }
// TODO: Add even more overloads (for example, consider directly using immutable array) and optimize their calls public InnerFlowNode AddInnerNode(IEnumerable <Operation> operations = null, FlowNodeFlags flags = FlowNodeFlags.None) { Contract.Requires <InvalidOperationException>(this.Graph != null); var nodeId = this.nodeIdProvider.GenerateNewId(); var node = new InnerFlowNode(this.Graph, nodeId, flags, operations ?? Enumerable.Empty <Operation>()); this.Graph.MutableNodes.Add(node); Contract.Assert(nodeId.Value == this.Graph.MutableNodes.IndexOf(node)); return(node); }
internal ThrowExceptionFlowNode( FlowGraph graph, FlowNodeId id, FlowNodeFlags flags, IRoutineLocation constructorLocation, IEnumerable <Expression> arguments) : base(graph, id, flags) { Contract.Requires(constructorLocation != null); Contract.Requires(arguments != null); this.ConstructorLocation = constructorLocation; this.Arguments = arguments.ToImmutableArray(); }
public ThrowExceptionFlowNode AddThrowExceptionNode( IRoutineLocation constructorLocation, IEnumerable <Expression> arguments = null, FlowNodeFlags flags = FlowNodeFlags.None) { Contract.Requires <InvalidOperationException>(this.Graph != null); Contract.Requires <ArgumentNullException>(constructorLocation != null, nameof(constructorLocation)); var nodeId = this.nodeIdProvider.GenerateNewId(); var node = new ThrowExceptionFlowNode( this.Graph, nodeId, flags, constructorLocation, arguments ?? Enumerable.Empty <Expression>()); this.Graph.MutableNodes.Add(node); Contract.Assert(nodeId.Value == this.Graph.MutableNodes.IndexOf(node)); return(node); }
internal CallFlowNode( FlowGraph graph, FlowNodeId id, FlowNodeFlags flags, IRoutineLocation location, IEnumerable <Expression> arguments, IEnumerable <FlowVariable> returnAssignments, CallKind kind) : base(graph, id, flags) { Contract.Requires(location != null); Contract.Requires(arguments != null); Contract.Requires(returnAssignments != null); Contract.Requires( kind != CallKind.ObjectCreation || VerifyConstructorUsage(location, returnAssignments), nameof(kind)); this.Location = location; this.Arguments = arguments.ToImmutableArray(); this.ReturnAssignments = returnAssignments.ToImmutableArray(); this.Kind = kind; }
public NodeConfig(FlowNodeCategory cat, string desc, FlowNodeFlags nodeFlags = 0) : this() { flags = nodeFlags; category = cat; description = desc; }