Пример #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
        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
 public static EvalRootNode MakeRootNodeFromFactory(EvalRootFactoryNode rootFactoryNode, PatternAgentInstanceContext patternAgentInstanceContext)
 {
     return((EvalRootNode)rootFactoryNode.MakeEvalNode(patternAgentInstanceContext, null));
 }
Пример #11
0
 public static EvalNode MakeEvalNodeSingleChild(IList <EvalFactoryNode> childNodes, PatternAgentInstanceContext agentInstanceContext, EvalNode parentNode)
 {
     return(childNodes[0].MakeEvalNode(agentInstanceContext, parentNode));
 }
Пример #12
0
 public EvalAndNode(PatternAgentInstanceContext context, EvalAndFactoryNode factoryNode, IList <EvalNode> childNodes)
     : base(context)
 {
     FactoryNode = factoryNode;
     ChildNodes  = childNodes;
 }
Пример #13
0
 /// <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);
        public long AbsMillisecondExpiry(PatternAgentInstanceContext context)
        {
            long current = context.StatementContext.SchedulingService.Time;

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