VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtSimTaskManager Class Reference

Class Description: DtSimTaskManager manages the bookkeeping associated with starting, completing, clearing, and skipping tasks.

Inheritance diagram for DtSimTaskManager:
Inheritance graph
[legend]

Classes

struct  BackgroundProcessInformation
 
struct  DelayTaskExecution
 

Public Types

typedef DtCallbackList< const
DtTaskMessage & > 
DtTaskCompleteCallbackList
 
typedef std::set
< DtSimTaskMessageType
SupportingTasks
 
typedef std::map< int,
SupportingTasks
AvailableSupportingTasks
 
- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 

Public Member Functions

 DtSimTaskManager (const DtString &name, DtLocalObject *vrfObject, const DtString &naame="sim-task-manager", DtReaderWriterRegistry *parentRegistry=nullptr)
 
virtual ~DtSimTaskManager () override
 
virtual bool init ()
 
virtual void tick ()
 
virtual void addTaskProcessor (const DtSimTaskMessageType &taskType, DtTaskControllerComponent *taskController)
 
virtual void removeTaskProcessor (const DtSimTaskMessageType &taskType, DtTaskControllerComponent *taskController)
 
virtual void removeAllReferencesToController (DtTaskControllerComponent *taskController)
 
virtual std::vector
< DtSimTaskMessageType
capableTaskIds () const
 
virtual AvailableSupportingTasks supportingTasks () const
 
virtual SupportingTasks supportingTasks (int) const
 
virtual void addBackgroundProcess (const DtString &scriptId, int backgroundProcessId, const DtString &controllerName)
 
virtual void removeBackgroundProcess (const DtString &scriptId)
 
virtual void addScriptedSet (const DtString &scriptId, int backgroundProcessId, const DtString &controllerName)
 
virtual void removeScriptedSet (const DtString &scriptId)
 
virtual bool transitionTask (DtTaskMessage &taskMsg, DtSimTaskStatePtr taskState)
 
virtual int suspendTasks (std::set< DtString > actionCategories)
 
virtual int suspendAllTopLevelTasks (bool suspendedFromTrigger=false)
 
virtual int suspendSubtask (int taskId, int subtaskId)
 
virtual DtSuspendedTaskInfosuspendTask (int taskId)
 
virtual bool resumeTasks (int suspendId)
 
virtual bool taskActive (int taskId) const
 
virtual void registerInterfaceMessageCallbacks ()
 
virtual void registerRadioMessageCallbacks ()
 
virtual void taskNotify (const DtSimTask &task, const DtSimComponent &notifier, bool clearConflictingTopLevelTasks=true)
 
virtual void skipTask (bool fromSuperior=false)
 
virtual void taskComplete (const DtVrfObjectMessage &radioMsg, bool success, bool affectsIndependentTaskStatus=true)
 
virtual void sendTaskCompleted (const DtTaskMessage &taskMsg, bool success)
 
void awaitingTask (int taskIdJustCompleted=-1)
 
virtual void setTaskedBySuperior ()
 
virtual bool requestTaskNeeded () const
 
virtual void setRequestTaskNeeded (bool requestTaskNeeded)
 
virtual bool independentlyTasked () const
 
virtual void setIndependentlyTasked (bool independentlyTasked)
 
virtual bool isPseudoAggregate () const
 
virtual DtString type () const
 
virtual void addOnTaskNotifyCallback (DtOnTaskNotifyCallbackFcn fcn, void *userData)
 
virtual void removeOnTaskNotifyCallback (DtOnTaskNotifyCallbackFcn fcn, void *userData)
 
virtual void clearSubtask (int subtaskId)
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const
 
virtual bool hasTopLevelTask () const
 
virtual bool taskTypesAreExclusive (const DtSimTaskMessageType &taskType1, const DtSimTaskMessageType &taskType2) const
 
virtual bool taskTypesAreExclusive (const std::list< DtString > &task1Categories, const DtSimTaskMessageType &taskType2) const
 
virtual bool canExecuteTask (const DtSimTaskMessageType &) const
 
virtual void clearTaskByType (const DtSimTaskMessageType &taskType)
 
virtual void updateTaskInfo ()
 
virtual bool canBeExecutedConcurrently (const DtSimTaskMessageType &taskType) const
 
virtual
DtScriptReactiveTaskController
reactiveTaskController ()
 
