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; }
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; }
private static int CountBits(ViewExecutionFlags flags) { int count = 0; while (flags != 0) { count++; flags &= flags - 1; } return(count); }
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); }
private static bool IsIndividualFlag(ViewExecutionFlags flags) { return(CountBits(flags) == 1); }