mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-18 06:57:29 +08:00
新增结点实现
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user