public Node(RegisterStep registerStep) { rego = registerStep; Befores = registerStep.Befores; Afters = registerStep.Afters; StepId = registerStep.StepId; OutputContext = registerStep.GetOutputContext(); }
public void SetUp() { pipelineModificationsBeforeOptimizations = new PipelineModifications(); for (int i = 0; i < PipelineDepth; i++) { pipelineModificationsBeforeOptimizations.Additions.Add(RegisterStep.Create(i.ToString(), typeof(Behavior1BeforeOptimization), i.ToString(), b => new Behavior1BeforeOptimization())); } pipelineModificationsAfterOptimizationsWithUnsafe = new PipelineModifications(); for (int i = 0; i < PipelineDepth; i++) { pipelineModificationsAfterOptimizationsWithUnsafe.Additions.Add(RegisterStep.Create(i.ToString(), typeof(Behavior1AfterOptimization), i.ToString(), b => new Behavior1AfterOptimization())); } }
public void SetUp() { behaviorContext = new BehaviorContext(); pipelineModificationsBeforeOptimizations = new PipelineModifications(); for (int i = 0; i < PipelineDepth; i++) { pipelineModificationsBeforeOptimizations.Additions.Add(RegisterStep.Create(i.ToString(), typeof(Behavior1BeforeOptimization), i.ToString(), b => new Behavior1BeforeOptimization())); } var stepdId = PipelineDepth + 1; pipelineModificationsBeforeOptimizations.Additions.Add(RegisterStep.Create(stepdId.ToString(), typeof(Throwing), "1", b => new Throwing())); pipelineModificationsAfterOptimizationsWithUnsafe = new PipelineModifications(); for (int i = 0; i < PipelineDepth; i++) { pipelineModificationsAfterOptimizationsWithUnsafe.Additions.Add(RegisterStep.Create(i.ToString(), typeof(Behavior1AfterOptimization), i.ToString(), b => new Behavior1AfterOptimization())); } pipelineModificationsAfterOptimizationsWithUnsafe.Additions.Add(RegisterStep.Create(stepdId.ToString(), typeof(Throwing), "1", b => new Throwing())); pipelineBeforeOptimizations = new PipelineAfterOptimizations <IBehaviorContext>(null, new SettingsHolder(), pipelineModificationsBeforeOptimizations); pipelineAfterOptimizationsWithUnsafe = new PipelineAfterOptimizationsUnsafeAndMemoryMarshal <IBehaviorContext>(null, new SettingsHolder(), pipelineModificationsAfterOptimizationsWithUnsafe); // warmup and cache try { pipelineBeforeOptimizations.Invoke(behaviorContext).GetAwaiter().GetResult(); } catch (Exception) { } try { pipelineAfterOptimizationsWithUnsafe.Invoke(behaviorContext).GetAwaiter().GetResult(); } catch (Exception) { } }
public void Register(RegisterStep rego) { additions.Add(rego); }
public void Register(string pipelineStep, Type behavior, string description) { additions.Add(RegisterStep.Create(pipelineStep, behavior, description)); }
public static Type GetInputContext(this RegisterStep step) { return(step.BehaviorType.GetInputContext()); }
public static bool IsStageConnector(this RegisterStep step) { return(typeof(IStageConnector).IsAssignableFrom(step.BehaviorType)); }