コード例 #1
0
        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()));
            }

            pipelineModificationsAfterOptimizations = new PipelineModifications();
            for (int i = 0; i < PipelineDepth; i++)
            {
                pipelineModificationsAfterOptimizations.Additions.Add(RegisterStep.Create(i.ToString(),
                                                                                          typeof(Behavior1AfterOptimization), i.ToString(), b => new Behavior1AfterOptimization()));
            }

            pipelineBeforeOptimizations = new PipelineBeforeOptimization <IBehaviorContext>(null, new SettingsHolder(),
                                                                                            pipelineModificationsBeforeOptimizations);
            pipelineAfterOptimizations = new PipelineAfterOptimizations <IBehaviorContext>(null, new SettingsHolder(),
                                                                                           pipelineModificationsAfterOptimizations);
            pipelineAfterOptimizationsFastExpressionCompiler = new PipelineFastExpressionCompiler <IBehaviorContext>(null, new SettingsHolder(),
                                                                                                                     pipelineModificationsAfterOptimizations);

            // warmup and cache
            pipelineBeforeOptimizations.Invoke(behaviorContext).GetAwaiter().GetResult();
            pipelineAfterOptimizations.Invoke(behaviorContext).GetAwaiter().GetResult();
            pipelineAfterOptimizationsFastExpressionCompiler.Invoke(behaviorContext).GetAwaiter().GetResult();
        }
コード例 #2
0
        public PipelineBeforeOptimization <IBehaviorContext> V6_PipelineBeforeOptimizations()
        {
            var pipeline = new PipelineBeforeOptimization <IBehaviorContext>(null, new SettingsHolder(),
                                                                             pipelineModificationsBeforeOptimizations);

            return(pipeline);
        }