public AbstractBlock Compile() { var blocks = new Queue <AbstractBlock>(); ICEPExpression currentExpr = ChildExpression; while (currentExpr != null) { blocks.Enqueue(currentExpr.ThisBlock); if (currentExpr.ChildExpression != null) { currentExpr = currentExpr.ChildExpression; } else { break; } } AbstractBlock topBlock = blocks.Dequeue(); AbstractBlock currentBlock = topBlock; foreach (AbstractBlock b in blocks) { currentBlock.AddChild(b, new Filter <object>(null)); currentBlock = b; } _tail = blockFactory.CreateLambdaBlock <object>(o => { if (CEPOutputEvent != null) { CEPOutputEvent(o); } return(true); }, "tail"); currentBlock.AddChild <object>(_tail, null); return(topBlock); }
public YoloEnumerator(AbstractBlock output, BaseInputAdapter inputer) { CollectionOp <T> enumOp = new CollectionOp <T>(); enumOp.OpType = CollectionOpTypes.Enumerate; parentOutput = output; outputBlock = BlockFactory.CreateLambdaBlock <CollectionOp <T> >(x => { if (x.OpID == enumOp.OpID) { EnumOp = x; output.RemoveChild(outputBlock); } return(true); }, "YoloEnumerableOutput"); output.AddChild(outputBlock, new Filter <CollectionOp <T> >(null)); inputer.Send(enumOp); }
public void Attach(INewComponent component) { exprblock.AddChild <object>(component.InputBlock, null); }