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