virtual void setReactiveTaskController (DtScriptReactiveTaskController *reactiveTaskController)
 
virtual void setTaskVisualizationsActive (bool)
 
virtual bool hasTopLevelTasks () const
 
virtual void addClutterTask (const DtSimTaskMessageType &taskType)
 
virtual bool taskVisualizationsEnabled (bool includeUnTimedOut) const
 
virtual bool taskVisualizationsActivated () const
 
virtual void taskCancelled (int taskId)
 
virtual bool startTaskExecution (const DtTaskMessage &taskMsg, DtSimTaskStatePtr taskState, bool taskNotify, bool clearConflictingTopLevelTasks=true, bool doNotAbandonPlan=false)
 
virtual void addSupportingTask (int, const DtSimTaskMessageType &)
 
virtual void addSupportingTasks (int, const SupportingTasks &)
 
virtual void removeSupportingTask (int, const DtSimTaskMessageType &)
 
virtual void removeSupportingTasks (int)
 
virtual bool executeTask (DtTaskMessage &taskMsg, bool clearConflictingTopLevelTasks=true, bool doNotAbandonPlan=false)
 
virtual bool executeTask (DtTaskMessage &taskMsg, DtSimTaskStatePtr taskState, bool clearConflictingTopLevelTasks=true, bool doNotAbandonPlan=false)
 
virtual void addTaskCompleteCallback (DtTaskCompleteCallbackList::DtCallbackFunctionType fcn, void *usr)
 
virtual void removeTaskCompleteCallback (DtTaskCompleteCallbackList::DtCallbackFunctionType fcn, void *usr)
 
virtual void setSendSkipTaskMessages (bool sendSkipTaskMessages)
 
virtual bool sendSkipTaskMessages ()
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs) const
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Static Public Member Functions

static void taskedBySuperiorRequestCallback (DtSimMessage *msg, void *usrData)
 
static void skipTaskCallback (DtSimMessage *msg, void *usr)
 
static void clearTaskCallback (DtSimMessage *msg, void *usr)
 
static void taskVisualizationRequestCallback (DtSimMessage *msg, void *usr)
 
static DtSimTaskManagercreator (const DtString &name, DtLocalObject *vrfObject)
 
static DtSimTaskManagerFactoryfactory ()
 
static void setFactory (DtSimTaskManagerFactory *factory)
 
static void addSimTaskManagerCreatorFcn (const DtString &type, DtSimTaskManagerCreatorFcn fcn)
 
static DtSimTaskManagercreateTaskManager (const DtString &name, const DtString &type, DtLocalObject *vrfObject)
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 

Protected Types

typedef std::multimap
< DtSimTaskMessageType,
DtTaskControllerComponent * > 
DtTaskProcessorMap
 
typedef std::map< DtString,
BackgroundProcessInformation
BackgroundProcesses
 
typedef std::vector
< DelayTaskExecution
DelayedTaskExecution
 

Protected Member Functions

virtual void postGetSelf () override
 
virtual void processClearTask (DtSimMessage *msg)
 
virtual void processTaskVisualizationRequest (DtSimMessage *msg)
 
virtual void resumeTaskTree (DtSuspendedTaskInfo *suspendedTaskInfo, DtTaskControllerComponent *parentTaskCompnent=0)
 
virtual bool clearAllTopLevelTasks ()
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &taskType)
 
virtual void onTaskNotify (const DtSimTask &task, const DtSimComponent &notifier)
 
void processSubordinateRemoved (const DtUUID &info)
 
virtual void processSimObjectDeleted (const DtSimObject *)
 
virtual void processTaskMessage (DtSimMessage *msg)
 
virtual DtTaskControllerComponentfindControllerForTask (const DtTaskMessage &taskMessage)
 
virtual std::vector
< DtSimTaskMessageType
conflictingTaskTypes (const DtSimTaskMessageType &testTaskType) const
 
virtual std::list< DtStringtaskGroupsForTask (const DtSimTaskMessageType &taskType) const
 
virtual void processRequestCurrentTasks (const DtVrfObjectMessage *msg)
 
virtual void processUnsubscribeCurrentTasks (const DtVrfObjectMessage *msg)
 
virtual void sendCurrentTasks ()
 
virtual void addSubtasksToCurrentTaskMessage (const DtSuspendedTaskInfoList &subtaskList, int parentTaskId, int status, DtCurrentTasksAdminContent &adminContent)
 
virtual void updateTaskVisualizationList (bool includeTimeout=true)
 
virtual void stopCurrentTaskVisualizations ()
 
virtual void processClearTaskByTrackingNumber (const DtVrfObjectMessage *msg)
 
virtual void processTaskEvent (const makVrfEvents::DtEvent &)
 
virtual void addDefaultClutterTaskTypes ()
 
virtual void registerSetDataMessageCallbacks ()
 
virtual void unregisterSetDataMessageCallbacks ()
 
virtual void registerTaskMessageCallbacks ()
 
virtual void unregisterTaskMessageCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Static Protected Member Functions

static void taskMessageCallback (DtSimMessage *msg, void *usr)
 
static void requestCurrentTasksCallback (const DtVrfObjectMessage *msg, void *usr)
 
static void unsubscribeCurrentTasksCallback (const DtVrfObjectMessage *msg, void *usr)
 
static void clearTaskByTrackingNumberCallback (const DtVrfObjectMessage *msg, void *usr)
 

Protected Attributes

DtLocalObjectmyLocalObject
 
std::vector
< DtOnTaskNotifyCallbackInfo
myOnTaskNotifyCallbacks
 
DtTaskProcessorMap myTaskProcessorMap
 
bool mySendSkipTaskMessages
 
DtRwInt myNumberOfTaskSubscriptions
 
bool mySendTasksNextTick
 
DtRwNLengthStringVector myTaskVisualizationRequestors
 
DtTime myTaskVisualizationRemovalTime
 
DtTaskCompleteCallbackList myTaskCompleteCallbackList
 
DtScriptReactiveTaskControllermyReactiveTaskController
 
bool myResumingTasks
 
AvailableSupportingTasks myAvailableSupportingTasks
 
BackgroundProcesses myBackgroundProcesses
 
BackgroundProcesses myScriptedSets
 
bool myTaskVisualizationsActive
 
bool myFirstTick
 
boost::signals2::scoped_connection mySimObjectDeletedConnection
 
boost::signals2::scoped_connection mySubordinateRemovedConnection
 
DelayedTaskExecution myDelayedTaskExecution
 
std::vector< DtSimTaskMessageTypemyClutterTasks
 
boost::signals2::connection myEventSignalConnection
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Static Protected Attributes

static DtSimTaskManagerFactorytheFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Private Member Functions

 DtSimTaskManager ()
 
 DtSimTaskManager (const DtSimTaskManager &orig)
 
const DtSimTaskManageroperator= (const DtSimTaskManager &orig)
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtSimTaskManager::DtSimTaskManager ( )
private

Not implemented.

DtSimTaskManager::DtSimTaskManager ( const DtSimTaskManager orig)
private

copy constructor

DtSimTaskManager::DtSimTaskManager ( const DtString name,
DtLocalObject vrfObject,
const DtString naame = "sim-task-manager",
DtReaderWriterRegistry parentRegistry = nullptr 
)

constructor

virtual DtSimTaskManager::~DtSimTaskManager ( )
overridevirtual

destructor

Member Function Documentation

const DtSimTaskManager& DtSimTaskManager::operator= ( const DtSimTaskManager orig)
private

assignment operator

virtual bool DtSimTaskManager::init ( )
virtual

Calls base class init(), and registerRadioMessageCallbacks().

virtual void DtSimTaskManager::tick ( )
virtual

Sends awaitingTask message to plan engine if needed.

virtual void DtSimTaskManager::addTaskProcessor ( const DtSimTaskMessageType taskType,
DtTaskControllerComponent taskController 
)
virtual

Registers a task controller as a processor for a specific task type. This controller will have its beginProcessingTask() method called whenever a task of this type is executed by this task manager.

Note
As of VRF 5.1, multiple controllers can register for the same task type. See DtTaskControllerComponent::acceptTask() for details on which controller will be selected to execute a task when multiple are registered.
virtual void DtSimTaskManager::removeTaskProcessor ( const DtSimTaskMessageType taskType,
DtTaskControllerComponent taskController 
)
virtual

Removes a task controller that has previously registered for as a task processor for a specific task type.

virtual void DtSimTaskManager::removeAllReferencesToController ( DtTaskControllerComponent taskController)
virtual

Removes all task processors that are registered by this controller.

