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

This class provides a base class for all controllers that are capable of executing a DtSimTask, and can only execute a single DtSimTask at a time. This is the typical case for most task controllers, so most controllers will be derived from this class.

Inherits DtTaskControllerComponent.

Inherited by DtAffectEngineeringObjectController, DtAggregatedMoveAlongController, DtAggregatedMoveToController, DtAggregatedPatrolController, DtAggregateFollowController, DtAirportLightingController, DtBombController, DtConvoyTaskController, DtDetonationController, DtDiGuyController, DtDiGuyGestureController, DtDisaggregatedLeadFollowInFormationController, DtDisaggregatedMoveAlongController, DtDisaggregatedMoveIntoFormationController, DtDisaggregatedMoveToController, DtDisaggregatedMoveToLocationController, DtDisaggregatedOccupancyDirectorController, DtDisaggregatedPatrolAlongController, DtDisaggregatedPatrolBetweenController, DtDisaggregatedTurnToHeadingController, DtDynamicTerrainController, DtEmbarkationController, DtFixedWingLandingController, DtFixedWingPilotController, DtFixedWingTakeoffController, DtGroundAutoControllerComponent, DtHoldController, DtHumanCollisionAvoidanceController, DtHumanCrosswalkController, DtHumanFleeController, DtHumanFollowController, DtHumanMoveAlongController, DtHumanMoveToController, DtHumanPatrolController, DtHumanStopMovingController, DtHumanTurnToController, DtHumanUseDoorController, DtIndirectFireController, DtLasingController, DtLaunchExpendableResourceController, DtLaunchSmokeController, DtLimitExistenceController, DtLookAtPointController, DtMissileControllerComponent, DtMissileTargetController, DtMoveAlongWithActionsController, DtMunitionLaunchController, DtOccupancyDirectorController, DtParachuteController, DtProvideIndirectFireController, DtRailPathController, DtReleaseBombController, DtResupplyController, DtResupplyReceiverController, DtResupplySupplierController, DtRoadMovementController, DtRotaryWingTaskController, DtScenarioEventController, DtScriptedMovementController, DtSendRadioMessageController, DtSensorGimbalController, DtSubSurfaceDepthController, DtSurfaceEntityFollowEntityController, DtSurfaceEntityPilotController, DtTargetSelectionController, and DtWaitController.

Public Member Functions

 DtSingleTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSingleTaskControllerComponent ()
 
virtual void postTick ()
 
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState)
 
virtual void taskNotify (const DtSimTask &task)
 
virtual void taskComplete (bool success=true)
 
virtual void clearTask ()
 
virtual void suspendTask ()
 
virtual int sendSubtask (DtSimTask &task)
 
virtual void clearSubtask (int subtaskId)
 
virtual void addPendingSubtaskId (int subtaskId)
 
virtual bool findPendingSubtaskId (int subtaskId)
 
virtual bool isSubtasked () const
 
virtual void removePendingSubtaskId (int subtaskId)
 
virtual void removeAllPendingSubtaskIds ()
 
virtual std::vector< intcurrentPendingSubstaskIds () const
 
virtual void clearCurrentTaskMessage ()
 
virtual DtTaskMessagecurrentTaskMessage () const
 
virtual DtSimTaskStatePtr currentTaskState () const
 
virtual bool decideToGiveUpTask () const
 
virtual void giveUpTask ()
 
virtual bool taskActive (int taskId) const
 
virtual bool clearTopLevelTasks ()
 
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType)
 
virtual void clearTasksByType (const DtSimTaskMessageType &taskType)
 
virtual void clearTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendTaskById (int taskId)
 
virtual DtSuspendedTaskInfosuspendSubtaskById (int taskId, int subtaskId)
 
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const
 
virtual void disable ()
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtTaskControllerComponent ()
 
virtual const chartype () const =0
 
virtual bool showCurrentTaskInGui () const
 
virtual void setRadio (DtSimRadio *radio)
 
