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

#include <moduleManager_ScriptBinding.h>

Inherits SimObject.

Public Member Functions

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

Member Function Documentation

◆ addListener()

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.

◆ canMergeModules()

Boolean 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.

◆ clearDatabase()

void clearDatabase ( )

Removes everything from the module database

Returns
No return value

◆ copyModule()

String copyModule ( sourceModuleDefinition  ,
sourceModuleVersion  ,
targetModuleId  ,
targetPath  ,
useVersionPathing?   
)

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

Parameters
sourceModuleDefinitionThe module definition to copy.
sourceModuleVersionThe module version 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.

◆ findModule()

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.

◆ findModules()

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.

◆ findModuleTypes()

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.

◆ isModuleLoaded()

Boolean isModuleLoaded ( moduleId  )

Checks to see if a module is loaded or not.

Parameters
moduleIdThe module Id to check.
Returns
True if the module is loaded. False otherwise.

◆ isModuleMergeAvailable()

Boolean isModuleMergeAvailable ( )

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

Returns
Whether a module merge definition file is available or not.

◆ loadExplicit()

Boolean 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.

◆ loadGroup()

Boolean loadGroup ( moduleGroup  )

Load the specified module group.

Parameters
moduleGroupThe module group to load.
Returns
Whether the module group was loaded or not.

◆ mergeModules()

Boolean 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.

◆ removeListener()

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.

◆ scanModules()

Boolean 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.

◆ setModuleExtension()

Boolean 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.

◆ synchronizeDependencies()

Boolean 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.

◆ unloadExplicit()

Boolean unloadExplicit ( moduleId  )

Unload the specified module explicitly.

Parameters
moduleIdThe module Id to unload.
Returns
Whether the module Id was unloaded or not.

◆ unloadGroup()

Boolean unloadGroup ( moduleGroup  )

Unload the specified module group.

Parameters
moduleGroupThe module group to unload.
Returns
Whether the module group was unloaded or not.

◆ unregisterModule()

Boolean 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.