single_class_mgr.go 779 B

12345678910111213141516171819202122232425262728293031323334
  1. package logic
  2. var instance *SingleClassMgr
  3. type SingleClassMgr struct {
  4. // DictInfo map[string] interface{}
  5. ObjMgr
  6. }
  7. func init() {
  8. instance = new(SingleClassMgr)
  9. // instance.DictInfo = make(map[interface{}]interface{})
  10. }
  11. func GetClassInstance() *SingleClassMgr {
  12. return instance
  13. }
  14. //func (se *SingleClassMgr) Register(i interface{}){
  15. // fmt.Println("<SingleClassMgr> Register", reflect.ValueOf(i), reflect.TypeOf(i).String())
  16. // className := reflect.TypeOf(i).String()
  17. // se.DictInfo[className] = i
  18. // fmt.Println(se.DictInfo)
  19. //}
  20. //
  21. //func (se *SingleClassMgr) GetObj(objName string) interface{}{
  22. // obj, ok := se.DictInfo[objName]
  23. // if ok == true {
  24. // return obj
  25. // } else {
  26. // fmt.Println("<SingleClassMgr> GetObj nil, objName:", objName)
  27. // return nil
  28. // }
  29. //}