增加了获取子module个数的方法

This commit is contained in:
jau1jz
2019-03-28 16:24:30 +08:00
parent 5f49842089
commit 8e9a317326

View File

@@ -98,6 +98,14 @@ func (slf *BaseModule) GetModuleById(moduleId uint32) IModule {
return ret
}
func (slf *BaseModule) GetModuleCount() int {
locker := slf.GetRoot().getBaseModule().getLocker()
locker.Lock()
defer locker.Unlock()
return len(slf.mapModule)
}
func (slf *BaseModule) genModuleId() uint32 {
slf.CurrMaxModuleId++
moduleId := slf.CurrMaxModuleId