virtual std::vector<DtSimTaskMessageType> DtSimTaskManager::capableTaskIds ( ) const
virtual
Returns
A vector of all the task types that have been registered with this task manager. These are all the task types that this entity is capable of carrying out.
virtual AvailableSupportingTasks DtSimTaskManager::supportingTasks ( ) const
virtual
Returns
A map (by type) of additional tasks this entity is capable of performing that cannot be issued directly by the user (reactive tasks, background tasks)
virtual SupportingTasks DtSimTaskManager::supportingTasks ( int  ) const
virtual
Returns
A list of available supporting tasks by type
virtual void DtSimTaskManager::addSupportingTask ( int  ,
const DtSimTaskMessageType  
)
virtual

Adds/remove supporting tasks. Types are available in scriptedTaskMetaData.h.

virtual void DtSimTaskManager::addSupportingTasks ( int  ,
const SupportingTasks  
)
virtual

Adds/remove supporting tasks. Types are available in scriptedTaskMetaData.h.

virtual void DtSimTaskManager::removeSupportingTask ( int  ,
const DtSimTaskMessageType  
)
virtual

Adds/remove supporting tasks. Types are available in scriptedTaskMetaData.h.

virtual void DtSimTaskManager::removeSupportingTasks ( int  )
virtual

Adds/remove supporting tasks. Types are available in scriptedTaskMetaData.h.

virtual bool DtSimTaskManager::executeTask ( DtTaskMessage taskMsg,
bool  clearConflictingTopLevelTasks = true,
bool  doNotAbandonPlan = false 
)
virtual

Starts the execution of this task. This is the main entry point of an entity to start executing any task or subtask. The task will be passed off to any task controller that has registered to process the particular type of this task. Fills in the taskId of the task message with the newly assigned ID of the task.

Parameters
taskStateIf present, used to convey information about the current execution state of the task (may be at some intermediate point in execution).
clearConflictingTopLevelTasksNormally executing a new task will clear any top level tasks that are conflicting. If, however, you have previously suspended the conflicting tasks, you may not want to clear them out.
Returns
True if the task was successfully started.
virtual bool DtSimTaskManager::executeTask ( DtTaskMessage taskMsg,
DtSimTaskStatePtr  taskState,
bool  clearConflictingTopLevelTasks = true,
bool  doNotAbandonPlan = false 
)
virtual

Starts the execution of this task. This is the main entry point of an entity to start executing any task or subtask. The task will be passed off to any task controller that has registered to process the particular type of this task. Fills in the taskId of the task message with the newly assigned ID of the task.

Parameters
taskStateIf present, used to convey information about the current execution state of the task (may be at some intermediate point in execution).
clearConflictingTopLevelTasksNormally executing a new task will clear any top level tasks that are conflicting. If, however, you have previously suspended the conflicting tasks, you may not want to clear them out.
Returns
True if the task was successfully started.
virtual void DtSimTaskManager::addBackgroundProcess ( const DtString scriptId,
int  backgroundProcessId,
const DtString controllerName 
)
virtual

Used for reporting curent tasks only. Keeps track of all currently executing background processes.

virtual void DtSimTaskManager::removeBackgroundProcess ( const DtString scriptId)
virtual
virtual void DtSimTaskManager::addScriptedSet ( const DtString scriptId,
int  backgroundProcessId,
const DtString controllerName 
)
virtual

Used for reporting current tasks only. Keeps track of scripted sets that are currently running.

virtual void DtSimTaskManager::removeScriptedSet ( const DtString scriptId)
virtual
virtual bool DtSimTaskManager::transitionTask ( DtTaskMessage taskMsg,
DtSimTaskStatePtr  taskState 
)
virtual

Transitions the task from controller state to another. Basically reissues the task with the same id to the same controller, using saved state. Currently used by the aggregate model resolution controller when transitioning from aggregated <-> dissaggregated states. When transitioning the task, if there is a plan in progress that is executing this task the plan will not be abandoned. Also, the newly issued task will maintain the same task id as the original task.

virtual int DtSimTaskManager::suspendTasks ( std::set< DtString actionCategories)
virtual

Function to suspend. Suspends all top level tasks that conflict with any of the listed actionCategories.

Returns
A suspend ID, which can be passed back to resumeTasks() to resume this set of suspended tasks.
virtual int DtSimTaskManager::suspendAllTopLevelTasks ( bool  suspendedFromTrigger = false)
virtual

Suspends all top level tasks.

