![]() |
VR-Forces 4.5 Class Documentation
|
Classes | |
| struct | ScenarioSystemPair |
| Map is by unique id of script. More... | |
Public Types | |
| typedef std::map< std::string, ScenarioSystemPair > | ScriptedTaskMetaDataList |
| typedef std::map< std::string, ScriptedTaskMetaDataList > | ScriptedTasksByDirectory |
Public Member Functions | |
| DtScriptedTaskManager (DtSimManager *) | |
| CTOR. | |
| virtual | ~DtScriptedTaskManager () |
| DTOR. | |
| virtual DtSimManager * | simManager () const |
| virtual void | addAdditionSystemScriptDirectory (const std::string &, bool send=true) |
| Processes this system script directory and loads any meta data from that directory that is a system script into the manager. | |
| virtual void | removeAllSystemScriptedTasksFromDirectory (const std::string &, bool send=true) |
| Removes all scripted tasks that appear in the supplied directory. | |
| virtual void | removeAllScenarioScripts (bool send=true) |
| Removes all scripts that are loaded from the scenario. If send is true sends out a new list. | |
| virtual const ScriptedTasksByDirectory & | scriptedTasksByDirectory () const |
| Returns the list of all scripted tasks by directory. | |
| virtual const ScriptedTaskMetaDataList & | scenarioScripts () const |
| Returns a list of all the scripts assigned to the currently loaded scenario. | |
| virtual const ScriptedTaskMetaDataList & | allScriptsById () const |
| Returns a list of all the scripts from system and scenario lists. | |
| virtual void | sendRequestedScripts (DtU32 responseId=0, const std::vector< std::string > &scriptIds=std::vector< std::string >(), bool sendScripts=false, const std::string &language="") |
| Send out a list of all the scripts or the scripts that match the supplied ids, including script text if script text flag is true. | |
| virtual const DtScriptedTaskMetaData * | lookupScriptById (const std::string &) const |
| Looks up a scripted task data by script id. | |
| virtual void | modifyScenarioScriptedTask (const DtScriptedTaskMetaData &, const std::string &sourceScriptId="", bool send=true, bool keepScriptInMessage=false) |
| If the scripted task does not exist adds it either as a scenario script, else modified the script. | |
| virtual bool | removeScriptedTask (const std::string &id, bool send=true, bool scenarioOnly=true, bool removeSystemScriptFromDisk=false) |
| Removes the current script and sends out a message that the specified script has been removed. | |
| virtual bool | loadScenarioScripts (const DtFilename &, bool send=true) |
| Loads the scenario scripts from the specified file. If send is true sends out all scripts onto the network. | |
| virtual bool | loadScenarioScriptsFromZipFile (const DtFilename &scenarioZipFile, const std::string &, bool send=true) |
| virtual bool | loadScenarioScripts (const std::string &str, bool send=true) |
| Loads the scenario scripts from the given string. | |
| virtual bool | writeScenarioScripts (const DtFilename &) |
| Writes the local scenario scripts to the specified file. | |
| virtual bool | writeScenarioScripts (std::string &) |
| Writes the local scenario scripts to the specified string. | |
| virtual bool | removeScriptById (const std::string &s, bool scenarioOnly=true, bool removeSystemScriptFromDisk=false) |
| Removes script by id and replaces with a like id item from another source if it exists. | |
| virtual void | setSimulationModelSetScriptsDirectory (const std::string &s, bool send=true) |
| Sets the current simulation model set directory. | |
| virtual std::string | simulationModelSetScriptsDirectory () const |
| Gets the current simulation model set directory. | |
| virtual std::vector< std::string > | tasksValidFor (const DtEntityType &, int force) const |
| Returns a list of all scripted task ids that are valid for the given entity type and force (by doctrine). | |
| virtual std::vector< std::string > | setsValidFor (const DtEntityType &, int force) const |
| Returns a list of all scripted set ids that are valid for the given entity type and force (by doctrine). | |
| virtual std::vector< std::string > | reactiveTasksValidFor (const DtEntityType &, int force) const |
| Returns a list of all reactive task ids that are valid for the given entity type and force (by doctrine). | |
| virtual std::vector< std::string > | scriptsValidFor (const DtEntityType &, int scriptType, int force) const |
| Returns a list of all task ids that are valid for the given entity type and script type and force (by doctrine). | |
| virtual void | reportError (const std::string &scriptId, const std::string &error, bool sendReport=true) |
| Assigns error to script. | |
| virtual std::string | findSystemDirectoryFor (const std::string &scriptId) const |
| Given the script id finds the place where it was originally loaded from or the current main system script directory. | |
| virtual void | clearError (const std::string &scriptId) |
| Clears out any existing error. Will not send a message, but, rather clears out error variable. | |
| virtual int | scriptType (const std::string &) const |
| Returns the type of script for the given script id. If no script with that id is present returns -1. | |
| virtual void | merge (DtScriptedTaskManager *mgr, std::vector< DtRwTranslatableStringObject > &) |
| Merges the supplied scripted tasks (scenario level only!) into this manager. | |
| virtual DtScriptResourceManager * | resourceManager (const DtString &type) |
| Returns the central resource manager for scripts of the given type. | |
| virtual DtScriptResourceManagerMap & | resourceManagers () |
| Returns all of the central resource managers for scripts of the given type. | |
| virtual void | addScriptedTaskChangedCallback (DtScriptedTaskManagerCallbackFcn fcn, void *usr) |
| Callback that is invoked whenever a scripted task changes. | |
| virtual void | removeScriptedTaskChangedCallback (DtScriptedTaskManagerCallbackFcn fcn, void *usr) |
| virtual void | addSample (const std::string &scriptId, double sample) |
| Code to support frame rate sampling and reporting for scripted tasks Adds a frame rate sample for the given script id. | |
| virtual void | monitor (const std::string &scriptId, bool) |
| Adds 1 to the number of monitors on the particular script id if true, remove 1 if false. | |
| virtual void | setMonitorTime (double) |
| Sets the time to update the network with frame rates if anything is being monitored. | |
| virtual void | addFrameRateReference (const std::string &) |
| Adds a reference for this script that something is adding to its frame rate averages. | |
| virtual void | removeFrameRateReference (const std::string &) |
| Removes a frame rate reference. If no more references removes averager. | |
| virtual void | setDoctrines (const std::set< std::string > &) |
| virtual void | addDoctrine (const std::string &, bool send=true) |
| virtual bool | removeDoctrine (const std::string &, bool send=true) |
| Return true if scripts have changed. | |
| virtual const std::set < std::string > & | doctrines () const |
| virtual void | clearDoctrines (bool send=true) |
| virtual void | loadDoctrines (const DtFilename &f, bool send=true) |
| virtual void | sendDoctrines () |
| virtual void | sendDoctrineAssignments () |
| virtual void | updateDoctrines (const DtScriptedTaskMetaData &) |
| virtual void | saveDoctrines (const DtFilename &f) const |
| virtual ScriptedTaskMetaDataList | scriptsValidForDoctrine (const std::string &) const |
| virtual std::string | doctrineForForce (int) const |
| virtual void | setDoctrineForForce (const std::string &, int) |
| virtual void | setDoctrineAssignments (const std::map< int, std::string > &) |
| virtual void | setLanguage (const DtString &) |
| Set the language to send out on any request that does not have a language specified. | |
| const DtString & | language () const |
| virtual bool | renameDoctrine (const std::string &from, const std::string &to, bool send=true) |
| Return true if scripts have changed. | |
Protected Types | |
| typedef DtCallbackList< const DtScriptedTaskManagerCallbackInfo & > | DtScriptedTaskChangedCallbackList |
| typedef std::map< int, std::string > | DoctrinesForForce |
Protected Member Functions | |
| virtual void | processRequestScriptedTasks (DtSimMessage *) |
| virtual bool | loadScenarioScripts (std::istream &ifs, bool send) |
| virtual void | processScriptedTaskOperation (DtSimMessage *) |
| virtual void | processDoctrinesOperation (DtSimMessage *) |
| virtual void | makeSystemScript (const std::string &) |
| Moves the specified script from a scenario to system script. | |
| virtual void | modifySystemScript (const std::string &scriptid, const std::string &) |
| Modifies the system script. | |
| virtual void | modifySystemScriptedTask (const DtScriptedTaskMetaData &, const std::string &sourceSciptId="", bool send=true) |
| Modifies the system script meta data. | |
| virtual void | modifyScript (const std::string &id, const std::string &script) |
| Modifies the scenario script. | |
| virtual bool | changeScenarioScriptScriptId (const std::string &from, const std::string &to) |
| Changes the scenario script script id from the original to the new id. Returns true if old id is found. | |
| virtual void | addTaskToTaskFactory (const std::string &id) |
| Adds a task into the task factory by the given script id. | |
| virtual void | removeTaskFromTaskFactory (const std::string &id) |
| Removes a task from the task factory by the given task id. | |
| virtual void | addSetToSetFactory (const std::string &id) |
| Adds a set into the set factory by the given script id. | |
| virtual void | removeSetFromSetFactory (const std::string &id) |
| Removes a set from the set factory by the given task id. | |
| virtual void | signalNewScriptedTask (const std::string &) |
| Invokes callbacks for a new scripted task. | |
| virtual void | loadDefaultScript (DtScriptedTaskMetaData &) |
| Loads the default script into th supplied meta data. | |
| virtual void | tick () |
| virtual void | sendMonitorInformation () |
| Sends frame rate information for all monitored items. | |
| virtual void | updateScenarioScripts (std::map< std::string, DtScriptedTaskMetaData > &, bool send) |
Static Protected Member Functions | |
| static void | requestScriptedTasks (DtSimMessage *, void *) |
| Invoked when a request is made for scripted tasks. | |
| static void | scriptedTaskOperation (DtSimMessage *, void *) |
| Called in response to a scripted task operation request. | |
| static void | doctrinesOperation (DtSimMessage *, void *) |
| Called in response to a doctrines operation request. | |
| static void | tickCallback (void *) |
| Tick callback. | |
Protected Attributes | |
| DtSimManager * | mySimManager |
| std::string | mySimulationModelSetScriptsDirectory |
| ScriptedTasksByDirectory | mySystemScriptedTasks |
| ScriptedTaskMetaDataList | myScenarioScripts |
| ScriptedTaskMetaDataList | myAllScriptsById |
| std::map< std::string, ScriptedTaskMetaDataList > | myMutableScriptsByDoctrine |
| DtScriptedTaskChangedCallbackList | myScriptedTaskChangedCallbackList |
| double | myMonitorTime |
| double | myLastMonitorSentTime |
| int | myMonitoringAll |
| int | myMonitoringScripts |
| bool | mySendMonitorMessage |
| std::set< std::string > | myDoctrines |
| DtFilename | myDoctrinesFile |
| DoctrinesForForce | myDoctrinesForForce |
| std::vector< std::string > | myScriptPaths |
| DtString | myLastLanguageRequested |
| DtScriptResourceManagerMap | myScriptResourceManagers |
Private Member Functions | |
| DtScriptedTaskManager (const DtScriptedTaskManager &orig) | |
| copy constructor | |
| DtScriptedTaskManager & | operator= (const DtScriptedTaskManager &orig) |
| assignment operator | |
| typedef std::map<std::string, ScenarioSystemPair> DtScriptedTaskManager::ScriptedTaskMetaDataList |
| typedef std::map<std::string, ScriptedTaskMetaDataList> DtScriptedTaskManager::ScriptedTasksByDirectory |
|
protected |
|
protected |
| DtScriptedTaskManager::DtScriptedTaskManager | ( | DtSimManager * | ) |
CTOR.
|
virtual |
DTOR.
|
private |
copy constructor
|
private |
assignment operator
|
virtual |
|
virtual |
Processes this system script directory and loads any meta data from that directory that is a system script into the manager.
Will then send out a message with all scripted tasks. If send is true sends out a message with newly loaded scripts
|
virtual |
Removes all scripted tasks that appear in the supplied directory.
If send is true sends out message with new list of scripts
|
virtual |
Removes all scripts that are loaded from the scenario. If send is true sends out a new list.
|
virtual |
Returns the list of all scripted tasks by directory.
|
virtual |
Returns a list of all the scripts assigned to the currently loaded scenario.
|
virtual |
Returns a list of all the scripts from system and scenario lists.
|
virtual |
Send out a list of all the scripts or the scripts that match the supplied ids, including script text if script text flag is true.
|
virtual |
Looks up a scripted task data by script id.
|
virtual |
If the scripted task does not exist adds it either as a scenario script, else modified the script.
If the script moves from being a scenario script to a system script will write out new script files and update internal structures appropriately. If send is true sends out update notification message
If sourceScriptId is non-null, and the meta data for that script exists, copies the script source into the scenario script from the source script
|
virtual |
Removes the current script and sends out a message that the specified script has been removed.
If send is true sends out notification of removal. If scenarioOnly is true only removes scenario script. If false removes both scenario and system script (if tied to the same id)
|
virtual |
Loads the scenario scripts from the specified file. If send is true sends out all scripts onto the network.
|
virtual |
|
virtual |
Loads the scenario scripts from the given string.
|
virtual |
Writes the local scenario scripts to the specified file.
|
virtual |
Writes the local scenario scripts to the specified string.
|
virtual |
Removes script by id and replaces with a like id item from another source if it exists.
If scenarioOnly is true only removes scenario script. If false removes both scenario and system script (if tied to the same id)
|
virtual |
Sets the current simulation model set directory.
This will be used as the directory to save system scripts to
|
virtual |
Gets the current simulation model set directory.
|
virtual |
Returns a list of all scripted task ids that are valid for the given entity type and force (by doctrine).
|
virtual |
Returns a list of all scripted set ids that are valid for the given entity type and force (by doctrine).
|
virtual |
Returns a list of all reactive task ids that are valid for the given entity type and force (by doctrine).
|
virtual |
Returns a list of all task ids that are valid for the given entity type and script type and force (by doctrine).
|
virtual |
Callback that is invoked whenever a scripted task changes.
|
virtual |
|
virtual |
Assigns error to script.
If the current script error is not the one being assigned will send out a message detailing the new error
|
virtual |
Given the script id finds the place where it was originally loaded from or the current main system script directory.
|
virtual |
Clears out any existing error. Will not send a message, but, rather clears out error variable.
|
virtual |
Code to support frame rate sampling and reporting for scripted tasks Adds a frame rate sample for the given script id.
|
virtual |
Adds 1 to the number of monitors on the particular script id if true, remove 1 if false.
Any item that is monitored will have a frame rate update sent for it
|
virtual |
Sets the time to update the network with frame rates if anything is being monitored.
Default is every 2 seconds
|
virtual |
Adds a reference for this script that something is adding to its frame rate averages.
When no items are referencing this script will not be used in averaging and not sent on an update
|
virtual |
Removes a frame rate reference. If no more references removes averager.
|
virtual |
Returns the type of script for the given script id. If no script with that id is present returns -1.
|
virtual |
Keeps list of doctrines categories that this script is part of
|
virtual |
|
virtual |
Return true if scripts have changed.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Set the language to send out on any request that does not have a language specified.
| const DtString& DtScriptedTaskManager::language | ( | ) | const |
|
virtual |
Return true if scripts have changed.
|
virtual |
Merges the supplied scripted tasks (scenario level only!) into this manager.
Will not copy over scripted task ids that there are already scenario scripted tasks for, but, will supply a warning in the supplied vector if the ids are the same but the variables or scripts are different
|
virtual |
Returns the central resource manager for scripts of the given type.
|
virtual |
Returns all of the central resource managers for scripts of the given type.
|
staticprotected |
Invoked when a request is made for scripted tasks.
|
protectedvirtual |
|
protectedvirtual |
|
staticprotected |
Called in response to a scripted task operation request.
|
protectedvirtual |
|
staticprotected |
Called in response to a doctrines operation request.
|
protectedvirtual |
|
protectedvirtual |
Moves the specified script from a scenario to system script.
|
protectedvirtual |
Modifies the system script.
|
protectedvirtual |
Modifies the system script meta data.
|
protectedvirtual |
Modifies the scenario script.
|
protectedvirtual |
Changes the scenario script script id from the original to the new id. Returns true if old id is found.
|
protectedvirtual |
Adds a task into the task factory by the given script id.
|
protectedvirtual |
Removes a task from the task factory by the given task id.
|
protectedvirtual |
Adds a set into the set factory by the given script id.
|
protectedvirtual |
Removes a set from the set factory by the given task id.
|
protectedvirtual |
Invokes callbacks for a new scripted task.
|
protectedvirtual |
Loads the default script into th supplied meta data.
|
staticprotected |
Tick callback.
Check to see if there are any scripts being monitored for frame rate, and, if so, send them out if it is time
|
protectedvirtual |
|
protectedvirtual |
Sends frame rate information for all monitored items.
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |