新增数组支持

This commit is contained in:
boyce
2025-10-07 22:06:13 +08:00
parent 640b61bcdb
commit 7a34fafdc8
5 changed files with 154 additions and 6 deletions

View File

@@ -22,9 +22,16 @@ type Port[T iPortType] struct {
}
func (em *Port[T]) Clone() IPort {
return &Port[T]{
PortVal: em.PortVal,
arrayData, ok := any(em.PortVal).(Port_Array)
if !ok {
return &Port[T]{
PortVal: em.PortVal,
}
}
portArray := Port[Port_Array]{}
portArray.PortVal = append(portArray.PortVal, arrayData...)
return &portArray
}
func (em *Port[T]) Reset() {