Returns
A suspend ID, which can be passed back to resumeTasks() to resume this set of suspended tasks.
virtual int DtSimTaskManager::suspendSubtask ( int  taskId,
int  subtaskId 
)
virtual

Suspends a specific subtask.

Returns
A suspend ID, which can be passed back to resumeTasks() to resume this set of suspended tasks.
virtual DtSuspendedTaskInfo* DtSimTaskManager::suspendTask ( int  taskId)
virtual

Suspends a specific task, and returns the suspend info.

Note
This function should be used internally only. It does not add the suspend info to the task list, and is used by other functions which do this.
virtual bool DtSimTaskManager::resumeTasks ( int  suspendId)
virtual

Takes a suspend ID generated from a call to suspend, and resumes any tasks that were suspended with this ID.

virtual void DtSimTaskManager::addTaskCompleteCallback ( DtTaskCompleteCallbackList::DtCallbackFunctionType  fcn,
void *  usr 
)
virtual

Callbacks that are invoked any time a task is complete.

virtual void DtSimTaskManager::removeTaskCompleteCallback ( DtTaskCompleteCallbackList::DtCallbackFunctionType  fcn,
void *  usr 
)
virtual

Callbacks that are invoked any time a task is complete.

virtual bool DtSimTaskManager::taskActive ( int  taskId) const
virtual
Returns
True if a task with the specified task ID is currently active (executing) in the task manager.
virtual void DtSimTaskManager::registerInterfaceMessageCallbacks ( )
virtual

Registers a callback for Skip Task messages.

virtual void DtSimTaskManager::registerRadioMessageCallbacks ( )
virtual

Register for TaskedBySuperior and DtClearTask radio messages.

virtual void DtSimTaskManager::taskNotify ( const DtSimTask task,
const DtSimComponent notifier,
bool  clearConflictingTopLevelTasks = true 
)
virtual

Called by controller component when task is received. Calls clearTask() on the currently tasked controller that has a top-level (non-subtask) task.

virtual void DtSimTaskManager::skipTask ( bool  fromSuperior = false)
virtual

Called by controller component when task is received. Calls clearTask() on the currently tasked controller that has a top-level (non-subtask) task. If fromSuperior is false, calls sendAwaitingTask().

virtual void DtSimTaskManager::taskComplete ( const DtVrfObjectMessage radioMsg,
bool  success,
bool  affectsIndependentTaskStatus = true 
)
virtual

Called by controller component when task is complete.

Parameters
successindicates whether the task was successfully completed or failed. There are some tasks (such as reactive tasks) when they complete should not affect the independently tasked flag. The las parameter, if set to true, will do just that
virtual void DtSimTaskManager::sendTaskCompleted ( const DtTaskMessage taskMsg,
bool  success 
)
virtual

send a task complete report message to the originator of a task (as indicated by the sender field of the task message sent)

void DtSimTaskManager::awaitingTask ( int  taskIdJustCompleted = -1)

Calls awaitingTask on the DtPlan via the DtVrfObjectPlanManager Specify the task ID of the task that just completed, if available.

virtual void DtSimTaskManager::setTaskedBySuperior ( )
virtual

Equivalent to localState()->setIndependentlyTasked(false) for local entities, but deriving pseudo aggregates do more...

virtual bool DtSimTaskManager::requestTaskNeeded ( ) const
virtual

Will we ask the plan manager for a task this tick.

virtual void DtSimTaskManager::setRequestTaskNeeded ( bool  requestTaskNeeded)
virtual

Used within the task manager.

virtual bool DtSimTaskManager::independentlyTasked ( ) const
virtual

Are we tasked independently (plan or user) or by a superior (pseudo-aggregate) entity?

virtual void DtSimTaskManager::setIndependentlyTasked ( bool  independentlyTasked)
virtual

Sets independentlyTasked flag. Normally done when a task is received, or a setTaskedBySuperior message is received.

virtual bool DtSimTaskManager::isPseudoAggregate ( ) const
inlinevirtual

Indicates whether or not the type of task manager created supports pseudo-aggregates.

virtual DtString DtSimTaskManager::type ( ) const
virtual

Returns the type of task manager object. Strings are defined in taskMgrTypes.h.

virtual void DtSimTaskManager::setSendSkipTaskMessages ( bool  sendSkipTaskMessages)
virtual

Accessor/mutator for mySendSkipTaskMessages. This should only be called by DtCgf::rewind.