virtual void registerTaskMsgCallbacks ()
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 
virtual void enable ()
 
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 
virtual bool taskVisualizationsActive () const
 
virtual void setTasked (bool tasked)
 
virtual bool tasked () const
 
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtControllerComponent ()
 
virtual bool init ()
 
virtual bool postAddComponentsInit ()
 
virtual DtSimRadioradio ()
 
virtual void enableTaskTypes ()
 
virtual void disableTaskTypes ()
 
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simServices, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtSimComponent ()
 
virtual void setParentSystem (DtComponentSystem *system)
 
DtComponentSystemparentSystem () const
 
virtual void registerAttributeFunctions ()
 
virtual void preFirstTickInit ()
 
virtual void tick ()
 
virtual void timedTick ()
 
virtual void setMinTickPeriod (double minTickPeriod)
 
virtual double minTickPeriod () const
 
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 
virtual double minTickPeriodVariance () const
 
virtual void setNextTickTime (double nextTickTime)
 
virtual double nextTickTime () const
 
virtual double calculateNextTickTime () const
 
virtual double calculateFirstTickTime () const
 
virtual void setEntity (DtLocalObject *entity)
 
virtual DtSimComponentnextComponent ()
 
virtual DtSimComponentprevComponent ()
 
virtual void setListItem (DtListItem *item)
 
virtual DtListItem * listItem ()
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void addInputPort (DtInputPort *port)
 
virtual void removeInputPort (DtInputPort *port)
 
virtual DtInputPortlookupInputPort (const DtString &portName)
 
virtual DtList inputPortList () const
 
virtual void addOutputPort (DtOutputPort *port)
 
virtual void removeOutputPort (DtOutputPort *port)
 
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 
virtual DtList outputPortList () const
 
virtual void addInputPortGroup (DtInputPortGroup *group)
 
virtual void removeInputPortGroup (DtInputPortGroup *group)
 
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 
virtual DtList inputPortGroupList () const
 
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
 
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 
virtual DtList outputPortGroupList () const
 
virtual int priority () const
 
virtual void setPriority (int priority)
 
double dT () const
 
virtual void setDT (double deltaT)
 
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 
virtual const
DtComponentDescriptor
componentDescriptor () const
 
virtual bool tickWhileDestroyed () const
 
DtVrfProcessStateRepositoryManagerpsrManager ()
 
virtual const DtSymbolStringcomponentFullName () const
 
DtPhysicalWorldphysicalWorld ()
 
const DtPhysicalWorldphysicalWorld () const
 
const DtAttachedTerrainterrainAttachedTo () const
 
DtLocalObjectentity ()
 
const DtLocalObjectentity () const
 
DtSimulationServicessimulationServices ()
 
const DtSimulationServicessimulationServices () const
 
const Coordinate_SystemcoordinateSystem () const
 
virtual bool taskVisualizationsEnabled () const
 
makVrf::DtTaskVisualizationMaptaskVisualizations ()
 
virtual bool isEnabled ()
 
virtual void setIsEnabled (bool yesNo)
 
