| 198 | } |
| 199 | |
| 200 | void AbstractClassRep::initialize() |
| 201 | { |
| 202 | AssertFatal(!initialized, "Duplicate call to AbstractClassRep::initialize()!"); |
| 203 | Vector<AbstractClassRep *> dynamicTable(__FILE__, __LINE__); |
| 204 | |
| 205 | AbstractClassRep *walk; |
| 206 | |
| 207 | // Initialize namespace references... |
| 208 | for (walk = classLinkList; walk; walk = walk->nextClass) |
| 209 | { |
| 210 | walk->mNamespace = Con::lookupNamespace(StringTable->insert(walk->getClassName())); |
| 211 | walk->mNamespace->mUsage = walk->getDocString(); |
| 212 | walk->mNamespace->mClassRep = walk; |
| 213 | } |
| 214 | |
| 215 | // Initialize field lists... (and perform other console registration). |
| 216 | for (walk = classLinkList; walk; walk = walk->nextClass) |
| 217 | { |
| 218 | // sg_tempFieldList is used as a staging area for field lists |
| 219 | // (see addField, addGroup, etc.) |
| 220 | sg_tempFieldList.setSize(0); |
| 221 | |
| 222 | walk->init(); |
| 223 | |
| 224 | // So if we have things in it, copy it over... |
| 225 | if (sg_tempFieldList.size() != 0) |
| 226 | walk->mFieldList = sg_tempFieldList; |
| 227 | |
| 228 | // And of course delete it every round. |
| 229 | sg_tempFieldList.clear(); |
| 230 | } |
| 231 | |
| 232 | // Calculate counts and bit sizes for the various NetClasses. |
| 233 | for (U32 group = 0; group < NetClassGroupsCount; group++) |
| 234 | { |
| 235 | U32 groupMask = 1 << group; |
| 236 | |
| 237 | // Specifically, for each NetClass of each NetGroup... |
| 238 | for(U32 type = 0; type < NetClassTypesCount; type++) |
| 239 | { |
| 240 | // Go through all the classes and find matches... |
| 241 | for (walk = classLinkList; walk; walk = walk->nextClass) |
| 242 | { |
| 243 | if(walk->mClassType == type && walk->mClassGroupMask & groupMask) |
| 244 | dynamicTable.push_back(walk); |
| 245 | } |
| 246 | |
| 247 | // Set the count for this NetGroup and NetClass |
| 248 | NetClassCount[group][type] = dynamicTable.size(); |
| 249 | if(!NetClassCount[group][type]) |
| 250 | continue; // If no classes matched, skip to next. |
| 251 | |
| 252 | // Sort by type and then by name. |
| 253 | dQsort((void *) &dynamicTable[0], dynamicTable.size(), sizeof(AbstractClassRep *), ACRCompare); |
| 254 | |
| 255 | // Allocate storage in the classTable |
| 256 | classTable[group][type] = new AbstractClassRep*[NetClassCount[group][type]]; |
| 257 |
nothing calls this directly
no test coverage detected