virtual bool DtSimTaskManager::sendSkipTaskMessages ( )
virtual

Accessor/mutator for mySendSkipTaskMessages. This should only be called by DtCgf::rewind.

virtual void DtSimTaskManager::addOnTaskNotifyCallback ( DtOnTaskNotifyCallbackFcn  fcn,
void *  userData 
)
virtual

Registers callback to invoked after taskNotify() is called (at the point when an entity starts executing a new task).

virtual void DtSimTaskManager::removeOnTaskNotifyCallback ( DtOnTaskNotifyCallbackFcn  fcn,
void *  userData 
)
virtual

Removes callback to invoked after taskNotify() is called (at the point when an entity starts executing a new task).

virtual void DtSimTaskManager::clearSubtask ( int  subtaskId)
virtual

Locates DtTaskControllerComponent currently executing a task with the given subtaskId, and calls clearTask() on that component.

virtual DtTaskWithTaskStateListPtr DtSimTaskManager::topLevelTasks ( ) const
virtual
Returns
List of top-level tasks currently being executed by the entity.
virtual bool DtSimTaskManager::hasTopLevelTask ( ) const
virtual
Returns
true if there is an available top Level Task
virtual bool DtSimTaskManager::taskTypesAreExclusive ( const DtSimTaskMessageType taskType1,
const DtSimTaskMessageType taskType2 
) const
virtual
Returns
True if and only if the two specified tasks types are designated as mutually exclusive task types, based on the task execution rules for the entity.
virtual bool DtSimTaskManager::taskTypesAreExclusive ( const std::list< DtString > &  task1Categories,
const DtSimTaskMessageType taskType2 
) const
virtual
Returns
True if and only if the two specified tasks types are designated as mutually exclusive task types, based on the task execution rules for the entity. This version takes the list of task categories for taskType1 instead of the task type itself.
virtual bool DtSimTaskManager::canExecuteTask ( const DtSimTaskMessageType ) const
virtual
Returns
True if this object will support the given task
virtual void DtSimTaskManager::clearTaskByType ( const DtSimTaskMessageType taskType)
virtual
virtual void DtSimTaskManager::updateTaskInfo ( )
virtual
virtual bool DtSimTaskManager::canBeExecutedConcurrently ( const DtSimTaskMessageType taskType) const
virtual
Returns
Whether this task can be executed concurrently with another copy of itself.
virtual DtScriptReactiveTaskController* DtSimTaskManager::reactiveTaskController ( )
virtual
Returns
A pointer to the entity's reactive task controller.
Note
This pointer may be null, which is valid for entities that do not have a reactive task controller.
virtual void DtSimTaskManager::setReactiveTaskController ( DtScriptReactiveTaskController reactiveTaskController)
virtual
static void DtSimTaskManager::taskedBySuperiorRequestCallback ( DtSimMessage msg,
void *  usrData 
)
static

The manager will register a callback with the radio's msg executive requesting notification of Tasked By Superior Set Data Requests.

static void DtSimTaskManager::skipTaskCallback ( DtSimMessage msg,
void *  usr 
)
static

The manager will register a callback with its simManager's msg executive requesting notification of Skip Task Interface Requests.

static void DtSimTaskManager::clearTaskCallback ( DtSimMessage msg,
void *  usr 
)
static

Callback function for handling DtClearTask messages. Calls processClearTask to process the message.

static void DtSimTaskManager::taskVisualizationRequestCallback ( DtSimMessage msg,
void *  usr 
)
static

Callback function for handling task visualization request messages. Calls processTaskVisualizationRequest.

virtual void DtSimTaskManager::setTaskVisualizationsActive ( bool  )
virtual

Set to false to turn off task visualizations for this object.

static DtSimTaskManager* DtSimTaskManager::creator ( const DtString name,
DtLocalObject vrfObject 
)
static
static DtSimTaskManagerFactory* DtSimTaskManager::factory ( )
static

A DtSimEntityFactory is allocated by the DtSimCreator, and this pointer is set. The DtSimCreator deletes this pointer when it is deleted. This is done this way because we don't allow static initialization.

static void DtSimTaskManager::setFactory ( DtSimTaskManagerFactory factory)
static
static void DtSimTaskManager::addSimTaskManagerCreatorFcn ( const DtString type,
DtSimTaskManagerCreatorFcn  fcn 
)
static
static DtSimTaskManager* DtSimTaskManager::createTaskManager ( const DtString name,
const DtString type,
DtLocalObject vrfObject 
)
static