virtual DtOutputStream & objectConsoleDebug (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleVerbose (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleInfo (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleWarn (const DtString &channel="") const
 
virtual DtOutputStream & objectConsoleError (const DtString &channel="") const
 
virtual int notifyLevel () const
 
virtual DtSimResourceManagerresourceManager ()
 
virtual const
DtSimResourceManager
resourceManager () const
 
VRF4API_METHOD const
DtSimulationServices
simManager () const
 
- 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)
 
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 postGetSelf ()
 
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 wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
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)
 

Protected Member Functions

virtual void clearPendingSubtasks ()
 
virtual void clearSubtasksByType (const DtSimTaskMessageType &taskType)
 
virtual void cleanupInactiveSubtaskStatus ()
 
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual void suspendSubtaskOfTask (int taskId, int subtaskId, DtSuspendedTaskInfo *suspendInfo)
 
virtual DtSimTaskMessageType remapScriptId (const DtSimTaskMessageType &) const
 
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 
 DtControllerComponent (const DtControllerComponent &orig)
 
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 
virtual void onRestore ()
 
virtual void initializeTargetingControlTableFromDescriptor (const DtReaderWriter *)
 
virtual void sendCapableSetsAndTasks ()
 
- Protected Member Functions inherited from DtSimComponent
virtual double computeCurrentTime ()
 
bool testInvariant () const
 
virtual bool createPortGroups ()
 
virtual bool createPorts ()
 
DtVrfProcessStateRepositorycreateComponentPsr (const DtString &defaultPsrType, const DtString &defaultPsrName, bool useDescriptorParams=true)
 
virtual void updateTaskVisualizations ()
 
virtual void destroyTaskVisualizations ()
 
virtual void destroyTaskVisualization (const DtString &name)
 
virtual
makVrf::DtPointTaskVisualizationPtr 
pointTaskVisualization (const DtString &name)
 
virtual
makVrf::DtLineTaskVisualizationPtr 
lineTaskVisualization (const DtString &name)
 
virtual
makVrf::DtAreaTaskVisualizationPtr 
areaTaskVisualization (const DtString &name)
 
virtual
makVrf::DtTextTaskVisualizationPtr 
textTaskVisualization (const DtString &name)
 
double calculateNextTaskVisTickTime () const
 
DtVrfObjectStateRepositorylocalStateRepository ()
 
const DtVrfObjectStateRepositorylocalStateRepository () const
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Additional Inherited Members

- 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 )()
 
