MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / loadModuleGroup

Method loadModuleGroup

Engine/source/module/moduleManager.cpp:241–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239//-----------------------------------------------------------------------------
240
241bool ModuleManager::loadModuleGroup( const char* pModuleGroup )
242{
243 // Lock database.
244 LockDatabase( this );
245
246 // Sanity!
247 AssertFatal( pModuleGroup != NULL, "Cannot load module group with NULL group name." );
248
249 typeModuleLoadEntryVector moduleResolvingQueue;
250 typeModuleLoadEntryVector moduleReadyQueue;
251
252 // Fetch module group.
253 StringTableEntry moduleGroup = StringTable->insert( pModuleGroup );
254
255 // Info.
256 if ( mEchoInfo )
257 {
258 Con::printSeparator();
259 Con::printf( "Module Manager: Loading group '%s':" ,moduleGroup );
260 }
261
262 // Is the module group already loaded?
263 if ( findGroupLoaded( moduleGroup ) != NULL )
264 {
265 // Yes, so warn.
266 Con::warnf( "Module Manager: Cannot load group '%s' as it is already loaded.", moduleGroup );
267 return false;
268 }
269
270 // Find module group.
271 typeGroupModuleHash::iterator moduleGroupItr = mGroupModules.find( moduleGroup );
272
273 // Did we find the module group?
274 if ( moduleGroupItr == mGroupModules.end() )
275 {
276 // No, so info.
277 if ( mEchoInfo )
278 {
279 Con::printf( "Module Manager: No modules found for module group '%s'.", moduleGroup );
280 }
281
282 return true;
283 }
284
285 // Yes, so fetch the module Ids.
286 typeModuleIdVector* pModuleIds = moduleGroupItr->value;
287
288 // Iterate module groups.
289 for( typeModuleIdVector::iterator moduleIdItr = pModuleIds->begin(); moduleIdItr != pModuleIds->end(); ++moduleIdItr )
290 {
291 // Fetch module Id.
292 StringTableEntry moduleId = *moduleIdItr;
293
294 // Finish if we could not resolve the dependencies for module Id (of any version Id).
295 if ( !resolveModuleDependencies( moduleId, 0, moduleGroup, false, moduleResolvingQueue, moduleReadyQueue ) )
296 return false;
297 }
298

Callers 1

Calls 15

LockDatabaseClass · 0.85
printSeparatorFunction · 0.85
printfFunction · 0.85
addPathExpandoFunction · 0.85
executefFunction · 0.85
getVariableFunction · 0.85
setVariableFunction · 0.85
getModuleIdMethod · 0.80
getVersionIdMethod · 0.80
increaseLoadCountMethod · 0.80
getModuleGroupMethod · 0.80

Tested by

no test coverage detected