新增结点实现

This commit is contained in:
boyce
2025-10-02 11:48:58 +08:00
parent 6511fc4ac0
commit d4c0bd22ad
8 changed files with 278 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ import "fmt"
type IBaseExecNode interface {
initInnerExecNode(innerNode *innerExecNode)
initExecNode(gr *Graph, en *execNode) error
GetPorts() ([]IPort, []IPort)
}
type IInnerExecNode interface {
@@ -147,6 +148,7 @@ func (em *innerExecNode) IsInPortExec(index int) bool {
return em.inPort[index].IsPortExec()
}
func (em *innerExecNode) IsOutPortExec(index int) bool {
if index >= len(em.outPort) || index < 0 {
return false
@@ -201,6 +203,10 @@ func (en *BaseExecNode) initExecNode(gr *Graph, node *execNode) error {
return nil
}
func (en *BaseExecNode) GetPorts() ([]IPort, []IPort) {
return en.InputPorts, en.OutputPorts
}
func (en *BaseExecNode) GetInPort(index int) IPort {
if en.InputPorts == nil {
return nil
@@ -481,6 +487,10 @@ func (en *BaseExecNode) DoNext(index int) error {
return fmt.Errorf("next index %d not found", index)
}
if en.execNode.nextNode[index] == nil {
return nil
}
return en.execNode.nextNode[index].Do(en.gr)
}