@@ -137,7 +137,6 @@ namespace behaviac {
137137 static BehaviorLoader* ms_behaviorLoader;
138138
139139 static behaviac::map<behaviac::string, TypeCreator*> _Creators;
140- // static behaviac::map<behaviac::string, Type*> _typesRegistered;
141140
142141 public:
143142 BEHAVIAC_DECLARE_MEMORY_OPERATORS (AgentMeta);
@@ -165,15 +164,16 @@ namespace behaviac {
165164 const behaviac::map<uint32_t , IProperty*>& GetMemberProperties ();
166165 IInstanceMember* GetMethod (uint32_t methodId);
167166
168- static IProperty* CreateProperty (const behaviac::string& typeName, uint32_t propId, const char * propName, const char * valueStr);
169- static IProperty* CreateArrayItemProperty (const behaviac::string& typeName, uint32_t parentId, const char * parentName);
170- static IInstanceMember* CreateInstanceProperty (const behaviac::string& typeName, const char * instance, IInstanceMember* indexMember, uint32_t varId);
171- static IInstanceMember* CreateInstanceConst (const behaviac::string& typeName, const char * valueStr);
172- static IProperty* CreateCustomizedProperty (const behaviac::string& typeName, uint32_t propId, const char * propName, const char * valueStr);
173- static IProperty* CreateCustomizedArrayItemProperty (const behaviac::string& typeName, uint32_t parentId, const char * parentName);
167+ static IProperty* CreateProperty (const char * typeName, uint32_t propId, const char * propName, const char * valueStr);
168+ static IProperty* CreateArrayItemProperty (const char * typeName, uint32_t parentId, const char * parentName);
169+ static IInstanceMember* CreateInstanceProperty (const char * typeName, const char * instance, IInstanceMember* indexMember, uint32_t varId);
170+ static IInstanceMember* CreateInstanceConst (const char * typeName, const char * valueStr);
171+ static IProperty* CreateCustomizedProperty (const char * typeName, uint32_t propId, const char * propName, const char * valueStr);
172+ static IProperty* CreateCustomizedArrayItemProperty (const char * typeName, uint32_t parentId, const char * parentName);
174173
175- static void CreatorAddElement (const behaviac::string& typeName, TypeCreator* tc);
176- static void CreatorRemoveElement (const behaviac::string& typeName);
174+ static TypeCreator* GetTypeCreator (const char * typeName);
175+ static void AddTypeCreator (const char * typeName, TypeCreator* tc);
176+ static void RemoveTypeCreator (const char * typeName);
177177
178178 static const char * ParseInstanceNameProperty (const char * fullName, char * instanceName, char * agentType);
179179
@@ -214,8 +214,9 @@ namespace behaviac {
214214 &CreatorCustomizedProperty<RegisteredType>,
215215 &CreatorCustomizedArrayItemProperty<RegisteredType>
216216 );
217- // _Creators[typeName] = tc;
218- CreatorAddElement (typeName, tc);
217+
218+ AddTypeCreator (typeName, tc);
219+
219220 char vectorTypeName[1024 ];
220221 string_sprintf (vectorTypeName, " vector<%s>" , typeName);
221222
@@ -226,25 +227,21 @@ namespace behaviac {
226227 CreatorInstanceConst<behaviac::vector<RegisteredType> >,
227228 &CreatorCustomizedProperty<behaviac::vector<RegisteredType> >,
228229 &CreatorCustomizedArrayItemProperty<behaviac::vector<RegisteredType> >);
229- // _Creators[vectorTypeName] = tcl;
230- CreatorAddElement (vectorTypeName, tcl);
230+
231+ AddTypeCreator (vectorTypeName, tcl);
231232 }
232233
233234 return true ;
234235 }
235236
236237 template <typename T>
237238 static void UnRegister (const char * typeName) {
238- // _typesRegistered.Remove(typeName);
239-
240- // _Creators.erase(typeName);
241- CreatorRemoveElement (typeName);
239+ RemoveTypeCreator (typeName);
242240
243241 char vectorTypeName[1024 ];
244242 string_sprintf (vectorTypeName, " vector<%s>" , typeName);
245243
246- // _Creators.erase(vectorTypeName);
247- CreatorRemoveElement (vectorTypeName);
244+ RemoveTypeCreator (vectorTypeName);
248245 }
249246
250247 private:
@@ -278,7 +275,7 @@ namespace behaviac {
278275
279276 behaviac::string typeName = behaviac::GetTypeDescString<Type>();
280277
281- return AgentMeta::CreateInstanceConst (typeName, value);
278+ return AgentMeta::CreateInstanceConst (typeName. c_str () , value);
282279 }
283280
284281 return ParseProperty (value);
0 commit comments