/// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="filter"></param>
 public WhereFWindow(FWindowable <TPayload> input, Expression <Func <TPayload, bool> > filter)
     : base(input, input.Size, input.Period, input.Offset, input.Duration)
 {
     _filter  = filter.Compile();
     _Payload = Input.Payload as FSubWindow <TPayload>;
     _Sync    = Input.Sync as FSubWindow <long>;
     _Other   = Input.Other as FSubWindow <long>;
     _BV      = new BVFSubWindow(Length);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="aggregate"></param>
 /// <param name="window"></param>
 public TumblingAggregateFWindow(
     FWindowable <TPayload> input,
     IAggregate <TPayload, TAggState, TResult> aggregate,
     long window
     ) : base(input, input.Size, window, input.Offset, window)
 {
     Invariant.IsTrue(input.Size % window == 0, "Input size need to be a multiple of window");
     _window    = window;
     _aggregate = aggregate;
     _init      = _aggregate.InitialState().Compile();
     _acc       = _aggregate.Accumulate().Compile();
     _res       = _aggregate.ComputeResult().Compile();
     _BV        = new BVFSubWindow(Length);
 }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="input"></param>
 /// <param name="aggregate"></param>
 /// <param name="window"></param>
 /// <param name="period"></param>
 public HoppingAggregateFWindow(
     FWindowable <TPayload> input,
     IAggregate <TPayload, TAggState, TResult> aggregate,
     long window, long period
     ) : base(input, input.Size, period, input.Offset, period)
 {
     Invariant.IsTrue(period % Input.Period == 0, "Period must be a multiple of input period");
     Invariant.IsTrue(window % period == 0, "Window must be a multiple of period");
     _window    = window;
     _aggregate = aggregate;
     _init      = _aggregate.InitialState().Compile();
     _acc       = _aggregate.Accumulate().Compile();
     _diff      = aggregate.Difference().Compile();
     _res       = _aggregate.ComputeResult().Compile();
     _states    = new TAggState[(window / period) + 1];
     _idx       = -1;
     _BV        = new BVFSubWindow(Length);
 }