MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / RegisterPre

Function RegisterPre

user/argtype/iargtype.go:257–269  ·  view source on GitHub ↗
(name string, type_index, parent_index uint32)

Source from the content-addressed store, hash-verified

255}
256
257func RegisterPre(name string, type_index, parent_index uint32) IArgType {
258 // 注册有预设的扩展类型
259 if at, dup := arg_types[type_index]; dup {
260 panic(fmt.Sprintf("duplicate register for ArgType name=%s index=%d", at.GetName(), at.GetTypeIndex()))
261 }
262 p := GetArgType(parent_index)
263 new_p := p.Clone()
264 new_p.SetName(name)
265 new_p.SetTypeIndex(type_index)
266 new_p.SetParentIndex(parent_index)
267 arg_types[type_index] = new_p
268 return new_p
269}
270
271func RegisterNew(name string, parent_index uint32) IArgType {
272 // 动态注册新的类型 parent_index 即父类型的唯一索引

Callers 7

RegisterFlagsConfigFunction · 0.85
r_STD_STRINGFunction · 0.85
r_PRE_ARRAYFunction · 0.85
PRE_R_STRUCTFunction · 0.85
r_IOVECFunction · 0.85
r_MSGHDRFunction · 0.85
RegisterNewFunction · 0.85

Calls 7

GetArgTypeFunction · 0.85
GetNameMethod · 0.65
GetTypeIndexMethod · 0.65
CloneMethod · 0.65
SetNameMethod · 0.65
SetTypeIndexMethod · 0.65
SetParentIndexMethod · 0.65

Tested by

no test coverage detected