|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- package ops2
-
- import (
- "gitlink.org.cn/cloudream/common/pkgs/ioswitch/dag"
- "gitlink.org.cn/cloudream/common/pkgs/ioswitch/plan/ops"
- )
-
- type GraphNodeBuilder struct {
- *ops.GraphNodeBuilder
- }
-
- func NewGraphNodeBuilder() *GraphNodeBuilder {
- return &GraphNodeBuilder{ops.NewGraphNodeBuilder()}
- }
-
- type FromNode interface {
- dag.Node
- Output() dag.StreamSlot
- }
-
- type ToNode interface {
- dag.Node
- Input() dag.StreamSlot
- SetInput(input *dag.StreamVar)
- }
-
- // func formatStreamIO(node *dag.Node) string {
- // is := ""
- // for i, in := range node.InputStreams {
- // if i > 0 {
- // is += ","
- // }
-
- // if in == nil {
- // is += "."
- // } else {
- // is += fmt.Sprintf("%v", in.ID)
- // }
- // }
-
- // os := ""
- // for i, out := range node.OutputStreams {
- // if i > ops
- // os += ","
- // }
-
- // if out == nil {
- // os += "."
- // } else {
- // os += fmt.Sprintf("%v", out.ID)
- // }
- // }
-
- // if is == "" && os == "" {
- // return ""
- // }
-
- // return fmt.Sprintf("S{%s>%s}", is, os)
- // }
-
- // func formatValueIO(node *dag.Node) string {
- // is := ""
- // for i, in := range node.InputValues {
- // if i > 0 {
- // is += ","
- // }
-
- // if in == nil {
- // is += "."
- // } else {
- // is += fmt.Sprintf("%v", in.ID)
- // }
- // }
-
- // os := ""
- // for i, out := range node.OutputValues {
- // if i > 0 {
- // os += ","
- // }
-
- // if out == nil {
- // os += "."
- // } else {
- // os += fmt.Sprintf("%v", out.ID)
- // }
- // }
-
- // if is == "" && os == "" {
- // return ""
- // }
-
- // return fmt.Sprintf("V{%s>%s}", is, os)
- // }
|