TorqueScript Reference
Public Member Functions | List of all members
ModuleManager Class Reference

Inherits SimObject.

Public Member Functions

void addListener (listenerObject)
 
bool canMergeModules (mergeSourcePath)
 
string copyModule (sourceModuleDefinition, targetModuleId, targetPath, useVersionPathing?)
 
string findModule (moduleId, versionId)
 
string findModules (loadedOnly?)
 
string findModuleTypes (moduleType, loadedOnly?)
 
bool isModuleMergeAvailable ()
 
bool loadExplicit (moduleId,[versionId])
 
bool loadGroup (moduleGroup)
 
bool mergeModules (mergeTargetPath, removeMergeDefinition, registerNewModules)
 
void removeListener (listenerObject)
 
bool scanModules (moduleRootPath,[rootOnly=false])
 
bool setModuleExtension (moduleExtension)
 
bool synchronizeDependencies (rootModuleDefinition, targetDependencyPath)
 
bool unloadExplicit (moduleId)
 
bool unloadGroup (moduleGroup)
 
bool unregisterModule (moduleId, versionId)
 
- Public Member Functions inherited from SimObject
string call (functionName,[args]*)
 
int clone ([bool copyDynamicFields?=false]?)
 
void delete ()
 
void dump ()
 
void dumpClassHierarchy ()
 
const char * getClassName ()
 
string getClassNamespace ()
 
string getDynamicField (index)
 
int getDynamicFieldCount ()
 
string getField (int index)
 
int getFieldCount ()
 
const char * getFieldType (fieldName)
 
const char * getFieldValue (fieldName)
 
int getGroup ()
 
int getId ()
 
string getInternalName ()
 
const char * getName ()
 
string getProgenitorFile ()
 
string getSuperClassNamespace ()
 
int getType ()
 
bool isChildOfGroup ()
 
bool isMemberOfClass (string classname)
 
bool isMethod (const char *methodName)
 
bool isMethod (string method name)
 
bool isTimerActive ()
 
bool save (fileName,[selectedOnly]?)
 
int schedule (time, command,[arg]*)
 
void setClassNamespace ()
 
bool setFieldValue (fieldName, value)
 
void setInternalName (string InternalName)
 
void setName (newName)
 
void setProgenitorFile (file)
 
void setSuperClassNamespace ()
 
bool startTimer (callbackFunction, float timePeriod,[repeat]?)
 
void stopTimer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static S32 QSORT_CALLBACK compareFields (const void *a, const void *b)
 

Member Function Documentation

void addListener ( listenerObject  )

Registers the specified object as a listener for module notifications.

Parameters
listenerObjectThe object to start receiving module notifications.
Returns
No return value.
bool canMergeModules ( mergeSourcePath  )

Checks whether a module merge using the modules in the source path can current happen or not.

Parameters
mergeSourcePathThe path where modules to be merged are located.
Returns
Whether a module merge using the modules in the source path can current happen or not.
string copyModule ( sourceModuleDefinition  ,
targetModuleId  ,
targetPath  ,
useVersionPathing?   
)

Copy the module to a new location with a new module Id.

Parameters
sourceModuleDefinitionThe module definition to copy.
targetModuleIdThe module Id to rename the copied module to including all references to the source module Id. It is valid to specifiy the source module Id to produce an identical copy.
targetPathThe target path to copy the module to. Addition folders will be created depending on whether 'useVersionPathing' is used or not.
useVersionPathingWhether to add a '/targetModuleId/versionId' folder to the target path or not. This allows copying multiple versions of the same module Id.
Returns
The new module definition file if copy was successful or NULL if not.
string findModule ( moduleId  ,
versionId   
)

Find the specific module Id optionally at the specified version Id.

Parameters
moduleIdThe module Id to find.
versionIdThe version Id to find.
Returns
The module definition object or NULL if not found.
string findModules ( loadedOnly?  )

Find all the modules registered with the specified loaded state.

Parameters
loadedOnlyWhether to return only modules that are loaded or not.
Returns
A list of space-separated module definition object Ids.
string findModuleTypes ( moduleType  ,
loadedOnly?   
)

Find the modules registered with the specified module type.

Parameters
moduleTypeThe module type to search for.
loadedOnlyWhether to return only modules that are loaded or not.
Returns
A list of space-separated module definition object Ids.
bool isModuleMergeAvailable ( )

Checks whether a module merge definition file is available or not.

Returns
Whether a module merge definition file is available or not.
bool loadExplicit ( moduleId  )

Load the specified module explicitly.

Parameters
moduleIdThe module Id to load.
versionIdThe version Id to load. Optional: Will load the latest version.
Returns
Whether the module Id was loaded or not.
bool loadGroup ( moduleGroup  )

Load the specified module group.

Parameters
moduleGroupThe module group to load.
Returns
Whether the module group was loaded or not.
bool mergeModules ( mergeTargetPath  ,
removeMergeDefinition  ,
registerNewModules   
)

Performs a module merge into the selected target path.

Parameters
mergeTargetPathThe path where modules will be merged into.
removeMergeDefinitionWhether to remove any merge definition found or not if merge is successful.
registerNewModulesWhether new (not replaced or updated) modules should be registered or not.
Returns
Whether the module merge was successful or not. Failure here could result in a corrupt module state. Reinstall is recommended or at least advised to the user is recommended.
void removeListener ( listenerObject  )

Unregisters the specified object as a listener for module notifications.

Parameters
listenerObjectThe object to stop receiving module notifications.
Returns
No return value.
bool scanModules ( moduleRootPath  )

Scans for modules which are sub-directories of the specified path.

Parameters
moduleRootPathThe root directory to scan for sub-directories containing modules.
rootOnly[Optional] - Specifies whether to only scan the root path or not when searching for modules.
Returns
Whether the scan was successful or not. A successful scan can still find zero modules.
bool setModuleExtension ( moduleExtension  )

Set the module extension used to scan for modules. The default is 'module'.

Parameters
moduleExtensionThe module extension used to scan for modules. Do not use a period character.
Returns
Whether setting the module extension was successful or not.
bool synchronizeDependencies ( rootModuleDefinition  ,
targetDependencyPath   
)

Synchronize the module dependencies of a module definition to a target dependency folder.

Parameters
rootModuleDefinitionThe module definition used to determine dependencies.
targetDependencyPathThe target dependency folder to copy dependencies to.
Returns
Whether the module dependencies were synchronized correctly or not.
bool unloadExplicit ( moduleId  )

Unload the specified module explicitly.

Parameters
moduleIdThe module Id to unload.
Returns
Whether the module Id was unloaded or not.
bool unloadGroup ( moduleGroup  )

Unload the specified module group.

Parameters
moduleGroupThe module group to unload.
Returns
Whether the module group was unloaded or not.
bool unregisterModule ( moduleId  ,
versionId   
)

Unregister the specified module.

Parameters
moduleIdThe module Id to unregister.
versionIdThe version Id to unregister.
Returns
Whether the module was unregister or not.