- Static Public Member Functions inherited from DtTaskControllerComponent
static void deprecatedTaskProcessorCallbackAdapter (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
 
- Static Public Member Functions inherited from DtSimComponent
static DtSimComponentFactoryfactory ()
 
static void setFactory (DtSimComponentFactory *factory)
 
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 
static VRF4API_METHOD
DtSimComponent
MarkThreadSafe (DtSimComponent *comp)
 
- 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 inherited from DtTaskControllerComponent
typedef std::pair
< DtTaskMessageCallbackFcn,
void * > 
DtTaskCallbackMapPair
 
typedef std::map
< DtSimTaskMessageType,
DtTaskCallbackMapPair
DtTaskCallbackMap
 
- Protected Types inherited from DtSimComponent
typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
 
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
 
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
 
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap
 
- Protected Attributes inherited from DtTaskControllerComponent
DtTaskCallbackMap myTaskCallbackMap
 
std::list
< DtTaskProcessorCallbackInfo * > 
myTaskProcessorCallbackInfoList
 
bool myTaskIsRunning
 
- Protected Attributes inherited from DtControllerComponent
DtSimRadiomyRadio
 
bool myTaskTypesEnabled
 
bool myInitialized
 
- Protected Attributes inherited from DtSimComponent
DtLocalObjectmyEntity
 
DtComponentSystemmySystem
 
DtListItem * myListItem
 
DtInputPortMap myInputPortList
 
DtOutputPortMap myOutputPortList
 
DtInputPortGroupMap myInputPortGroupList
 
DtOutputPortGroupMap myOutputPortGroupList
 
int myPriority
 
double myMinTickPeriod
 
double myMinTickPeriodVariance
 
double myNextTickTime
 
double myLastTickSimTime
 
double myDT
 
bool myIsEnabled
 
bool myFirstTick
 
const DtComponentDescriptormyComponentDescriptor
 
std::list
< DtVrfProcessStateRepository * > 
myComponentPsrs
 
bool myTickEveryFrame
 
makVrf::DtTaskVisualizationMap myTaskVisualizations
 
double myNextTaskVisTickTime
 
DtSymbolString myFullComponentName
 
DtSimulationServicesmySimServices
 
DtPredicateCallbackManager myPredicateCallbackManager
 
- 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 inherited from DtSimComponent
static DtSimComponentFactorymyFactory
 
- 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
 

Constructor & Destructor Documentation

DtSingleTaskControllerComponent::DtSingleTaskControllerComponent ( const DtString name,
DtLocalObject owner,
DtSimulationServices simServices,
DtComponentDescriptor compDesc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

Parameters
nameReader writer name of this component.
ownerThe DtLocalObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
virtual DtSingleTaskControllerComponent::~DtSingleTaskControllerComponent ( )
virtual

destructor

Member Function Documentation

virtual void DtSingleTaskControllerComponent::postTick ( )
virtual

Override to check if we're tasked and we want to give up (only performs the check if we're in play mode (dT() > 0)). Calls decideToGiveUpTask() to determine if we should give up. If true, calls giveUpTask().

Reimplemented from DtSimComponent.

virtual bool DtSingleTaskControllerComponent::beginProcessingTask ( const DtTaskMessage task,
DtSimTaskStatePtr  taskState 
)
virtual

Called by the task manager when this controller should start executing the specified task.

Parameters
taskStateUsed to convey at what point the task should begin execution. If taskState exists, execution of task may begin at some point other than the logical start of the task. If taskState is 0, begin processing at the logical start of the task.
Returns
True if the controller can successfully start the task.
False if the controller is failing the task.

Reimplemented from DtTaskControllerComponent.

Reimplemented in DtRotaryWingFlightCommandController, and DtFixedWingFlightCommandController.

virtual void DtSingleTaskControllerComponent::taskNotify ( const DtSimTask task)
virtual

This is called to let us know when some other component receives a task In the case of this component, we don't care what the task actually is.

Reimplemented from DtTaskControllerComponent.

virtual void DtSingleTaskControllerComponent::taskComplete ( bool  success = true)
virtual

If we are currently tasked, this will cause us to notify the entity that we're done and delete the task. To indicate that the task has failed (and is being abandoned) call this method with success set to false.

Reimplemented in DtDiGuyController, DtSurfaceEntityMoveAlongController, DtIndirectFireController, DtFixedWingMoveToController, DtTargetSelectionController, DtLaunchExpendableResourceController, and DtDiGuyGestureController.

virtual void DtSingleTaskControllerComponent::clearTask ( )
virtual

If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false, and calls clearCurrentTaskMesage() to clear out the current task message.

Reimplemented from DtControllerComponent.

Reimplemented in DtRoadMovementController, DtFixedWingMoveAlongController, DtFixedWingMoveToController, DtAggregatedMoveToController, DtMunitionLaunchController, DtHumanMoveToController, DtDiGuyController, DtGroundMoveAlongControllerComponent, DtAggregatedMoveAlongController, DtHumanMoveAlongController, DtRailPathController, DtRotaryWingMoveAlongControllerComponent, DtHumanFollowController, DtDisaggregatedEmbarkationController, DtParachuteController, DtDisaggregatedMoveAlongController, DtSurfaceEntityPilotController, DtHumanFleeController, DtDisaggregatedLeadFollowInFormationController, DtLaunchExpendableResourceController, DtSurfaceEntityFollowEntityController, DtRotaryWingFlightCommandController, DtGroundMoveToDestinationControllerComponent, DtEmbarkationController, DtSubSurfaceDepthController, DtLookAtPointController, DtLasingController, DtFixedWingFlightCommandController, DtFixedWingLandingController, DtCreateEngineeringObjectController, DtFixedWingTakeoffController, DtAggregateFollowController, DtDisaggregatedMoveIntoFormationController, DtIndirectFireController, DtFixedWingPilotController, DtConvoyTaskController, DtGroundFollowInFormationControllerComponent, DtHumanTurnToController, DtDestroyEngineeringObjectController, DtSurfaceEntityMoveAlongController, DtGroundTurnToControllerComponent, DtDisaggregatedMoveToLocationController, DtScriptedMovementController, DtHumanStopMovingController, DtMoveAlongWithActionsController, DtRotaryWingLandingController, DtGroundAutoControllerComponent, DtRotaryWingTaskController, DtGroundLeadFormationControllerComponent, DtDisaggregatedMoveToController, DtSurfaceEntityMoveToController, and DtFascamController.

virtual void DtSingleTaskControllerComponent::suspendTask ( )
virtual

This method is called when the currently running task is being suspended. The default implementation is to cancel all subtasks of this task.

Reimplemented in DtHumanMoveToController, and DtEmbarkationController.

virtual int DtSingleTaskControllerComponent::sendSubtask ( DtSimTask task)
virtual

Sends subtask to ourself. Creates task message and sends task to ourself through radio. Adds subtask Id to list of pending subtasks. Returns subtask Id.

virtual void DtSingleTaskControllerComponent::clearSubtask ( int  subtaskId)
virtual

Clears subtask with the given subtaskId (subtaskId is returned sendSubtask()). Also removed the subtask ID from the pending subtask ID list.

virtual void DtSingleTaskControllerComponent::addPendingSubtaskId ( int  subtaskId)
virtual

Adds given subtask Id to list of pending subtasks. This is done automatically by sendSubtask (user should not typically have to call this directly).

virtual bool DtSingleTaskControllerComponent::findPendingSubtaskId ( int  subtaskId)
virtual

Checks to see if given subtaskId exists in our list of pending subtasks. Typically checked from within a task complete callback, to determine if given report corresponds to the specific subtask we issued.

virtual bool DtSingleTaskControllerComponent::isSubtasked ( ) const
virtual

Returns true if this controller is currently subtasked.

virtual void DtSingleTaskControllerComponent::removePendingSubtaskId ( int  subtaskId)
virtual

Removes pending subtask from list of subtasks for this component. Users will typically call this from within a task complete callback, upon receipt of the specific subtasking task complete report they were waiting for.

virtual void DtSingleTaskControllerComponent::removeAllPendingSubtaskIds ( )
virtual

Clear all pending subtasks from our list of subtasks. Users should not typically have to call this.

virtual std::vector<int> DtSingleTaskControllerComponent::currentPendingSubstaskIds ( ) const
virtual

Returns the list of all currently pending subtask ids for this controller.

virtual void DtSingleTaskControllerComponent::clearCurrentTaskMessage ( )
virtual

Returns the current subtask with the specified id. Also returns the controller that is responsible. If NULL, no task was found.

Clear the current task message.

Reimplemented in DtEmbarkationController, and DtFixedWingLandingController.

virtual DtTaskMessage* DtSingleTaskControllerComponent::currentTaskMessage ( ) const
virtual

Get a pointer to the message that was used to task this entity.

virtual DtSimTaskStatePtr DtSingleTaskControllerComponent::currentTaskState ( ) const
virtual
Returns
Current execution state of the task. At the base class level, returns 0. Derived classes that have tasks with DtTaskState (data associated with execution of the task) may return a new DtTaskState instance, filled out with the appropriate information about the current task execution state. Task controllers that do not need to return task state do not need to override this function.

Reimplemented in DtAggregatedMoveAlongController, DtFixedWingMoveAlongController, DtDisaggregatedMoveAlongController, DtDisaggregatedLeadFollowInFormationController, DtRailPathController, DtHumanMoveAlongController, DtDisaggregatedPatrolAlongController, DtWaitController, DtDisaggregatedPatrolBetweenController, DtRotaryWingWaitController, DtFixedWingPatrolRouteController, DtHumanPatrolController, DtAggregatedPatrolController, DtGroundMoveAlongControllerComponent, DtRotaryWingMoveAlongControllerComponent, DtRotaryWingPatrolBetweenController, DtLaunchExpendableResourceController, DtRotaryWingPatrolRouteController, DtFixedWingPatrolBetweenController, DtGroundPatrolRouteController, and DtGroundPatrolBetweenController.

virtual bool DtSingleTaskControllerComponent::decideToGiveUpTask ( ) const
virtual

This function is used to determine if the controller should give up trying to execute the current task. Override this function to provide the test for determining if the task controller should give up. For example, a derived move-to-waypoint controller tasked to reach an unreachable waypoint might decide to give up after a certain amount of time, or after circling the point and failing to reach it. This function is called from within tick. If the controller is tasked and this function returns true, it calls giveUp(). The implementation in this class always returns false.

Reimplemented in DtFixedWingPilotController, DtSurfaceEntityPilotController, DtSurfaceEntityFollowEntityController, DtGroundAutoControllerComponent, DtGroundMoveToDestinationControllerComponent, DtHumanMoveToController, DtGroundMoveAlongControllerComponent, and DerivedMoveToController.

virtual void DtSingleTaskControllerComponent::giveUpTask ( )
virtual

Called when controller is tasked and decideToGiveUp() returns true. Base class implementation calls clearTask(). Derived classes may override this function to perform some specific handling.

Reimplemented in DerivedMoveToController.

virtual bool DtSingleTaskControllerComponent::taskActive ( int  taskId) const
virtual

Returns
True if a task of this ID is current active in this controller.

Implements DtTaskControllerComponent.

virtual bool DtSingleTaskControllerComponent::clearTopLevelTasks ( )
virtual

If this controller has any top level tasks (not subtasks), they are cleared.

Returns
True if any tasks were cleared.

Implements DtTaskControllerComponent.

virtual void DtSingleTaskControllerComponent::clearConflictingTopLevelTasks ( const DtSimTaskMessageType conflictType)
virtual

Clears any top level tasks on this controller that conflict with the conflict task type. The task manager is used to determine what tasks conflict.

Implements DtTaskControllerComponent.

virtual void DtSingleTaskControllerComponent::clearTasksByType ( const DtSimTaskMessageType taskType)
virtual

Clears any tasks of the specified type running in this controller.

Implements DtTaskControllerComponent.

virtual void DtSingleTaskControllerComponent::clearTaskById ( int  taskId)
virtual

Clears any task of the specified ID running in this controller.

Implements DtTaskControllerComponent.

virtual DtSuspendedTaskInfo* DtSingleTaskControllerComponent::suspendTaskById ( int  taskId)
virtual
virtual DtSuspendedTaskInfo* DtSingleTaskControllerComponent::suspendSubtaskById ( int  taskId,
int  subtaskId 
)
virtual
virtual std::list<DtTaskMessage*> DtSingleTaskControllerComponent::currentTaskMessages ( ) const
virtual

Returns
A list of pointers to task messages currently being run on this controller.

Implements DtTaskControllerComponent.

virtual DtTaskWithTaskStateListPtr DtSingleTaskControllerComponent::topLevelTasks ( ) const
virtual

Returns
A list of all top level tasks currently in this controller along with their task state, if any.

Implements DtTaskControllerComponent.

virtual void DtSingleTaskControllerComponent::disable ( )
virtual

Overridden to allow tasks controllers that can be disabled to call task complete.

Reimplemented from DtTaskControllerComponent.

Reimplemented in DtEmbarkationController, DtLasingController, DtWaitController, DtProvideIndirectFireController, and DtHoldController.

virtual void DtSingleTaskControllerComponent::clearPendingSubtasks ( )
protectedvirtual

Iterates over collection of all pending subtasks for this controller, and calls clearSubtask() for each subtask type.

virtual void DtSingleTaskControllerComponent::clearSubtasksByType ( const DtSimTaskMessageType taskType)
protectedvirtual

Clear all subtasks of a given type. Should not normally be called (call clearSubtask(int subtaskId) to clear a given subtask instead). Provided as a utility function as an aid to backwards compatibility.

virtual void DtSingleTaskControllerComponent::cleanupInactiveSubtaskStatus ( )
protectedvirtual

Clears out subtask status entries that are either completed or canceled which were started by this controller. This typically is not necessary to call. Cleanup happens automatically when the parent task ends.


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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)