コード例 #1
0
        public static EvalMatchUntilStateBounds InitBounds(
            EvalMatchUntilFactoryNode factoryNode,
            MatchedEventMap beginState,
            PatternAgentInstanceContext context)
        {
            int?lowerbounds     = null;
            int?upperbounds     = null;
            var eventsPerStream = factoryNode.Convertor.Convert(beginState);
            var evaluateParams  = new EvaluateParams(eventsPerStream, true, context.AgentInstanceContext);

            if (factoryNode.SingleBound != null)
            {
                var bounds = (int?)factoryNode.SingleBound.ExprEvaluator.Evaluate(evaluateParams);
                lowerbounds = bounds;
                upperbounds = bounds;
            }
            else
            {
                if (factoryNode.LowerBounds != null)
                {
                    lowerbounds = (int?)factoryNode.LowerBounds.ExprEvaluator.Evaluate(evaluateParams);
                }
                if (factoryNode.UpperBounds != null)
                {
                    upperbounds = (int?)factoryNode.UpperBounds.ExprEvaluator.Evaluate(evaluateParams);
                }
                if (upperbounds != null && lowerbounds != null)
                {
                    if (upperbounds < lowerbounds)
                    {
                        int?lbounds = lowerbounds;
                        lowerbounds = upperbounds;
                        upperbounds = lbounds;
                    }
                }
            }

            return(new EvalMatchUntilStateBounds(lowerbounds, upperbounds));
        }
コード例 #2
0
        public override EvalNode MakeEvalNode(PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
        {
            EvalNode child = EvalNodeUtil.MakeEvalNodeSingleChild(ChildNodes, agentInstanceContext, parentNode);

            return(new EvalEveryNode(agentInstanceContext, this, child));
        }
コード例 #3
0
 public override EvalNode MakeEvalNode(PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
 {
     EvalNode[] children = EvalNodeUtil.MakeEvalNodeChildren(ChildNodes, agentInstanceContext, parentNode);
     return(new EvalMatchUntilNode(agentInstanceContext, this, children[0], children.Length == 1 ? null : children[1]));
 }
コード例 #4
0
 public EvalNotNode(PatternAgentInstanceContext context, EvalNotFactoryNode factoryNode, EvalNode childNode)
     : base(context)
 {
     _factoryNode = factoryNode;
     _childNode   = childNode;
 }
コード例 #5
0
 public override EvalNode MakeEvalNode(PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
 {
     EvalNode[] children = EvalNodeUtil.MakeEvalNodeChildren(ChildNodes, agentInstanceContext, parentNode);
     return(new EvalAndNode(agentInstanceContext, this, children));
 }
コード例 #6
0
 public override EvalNode MakeEvalNode(PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
 {
     return(new EvalFilterNode(agentInstanceContext, this));
 }
コード例 #7
0
 public EvalEveryDistinctNode(EvalEveryDistinctFactoryNode factoryNode, EvalNode childNode, PatternAgentInstanceContext agentInstanceContext)
     : base(agentInstanceContext)
 {
     _factoryNode = factoryNode;
     _childNode   = childNode;
 }
コード例 #8
0
ファイル: EvalNodeUtil.cs プロジェクト: ikvm/nesper
        public static EvalNode[] MakeEvalNodeChildren(IList <EvalFactoryNode> childNodes, PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
        {
            var children = new EvalNode[childNodes.Count];

            for (int i = 0; i < childNodes.Count; i++)
            {
                children[i] = childNodes[i].MakeEvalNode(agentInstanceContext, parentNode);
            }
            return(children);
        }
コード例 #9
0
 public long AbsExpiry(PatternAgentInstanceContext context)
 {
     long current = context.StatementContext.SchedulingService.Time;
     return current + _timeDeltaComputation.DeltaAdd(current);
 }
コード例 #10
0
ファイル: EvalNodeUtil.cs プロジェクト: ikvm/nesper
 public static EvalRootNode MakeRootNodeFromFactory(EvalRootFactoryNode rootFactoryNode, PatternAgentInstanceContext patternAgentInstanceContext)
 {
     return((EvalRootNode)rootFactoryNode.MakeEvalNode(patternAgentInstanceContext, null));
 }
コード例 #11
0
ファイル: EvalNodeUtil.cs プロジェクト: ikvm/nesper
 public static EvalNode MakeEvalNodeSingleChild(IList <EvalFactoryNode> childNodes, PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
 {
     return(childNodes[0].MakeEvalNode(agentInstanceContext, parentNode));
 }
コード例 #12
0
ファイル: EvalAndNode.cs プロジェクト: valmac/nesper
 public EvalAndNode(PatternAgentInstanceContext context, EvalAndFactoryNode factoryNode, IList <EvalNode> childNodes)
     : base(context)
 {
     FactoryNode = factoryNode;
     ChildNodes  = childNodes;
 }
コード例 #13
0
ファイル: EvalNodeBase.cs プロジェクト: ikvm/nesper
 /// <summary>
 /// Initializes a new instance of the <see cref="EvalNodeBase"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 protected EvalNodeBase(PatternAgentInstanceContext context)
 {
     Context = context;
 }
コード例 #14
0
 public EvalFollowedByNode(PatternAgentInstanceContext context, EvalFollowedByFactoryNode factoryNode, IList <EvalNode> childNodes)
     : base(context)
 {
     _factoryNode = factoryNode;
     _childNodes  = childNodes;
 }
コード例 #15
0
 public abstract EvalNode MakeEvalNode(PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode);
コード例 #16
0
        public long AbsMillisecondExpiry(PatternAgentInstanceContext context)
        {
            long current = context.StatementContext.SchedulingService.Time;

            return(current + TimeDeltaComputation.DeltaMillisecondsAdd(current));
        }