Establishes a common namespace for Module ScopeSet objects to make it easier to work with function calls out of module namespaces

This commit is contained in:
Areloch 2022-12-22 00:02:34 -06:00
parent 6f0a93bdcc
commit 00c27095f7
2 changed files with 13 additions and 9 deletions

View file

@ -385,6 +385,8 @@ bool ModuleManager::loadModuleGroup( const char* pModuleGroup )
// Create a scope set. // Create a scope set.
SimSet* pScopeSet = new SimSet; SimSet* pScopeSet = new SimSet;
pScopeSet->registerObject( pLoadReadyModuleDefinition->getModuleId() ); pScopeSet->registerObject( pLoadReadyModuleDefinition->getModuleId() );
pScopeSet->setClassNamespace("ModuleRoot");
pReadyEntry->mpModuleDefinition->mScopeSet = pScopeSet->getId(); pReadyEntry->mpModuleDefinition->mScopeSet = pScopeSet->getId();
// Increase load count. // Increase load count.
@ -773,6 +775,8 @@ bool ModuleManager::loadModuleExplicit( const char* pModuleId, const U32 version
// Create a scope set. // Create a scope set.
SimSet* pScopeSet = new SimSet; SimSet* pScopeSet = new SimSet;
pScopeSet->registerObject( pLoadReadyModuleDefinition->getModuleId() ); pScopeSet->registerObject( pLoadReadyModuleDefinition->getModuleId() );
pScopeSet->setClassNamespace("ModuleRoot");
pReadyEntry->mpModuleDefinition->mScopeSet = pScopeSet->getId(); pReadyEntry->mpModuleDefinition->mScopeSet = pScopeSet->getId();
// Increase load count. // Increase load count.

View file

@ -104,7 +104,7 @@ function loadAssetsByType(%assetType)
} }
} }
function SimSet::getModulePath(%scopeSet) function ModuleRoot::getModulePath(%scopeSet)
{ {
%name = %scopeSet.getName(); %name = %scopeSet.getName();
%moduleDef = ModuleDatabase.findModule(%name); %moduleDef = ModuleDatabase.findModule(%name);
@ -115,7 +115,7 @@ function SimSet::getModulePath(%scopeSet)
return ""; return "";
} }
function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive) function ModuleRoot::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive)
{ {
if ($traceModuleCalls) if ($traceModuleCalls)
warn("SimSet::registerDatablock"); warn("SimSet::registerDatablock");
@ -171,7 +171,7 @@ function SimSet::registerDatablock(%scopeSet, %datablockFilePath, %isExclusive)
DatablockFilesList.echo(); DatablockFilesList.echo();
} }
function SimSet::unRegisterDatablock(%scopeSet, %datablockFilePath) function ModuleRoot::unRegisterDatablock(%scopeSet, %datablockFilePath)
{ {
if ($traceModuleCalls) if ($traceModuleCalls)
warn("SimSet::unRegisterDatablock"); warn("SimSet::unRegisterDatablock");
@ -215,7 +215,7 @@ function SimSet::unRegisterDatablock(%scopeSet, %datablockFilePath)
DatablockFilesList.echo(); DatablockFilesList.echo();
} }
function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive) function ModuleRoot::queueExec(%scopeSet, %execFilePath, %isExclusive)
{ {
if ($traceModuleCalls) if ($traceModuleCalls)
warn("SimSet::queueExec"); warn("SimSet::queueExec");
@ -272,7 +272,7 @@ function SimSet::queueExec(%scopeSet, %execFilePath, %isExclusive)
%execFileList.echo(); %execFileList.echo();
} }
function SimSet::unQueueExec(%scopeSet, %execFilePath) function ModuleRoot::unQueueExec(%scopeSet, %execFilePath)
{ {
if ($traceModuleCalls) if ($traceModuleCalls)
warn("SimSet::unRegisterDatablock"); warn("SimSet::unRegisterDatablock");
@ -317,10 +317,10 @@ function SimSet::unQueueExec(%scopeSet, %execFilePath)
%execFileList.echo(); %execFileList.echo();
} }
function SimSet::GetEventManager(%this) function ModuleRoot::GetEventManager(%scopeSet)
{ {
if( !isObject( %this.eventManager ) ) if( !isObject( %scopeSet.eventManager ) )
%this.eventManager = new EventManager() { queue = "ModuleEventManager"; }; %scopeSet.eventManager = new EventManager() { queue = "ModuleEventManager"; };
return %this.eventManager; return %scopeSet.eventManager;
} }