本文整理匯總了Golang中github.com/axel-freesp/sge/interface/behaviour.PortTypeIf.Direction方法的典型用法代碼示例。如果您正苦於以下問題:Golang PortTypeIf.Direction方法的具體用法?Golang PortTypeIf.Direction怎麽用?Golang PortTypeIf.Direction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/axel-freesp/sge/interface/behaviour.PortTypeIf
的用法示例。
在下文中一共展示了PortTypeIf.Direction方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: removePort
func (n *node) removePort(pt bh.PortTypeIf) {
var list *portList
if pt.Direction() == gr.InPort {
list = &n.inPort
} else {
list = &n.outPort
}
var i int
for i = 0; i < len(list.Ports()); i++ {
if list.Ports()[i].Name() == pt.Name() {
break
}
}
toRemove := list.Ports()[i]
for _, c := range toRemove.Connections() {
c.RemoveConnection(toRemove)
}
list.Remove(toRemove)
}
示例2: RemoveNamedPortType
func (t *nodeType) RemoveNamedPortType(p bh.PortTypeIf) {
for _, impl := range t.implementation.Implementations() {
if impl.ImplementationType() == bh.NodeTypeGraph {
if p.Direction() == gr.InPort {
impl.Graph().(*signalGraphType).removeInputNodeFromPortType(p)
} else {
impl.Graph().(*signalGraphType).removeOutputNodeFromPortType(p)
}
}
}
for _, n := range t.instances.Nodes() {
n.(*node).removePort(p.(*portType))
}
var list *portTypeList
if p.Direction() == gr.InPort {
list = &t.inPorts
} else {
list = &t.outPorts
}
list.Remove(p)
}
示例3: AddNamedPortType
func (t *nodeType) AddNamedPortType(p bh.PortTypeIf) {
if p.Direction() == gr.InPort {
t.inPorts.Append(p)
} else {
t.outPorts.Append(p)
}
for _, n := range t.instances.Nodes() {
if p.Direction() == gr.InPort {
n.(*node).addInPort(p)
} else {
n.(*node).addOutPort(p)
}
}
for _, impl := range t.implementation.Implementations() {
if impl.ImplementationType() == bh.NodeTypeGraph {
if p.Direction() == gr.InPort {
impl.Graph().(*signalGraphType).addInputNodeFromPortType(p)
} else {
impl.Graph().(*signalGraphType).addOutputNodeFromPortType(p)
}
}
}
}