Creates a new task manager, using the factory.

virtual bool DtSimTaskManager::hasTopLevelTasks ( ) const
virtual

Returns true if there are top level tasks.

virtual void DtSimTaskManager::addClutterTask ( const DtSimTaskMessageType taskType)
virtual

Adds a task that can be used for clutter entities.

virtual bool DtSimTaskManager::taskVisualizationsEnabled ( bool  includeUnTimedOut) const
virtual

Returns true if task visualizations are enabled for this object.

virtual bool DtSimTaskManager::taskVisualizationsActivated ( ) const
virtual

Returns true if any of this object's components have task visualizations activated.

virtual void DtSimTaskManager::taskCancelled ( int  taskId)
virtual

Called when a task is cancelled as part of clearing a task. If this task is part of a plan will move to the next statement in the plan.

virtual bool DtSimTaskManager::startTaskExecution ( const DtTaskMessage taskMsg,
DtSimTaskStatePtr  taskState,
bool  taskNotify,
bool  clearConflictingTopLevelTasks = true,
bool  doNotAbandonPlan = false 
)
virtual

Used by executeTask() and other similar methods to start the execution of a task.

virtual void DtSimTaskManager::postGetSelf ( )
overrideprotectedvirtual

For ownership transfer, archive/dearchive the current state.

Reimplemented from DtReaderWriter.

virtual void DtSimTaskManager::processClearTask ( DtSimMessage msg)
protectedvirtual

Finds task controller currently tasked with task of type specified in clear task message and calls its clearTask() method. task type, calls clearTask().

virtual void DtSimTaskManager::processTaskVisualizationRequest ( DtSimMessage msg)
protectedvirtual

Creates or destroys task visualization objects.

virtual void DtSimTaskManager::resumeTaskTree ( DtSuspendedTaskInfo suspendedTaskInfo,
DtTaskControllerComponent parentTaskCompnent = 0 
)
protectedvirtual
virtual bool DtSimTaskManager::clearAllTopLevelTasks ( )
protectedvirtual

Cancels all top level tasks currently executing on the entity.

Returns
True if any tasks were cleared.
virtual void DtSimTaskManager::clearConflictingTopLevelTasks ( const DtSimTaskMessageType taskType)
protectedvirtual

Cancels any top level tasks that are running on the entity if they conflict with the specified task type. taskTypesAreExclusive() is used to determine if they conflict.

virtual void DtSimTaskManager::onTaskNotify ( const DtSimTask task,
const DtSimComponent notifier 
)
protectedvirtual

Hook function called at the end of taskNotify(). Invokes any onTaskNotify() callback functions that are registered with the task manager.

void DtSimTaskManager::processSubordinateRemoved ( const DtUUID info)
protected

If we are currently tasked and former subordinate is not independently tasked, sends a skip task message to this former subordinate. The subordinate should no longer be participating in any tasks currently being executed by this entity.

virtual void DtSimTaskManager::processSimObjectDeleted ( const DtSimObject )
protectedvirtual

Called in response to the owner being deleted.

static void DtSimTaskManager::taskMessageCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected

Callback resisted with the local radio for all task messages. Calls processTaskMessage().

virtual void DtSimTaskManager::processTaskMessage ( DtSimMessage msg)
protectedvirtual

Calls executeTask().

virtual DtTaskControllerComponent* DtSimTaskManager::findControllerForTask ( const DtTaskMessage taskMessage)
protectedvirtual

Finds a registered controller to execute the specified task, using the controllers registered in myTaskProcessorMap.

virtual std::vector<DtSimTaskMessageType> DtSimTaskManager::conflictingTaskTypes ( const DtSimTaskMessageType testTaskType) const
protectedvirtual
Returns
A vector containing all the tasks that this entity is capable of (from capableTaskIds()), that are also conflicting with the specified testTaskType. taskTypesAreExclusive() is used to determine task conflicts.
virtual std::list<DtString> DtSimTaskManager::taskGroupsForTask ( const DtSimTaskMessageType taskType) const
protectedvirtual
Returns
A list of all the task groups that the specified task type belongs to.
static void DtSimTaskManager::requestCurrentTasksCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
staticprotected
virtual void DtSimTaskManager::processRequestCurrentTasks ( const DtVrfObjectMessage msg)
protectedvirtual
static void DtSimTaskManager::unsubscribeCurrentTasksCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
staticprotected
virtual void DtSimTaskManager::processUnsubscribeCurrentTasks ( const DtVrfObjectMessage msg)
protectedvirtual
virtual void DtSimTaskManager::sendCurrentTasks ( )
protectedvirtual
virtual void DtSimTaskManager::addSubtasksToCurrentTaskMessage ( const DtSuspendedTaskInfoList subtaskList,
int  parentTaskId,
int  status,
DtCurrentTasksAdminContent adminContent 
)
protectedvirtual
virtual void DtSimTaskManager::updateTaskVisualizationList ( bool  includeTimeout = true)
protectedvirtual

