Example #1
0
 public ExecutionOptions(IViewCycleExecutionSequence executionSequence, ViewExecutionFlags flags, int?maxSuccessiveDeltaCycles = null, ViewCycleExecutionOptions defaultExecutionOptions = null, VersionCorrection versionCorrection = null)
 {
     _executionSequence        = executionSequence;
     _flags                    = flags;
     _maxSuccessiveDeltaCycles = maxSuccessiveDeltaCycles;
     _defaultExecutionOptions  = defaultExecutionOptions;
     _versionCorrection        = versionCorrection ?? VersionCorrection.Latest;
 }
Example #2
0
 public ExecutionOptions(IViewCycleExecutionSequence executionSequence, ViewExecutionFlags flags, int? maxSuccessiveDeltaCycles = null, ViewCycleExecutionOptions defaultExecutionOptions = null, VersionCorrection versionCorrection = null)
 {
     _executionSequence = executionSequence;
     _flags = flags;
     _maxSuccessiveDeltaCycles = maxSuccessiveDeltaCycles;
     _defaultExecutionOptions = defaultExecutionOptions;
     _versionCorrection = versionCorrection ?? VersionCorrection.Latest;
 }
Example #3
0
        private static int CountBits(ViewExecutionFlags flags)
        {
            int count = 0;

            while (flags != 0)
            {
                count++;
                flags &= flags - 1;
            }
            return(count);
        }
Example #4
0
        public void CanRunSingleYesterdayCycleBatchWithVersion()
        {
            DateTimeOffset           valuationTime   = DateTimeOffset.Now - TimeSpan.FromDays(1);
            var                      seq             = ArbitraryViewCycleExecutionSequence.Create(valuationTime);
            const ViewExecutionFlags flags           = ViewExecutionFlags.RunAsFastAsPossible | ViewExecutionFlags.AwaitMarketData;
            IViewExecutionOptions    req             = new ExecutionOptions(seq, flags, defaultExecutionOptions: new ViewCycleExecutionOptions(valuationTime, new LiveMarketDataSpecification()), versionCorrection: new VersionCorrection(valuationTime, valuationTime));
            var                      runToCompletion = RunToCompletion(req);

            Assert.Equal(1, runToCompletion.Item1.Count());
            Assert.Equal(1, runToCompletion.Item2.Count());
            AssertApproximatelyEqual(req.ExecutionSequence.Next.ValuationTime, runToCompletion.Item2.Single().FullResult.ValuationTime);
        }
Example #5
0
 private static bool IsIndividualFlag(ViewExecutionFlags flags)
 {
     return(CountBits(flags) == 1);
 }