예제 #1
0
 public void ReceiveFrom(INewComponent comp)
 {
     if (mainExprFunc == null)
     {
         throw new Exception("main expr cannot be null");
     }
     comp.Attach(mainExprFunc);
 }
예제 #2
0
 public void SetFunction(Action <DataType> func, INewComponent comp)
 {
     RecvFunction = func;
     if (mainExprFunc == null)
     {
         mainExprFunc = Yolo.Express <DataType>().Name("OutputAdapterFunc").Perform(x => func(x));
     }
     else
     {
         mainExprFunc.Perform(x => func(x));
     }
     comp.Attach(mainExprFunc);
 }
예제 #3
0
 public static void CreateComponent(INewComponent component, AbstractBlock baseBlock)
 {
     lock (tree)
     {
         if (baseBlock.ComponentID == 0)
         {
             component.ID          = NextComponentID;
             component.InputBlock  = baseBlock;
             baseBlock.ComponentID = component.ID;
             tree.AddVertex(baseBlock);
             if (!inputBlocks.Where(x => x.UniqueID == baseBlock.UniqueID).Any())
             {
                 inputBlocks.Add(baseBlock);
             }
         }
         else
         {
             component.ID = baseBlock.ComponentID;
         }
     }
 }
예제 #4
0
 public void Attach(INewComponent component)
 {
     OutputBlock.AddChild(component.InputBlock, new Filter <object>(null));
 }
예제 #5
0
 public void Detach(INewComponent component)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 public void Detach(INewComponent component)
 {
     //exprblock.RemoveChild(component.InputBlock);
 }
예제 #7
0
 public void Attach(INewComponent component)
 {
     //exprblock.AddChild<object>(component.InputBlock, null);
 }
예제 #8
0
 public BaseOutputAdapter(Action <DataType> func, INewComponent fromComp, string name = "CompactOutputAdapter")
 {
     SetFunction(func, fromComp);
 }
예제 #9
0
 public static void QuickSendData(object data, INewComponent comp)
 {
     comp.Send(data);
 }
예제 #10
0
 public void Detach(INewComponent component)
 {
     node.Attach(component);
 }
예제 #11
0
파일: YoloQL.cs 프로젝트: kouweizhong/noql
 public INewComponent Get(INewComponent comp)
 {
     return(comp);
 }
예제 #12
0
 public static void Branch <FilterType>(AbstractBlock block, Filter <FilterType> filter, INewComponent component)
 {
     component.ID = 0;
     CreateComponent(component, block);
     Attach(block, filter, component);
 }
예제 #13
0
 private static void Attach <FilterType>(AbstractBlock block, Filter <FilterType> filter, INewComponent component)
 {
     if (component.ID == 0)
     {
         throw new Exception("Tried to add child to a component with no ID");
     }
     if (block.ComponentID == null || block.ComponentID == 0)
     {
         block.ComponentID = component.ID;
     }
     Connection conn = component.OutputBlock.AddChild(block, filter);
 }