Updates the list of current activated task visualizations. Called once per tick.

virtual void DtSimTaskManager::stopCurrentTaskVisualizations ( )
protectedvirtual

Stops sending any current task visualizations. Called when task visualizations are disabled or deactivated.

static void DtSimTaskManager::clearTaskByTrackingNumberCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
staticprotected
virtual void DtSimTaskManager::processClearTaskByTrackingNumber ( const DtVrfObjectMessage msg)
protectedvirtual
virtual void DtSimTaskManager::processTaskEvent ( const makVrfEvents::DtEvent )
protectedvirtual
virtual void DtSimTaskManager::registerSetDataMessageCallbacks ( )
protectedvirtual

Handles registration/deregistration of callbacks.

Reimplemented in DtSimEngineeringTaskManager.

virtual void DtSimTaskManager::unregisterSetDataMessageCallbacks ( )
protectedvirtual

Handles registration/deregistration of callbacks.

virtual void DtSimTaskManager::registerTaskMessageCallbacks ( )
protectedvirtual

Handles registration/deregistration of callbacks.

virtual void DtSimTaskManager::unregisterTaskMessageCallbacks ( )
protectedvirtual

Handles registration/deregistration of callbacks.

virtual void DtSimTaskManager::addDefaultClutterTaskTypes ( )
protectedvirtual

Called during initialization to add task types that can be used for clutter entities.

Member Data Documentation

DtLocalObject* DtSimTaskManager::myLocalObject
protected
std::vector<DtOnTaskNotifyCallbackInfo> DtSimTaskManager::myOnTaskNotifyCallbacks
protected
DtTaskProcessorMap DtSimTaskManager::myTaskProcessorMap
protected

Stores all the registered task processor interfaces, indexed by task type they process.

bool DtSimTaskManager::mySendSkipTaskMessages
protected

Determines whether processSubordinateRemoved will send a skip task message. This should only be changed by DtCgf::rewind.

DtRwInt DtSimTaskManager::myNumberOfTaskSubscriptions
protected

Counter which holds the number of times the current task status has been subscribed to minus the number of times it has been unsubscribed. (>0 means that someone is subscribed)

bool DtSimTaskManager::mySendTasksNextTick
protected

Set to true if the task manager should send the list of current tasks next tick.

DtRwNLengthStringVector DtSimTaskManager::myTaskVisualizationRequestors
protected

Whether task visualizations are enabled for this object.

DtTime DtSimTaskManager::myTaskVisualizationRemovalTime
protected

Time at which task visualizations should be removed.

DtTaskCompleteCallbackList DtSimTaskManager::myTaskCompleteCallbackList
protected
DtScriptReactiveTaskController* DtSimTaskManager::myReactiveTaskController
protected
DtSimTaskManagerFactory* DtSimTaskManager::theFactory
staticprotected
bool DtSimTaskManager::myResumingTasks
protected
AvailableSupportingTasks DtSimTaskManager::myAvailableSupportingTasks
protected
BackgroundProcesses DtSimTaskManager::myBackgroundProcesses
protected
BackgroundProcesses DtSimTaskManager::myScriptedSets
protected
bool DtSimTaskManager::myTaskVisualizationsActive
protected
bool DtSimTaskManager::myFirstTick
protected
boost::signals2::scoped_connection DtSimTaskManager::mySimObjectDeletedConnection
protected
boost::signals2::scoped_connection DtSimTaskManager::mySubordinateRemovedConnection
protected
DelayedTaskExecution DtSimTaskManager::myDelayedTaskExecution
protected
std::vector<DtSimTaskMessageType> DtSimTaskManager::myClutterTasks
protected
boost::signals2::connection DtSimTaskManager::myEventSignalConnection
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)