當前位置: 首頁>>代碼示例>>Golang>>正文


Golang behaviour.SignalTypeIf類代碼示例

本文整理匯總了Golang中github.com/axel-freesp/sge/interface/behaviour.SignalTypeIf的典型用法代碼示例。如果您正苦於以下問題:Golang SignalTypeIf類的具體用法?Golang SignalTypeIf怎麽用?Golang SignalTypeIf使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SignalTypeIf類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: RemoveRegisteredSignalType

func RemoveRegisteredSignalType(st bh.SignalTypeIf) {
	name := st.TypeName()
	delete(signalTypes, name)
	_, ok := registeredSignalTypes.Find(name)
	if ok {
		registeredSignalTypes.Remove(name)
	}
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:8,代碼來源:globals.go

示例2: CreateXmlSignalType

func CreateXmlSignalType(s bh.SignalTypeIf) *backend.XmlSignalType {
	var scope, mode string
	if s.Scope() == bh.Local {
		scope = "local"
	}
	if s.Mode() == bh.Synchronous {
		mode = "sync"
	}
	return backend.XmlSignalTypeNew(s.TypeName(), scope, mode, s.CType(), s.ChannelId())
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:10,代碼來源:backendconversions.go

示例3: AddSignalType

func (l *library) AddSignalType(s bh.SignalTypeIf) (ok bool) {
	for _, st := range l.signalTypes.SignalTypes() {
		if st.TypeName() == s.TypeName() {
			log.Printf(`library.AddSignalType: warning: adding
				duplicate signal type definition %s (ignored)`, s.TypeName())
			return
		}
	}
	ok = true
	l.signalTypes.Append(s)
	return
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:12,代碼來源:library.go

示例4: LibraryUsesSignalType

func LibraryUsesSignalType(l bh.LibraryIf, st bh.SignalTypeIf) bool {
	for _, t := range l.SignalTypes() {
		if t.TypeName() == st.TypeName() {
			return true
		}
	}
	for _, t := range l.NodeTypes() {
		for _, impl := range t.Implementation() {
			if impl.ImplementationType() == bh.NodeTypeGraph {
				if SignalGraphTypeUsesSignalType(impl.Graph(), st) {
					return true
				}
			}
		}
	}
	return false
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:17,代碼來源:library.go

示例5: RemoveSignalType

func (l *library) RemoveSignalType(st bh.SignalTypeIf) {
	for _, ntName := range freesp.GetRegisteredNodeTypes() {
		nt, ok := freesp.GetNodeTypeByName(ntName)
		if !ok {
			log.Panicf("library.RemoveSignalType internal error: node type %s\n", ntName)
		}
		for _, p := range nt.InPorts() {
			if p.SignalType().TypeName() == st.TypeName() {
				log.Printf(`library.RemoveSignalType warning:
					bh.SignalTypeIf %v is still in use\n`, st)
				return
			}
		}
		for _, p := range nt.OutPorts() {
			if p.SignalType().TypeName() == st.TypeName() {
				log.Printf(`library.RemoveSignalType warning:
					bh.SignalTypeIf %v is still in use\n`, st)
				return
			}
		}
	}
	SignalTypeDestroy(st)
	l.signalTypes.Remove(st)
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:24,代碼來源:library.go

示例6: RegisterSignalType

func RegisterSignalType(st bh.SignalTypeIf) {
	signalTypes[st.TypeName()] = st
	registeredSignalTypes.Append(st.TypeName())
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:4,代碼來源:globals.go

示例7: addOutPort

func (t *nodeType) addOutPort(name string, pType bh.SignalTypeIf) {
	t.outPorts.Append(PortTypeNew(name, pType.TypeName(), gr.OutPort))
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:3,代碼來源:nodetype.go

示例8: signalTypeCpmpatible

func signalTypeCpmpatible(s1, s2 bh.SignalTypeIf) bool {
	if s1.TypeName() != s2.TypeName() {
		return true
	}
	if s1.CType() != s2.CType() {
		return false
	}
	if s1.Scope() != s2.Scope() {
		return false
	}
	if s1.ChannelId() != s2.ChannelId() {
		return false
	}
	if s1.Mode() != s2.Mode() {
		return false
	}
	return true
}
開發者ID:axel-freesp,項目名稱:sge,代碼行數:18,代碼來源:signaltype.go


注:本文中的github.com/axel-freesp/sge/interface/behaviour.SignalTypeIf類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。