![]() |
VR-Forces 4.0.4 Class Documentation
|
End User Description: DtTaskControllerComponent is the base class for all controllers that respond to tasks. More...

Public Member Functions | |
| DtTaskControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString& name, | |
| virtual | ~DtTaskControllerComponent () |
| destructor | |
| virtual DtString | type () const =0 |
| Returns a string identifies the class type of component. | |
| virtual void | postTick () |
| 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)). | |
| virtual bool | beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState) |
| Called by the task manager when this controller should start executing the specified task. | |
| virtual void | taskNotify (const DtSimTask &task) |
| 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. | |
| virtual bool | showCurrentTaskInGui () const |
| virtual void | setRadio (DtSimBaseRadio *radio) |
| Calls registerTaskMsgCallbacks. | |
| virtual void | registerTaskMsgCallbacks () |
| virtual void | addTaskProcessorCallback (int taskType, DtTaskMessageCallbackFcn fcn, void *usr) |
| Adds a new function for processing the specified task type. | |
| virtual void | addTaskProcessorCallback (int taskType, DtMessageCallbackFcn fcn, void *usr) |
| Deprecated form of addTaskProcessorCallback. | |
| virtual void | removeTaskProcessorCallback (int taskType, DtMessageCallbackFcn fcn, void *usr) |
| Undoes anything done by addTaskProcessorCallback(). | |
| virtual void | removeTaskProcessorCallback (int taskType, DtTaskMessageCallbackFcn fcn, void *usr) |
| Deprecated form of removeTaskProcessorCallback. | |
| virtual bool | taskActive (int taskId) const =0 |
| virtual bool | clearTopLevelTasks ()=0 |
| If this controller has any top level tasks (not subtasks), they are cleared. | |
| virtual void | clearConflictingTopLevelTasks (int conflictId)=0 |
| Clears any top level tasks on this controller that conflict with the conflictId. | |
| virtual void | clearTasksByType (int taskType)=0 |
| Clears any tasks of the specified type running in this controller. | |
| virtual void | clearTaskById (int taskId)=0 |
| Clears any task of the specified ID running in this controller. | |
| virtual std::list < DtTaskMessage * > | currentTaskMessages () const =0 |
| virtual DtTaskWithTaskStateListPtr | topLevelTasks () const =0 |
| virtual void | enable () |
| Overridden to call registerTaskMsgCallbacks(). | |
| virtual void | disable () |
| Overridden to 1) remove any task message callbacks registered by this controller 2) call clear task. | |
| virtual void | setTasked (bool tasked) |
| The current tasked state of this controller. | |
| virtual bool | tasked () const |
| The current tasked state of this controller. | |
Static Public Member Functions | |
| static void | deprecatedTaskProcessorCallbackAdapter (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState) |
| Task processor callback function that acts as an adapter for the deprecated forms of addTaskProcessorCallback and removeTaskProcessorCallback (the deprecated form is is version that. | |
Protected Types | |
| typedef std::pair < DtTaskMessageCallbackFcn, void * > | DtTaskCallbackMapPair |
| This map stores callbacks that have been registered to processes various tasks. | |
| typedef std::map< int, DtTaskCallbackMapPair > | DtTaskCallbackMap |
Protected Attributes | |
| DtTaskCallbackMap | myTaskCallbackMap |
| std::list < DtTaskProcessorCallbackInfo * > | myTaskProcessorCallbackInfoList |
| This list stores any DtTaskProcessorCallbackInfo allocated locally so that they can be deleted when the component is deleted. | |
Private Member Functions | |
| DtTaskControllerComponent () | |
| default constructor; should not be called. | |
| DtTaskControllerComponent (const DtTaskControllerComponent &orig) | |
| copy constructor | |
| const DtTaskControllerComponent & | operator= (const DtTaskControllerComponent &orig) |
| assignment operator | |
End User Description: DtTaskControllerComponent is the base class for all controllers that respond to tasks.
Developer Description: DtTaskControllerComponent provides a base class for any controller that intends to register for DtSimTask messages. It implements the basic semantics necessary for the tasking model to work, including, taskNotify(), taskComplete(), skipTask(), and clearTask(). Controllers will want to derive from one of the subclasses of DtTaskControllerComponent, most likely DtSingleTaskControllerComponent.
typedef std::pair<DtTaskMessageCallbackFcn, void*> DtTaskControllerComponent::DtTaskCallbackMapPair [protected] |
This map stores callbacks that have been registered to processes various tasks.
The map is indexed by task type ID.
typedef std::map<int, DtTaskCallbackMapPair> DtTaskControllerComponent::DtTaskCallbackMap [protected] |
| DtTaskControllerComponent::DtTaskControllerComponent | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | compDesc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString& name,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtTaskControllerComponent::~DtTaskControllerComponent | ( | ) | [virtual] |
destructor
| DtTaskControllerComponent::DtTaskControllerComponent | ( | ) | [private] |
default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtTaskControllerComponent::DtTaskControllerComponent | ( | const DtTaskControllerComponent & | orig | ) | [private] |
copy constructor
| virtual DtString DtTaskControllerComponent::type | ( | ) | const [pure virtual] |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Reimplemented from DtControllerComponent.
Implemented in DtHumanCollisionAvoidanceController, DtTargetSelectionController, DtRailPathController, DtGroundCollisionAvoidanceController, DtPathMovementController, DtSurfaceEntityPilotController, DtDisaggregatedMoveAlongController, DtGroundMovementChooserController, DtDIGuyController, vrfLua::DtLuaScriptController, BHAVE::DtKynapseGroundPlatformController, DtSurfaceEntityMoveAlongController, DtGroundMoveToDestinationControllerComponent, DtSurfaceEntityPatrolRouteController, DtFixedWingTakeoffController, BHAVE::DtKynapseController, DtFixedWingPilotController, BHAVE::DtKynapseLifeformController, DtDisaggregatedMoveIntoFormationController, DtFixedWingMoveAlongController, DtRetreatController, DtOccupancyDirectorController, BHAVE::DtBhaveMoveDirectionController, DtSurfaceEntityPatrolBetweenController, DtAggregatedMoveToController, DtConvoyTaskController, DtDetonationController, DtHumanMoveAlongController, DtCruiseMissileLaunchController, DtIndirectFireController, DtDisaggregatedMoveToLocationController, DtDisaggregatedPatrolAlongController, DtFixedWingLandingController, DtRotaryWingCollisionAvoidanceController, DtEmbarkationController, DtDisaggregatedEmbarkationController, DtHumanMoveToController, DtFixedWingFlyIntoController, DtFixedWingDefaultController, DtGroundMoveToControllerComponent, DtGroundMoveDirectionController, DtRailMovementController, DtSurfaceEntityMoveToLocationController, DtDisaggregatedPatrolBetweenController, DtFixedWingFlightCommandController, DtLasingController, DtRotaryWingLandingController, DtRotaryWingTurnToHeadingController, DtAggregatedPatrolController, DtHumanPatrolController, DtLimitExistenceController, DtMissileMoveToControllerComponent, DtRotaryWingPatrolBetweenController, DtSurfaceEntityFollowEntityController, DtGroundAutoControllerComponent, DtGroundPatrolRouteController, DtGroundStopMovingControllerComponent, DtMissileTrackEntityController, DtDisaggregatedWaitController, DtFixedWingPatrolRouteController, DtGroundFollowEntityController, DtGroundInterceptAndDestroyController, DtMissileControllerComponent, DtRotaryWingPatrolRouteController, DtCruiseMissileDefaultController, DtDisaggregatedMoveToController, DtFixedWingJoyFlightController, DtLasingMissileTrackController, DtRotaryWingMoveAlongControllerComponent, DtSurfaceEntityMoveToController, DtFixedWingFollowEntityController, DtGroundPatrolBetweenController, DtHumanFollowController, DtRotaryWingFlightCommandController, DtRotaryWingFollowEntityController, DtRotaryWingLoiterControllerComponent, DtDisaggregatedOccupancyDirectorController, DtDisaggregatedTurnToHeadingController, DtFixedWingMoveToController, DtFixedWingPatrolBetweenController, DtGroundTurnToControllerComponent, DtWaitController, DtTurnAndMoveController, DtRotaryWingMoveToControllerComponent, DtRotaryWingWaitController, DtRotaryWingTaskController, DtAggregatedMoveAlongController, DtFixedWingEmbarkationController, DtGroundJoyMoveController, DtGroundMoveToLocationControllerComponent, DtHumanTurnToController, DtGroundOrbitController, DtHumanStopMovingController, DtLaunchExpendableResourceController, DtCruiseMissileMoveAlongController, DtGroundMoveAlongControllerComponent, DtFixedWingMoveToLocationController, DtLaunchSmokeController, DtRotaryWingEmbarkationController, DtRotaryWingMoveToLocationControllerComponent, DtSendRadioMessageController, and DtSimpleRadarWarningResponse.
| virtual void DtTaskControllerComponent::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.
Reimplemented in DtMultiTaskControllerComponent, and DtSingleTaskControllerComponent.
| virtual bool DtTaskControllerComponent::beginProcessingTask | ( | const DtTaskMessage & | task, |
| DtSimTaskStatePtr | taskState | ||
| ) | [virtual] |
Called by the task manager when this controller should start executing the specified task.
| taskState | Used 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. |
Reimplemented in DtRotaryWingFlightCommandController, DtFixedWingFlightCommandController, DtMultiTaskControllerComponent, and DtSingleTaskControllerComponent.
| virtual void DtTaskControllerComponent::taskNotify | ( | const DtSimTask & | task | ) | [inline, 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 DtControllerComponent.
Reimplemented in DtSingleTaskControllerComponent.
| virtual void DtTaskControllerComponent::setTasked | ( | bool | tasked | ) | [virtual] |
The current tasked state of this controller.
True if this controller is currently executing a task.
| virtual bool DtTaskControllerComponent::tasked | ( | ) | const [virtual] |
The current tasked state of this controller.
True if this controller is currently executing a task.
| virtual bool DtTaskControllerComponent::showCurrentTaskInGui | ( | ) | const [virtual] |
Reimplemented in DtFixedWingFlightCommandController, and DtRotaryWingFlightCommandController.
| virtual void DtTaskControllerComponent::setRadio | ( | DtSimBaseRadio * | radio | ) | [virtual] |
Calls registerTaskMsgCallbacks.
Reimplemented from DtControllerComponent.
Reimplemented in DtLasingController, DtGroundJoyMoveController, and DtFixedWingJoyFlightController.
| virtual void DtTaskControllerComponent::registerTaskMsgCallbacks | ( | ) | [virtual] |
Reimplemented in DtFixedWingMoveToController, DtFixedWingMoveAlongController, DtSurfaceEntityMoveAlongController, DtAggregatedMoveToController, DtSurfaceEntityMoveToController, DtDIGuyController, DtHumanMoveToController, DtDisaggregatedEmbarkationController, DtSurfaceEntityPatrolBetweenController, DtHumanCollisionAvoidanceController, DtIndirectFireController, DtMissileTrackEntityController, DtMissileMoveToControllerComponent, DtTargetSelectionController, DtGroundMoveToDestinationControllerComponent, DtRailPathController, DtSurfaceEntityPatrolRouteController, DtFixedWingFollowEntityController, DtDisaggregatedMoveAlongController, DtLasingController, DtFixedWingDefaultController, DtPathMovementController, DtRotaryWingPatrolBetweenController, DtRotaryWingPatrolRouteController, DtSurfaceEntityFollowEntityController, DtHumanFollowController, DtRotaryWingFollowEntityController, DtDisaggregatedMoveToLocationController, DtRailMovementController, vrfLua::DtLuaScriptController, DtGroundFollowEntityController, DtHumanMoveAlongController, DtFixedWingTakeoffController, DtGroundMovementChooserController, BHAVE::DtKynapseController, DtGroundMoveToControllerComponent, DtOccupancyDirectorController, DtGroundPatrolBetweenController, DtGroundInterceptAndDestroyController, DtRotaryWingCollisionAvoidanceController, DtRotaryWingMoveToControllerComponent, DtSurfaceEntityMoveToLocationController, BHAVE::DtBhaveMovementChooserController, DtRotaryWingFlightCommandController, DtDisaggregatedMoveIntoFormationController, DtFixedWingLandingController, DtFixedWingPatrolBetweenController, DtGroundPatrolRouteController, DtEmbarkationController, DtFixedWingPatrolRouteController, DtRotaryWingLandingController, DtDisaggregatedPatrolAlongController, DtRotaryWingTurnToHeadingController, DtConvoyTaskController, DtGroundTurnToControllerComponent, DtRetreatController, DtAggregatedMoveAlongController, DtGroundStopMovingControllerComponent, DtGroundOrbitController, DtWaitController, DtFixedWingFlyIntoController, DtRotaryWingWaitController, DtGroundMoveToLocationControllerComponent, DtGroundMoveAlongControllerComponent, DtRotaryWingMoveAlongControllerComponent, DtAggregatedPatrolController, DtHumanPatrolController, DtDisaggregatedWaitController, DtRotaryWingMoveToLocationControllerComponent, DtDisaggregatedPatrolBetweenController, DtHumanTurnToController, DtFixedWingMoveToLocationController, DtDisaggregatedMoveToController, DtHumanStopMovingController, DtDisaggregatedTurnToHeadingController, DtTurnAndMoveController, DtSendRadioMessageController, DtLaunchExpendableResourceController, and DtLaunchSmokeController.
| virtual void DtTaskControllerComponent::addTaskProcessorCallback | ( | int | taskType, |
| DtTaskMessageCallbackFcn | fcn, | ||
| void * | usr | ||
| ) | [virtual] |
Adds a new function for processing the specified task type.
Also causes this controller to register for this task type with the task manager.
| virtual void DtTaskControllerComponent::addTaskProcessorCallback | ( | int | taskType, |
| DtMessageCallbackFcn | fcn, | ||
| void * | usr | ||
| ) | [virtual] |
Deprecated form of addTaskProcessorCallback.
Callback signature does not include DtTaskState.
| virtual void DtTaskControllerComponent::removeTaskProcessorCallback | ( | int | taskType, |
| DtMessageCallbackFcn | fcn, | ||
| void * | usr | ||
| ) | [virtual] |
Undoes anything done by addTaskProcessorCallback().
| virtual void DtTaskControllerComponent::removeTaskProcessorCallback | ( | int | taskType, |
| DtTaskMessageCallbackFcn | fcn, | ||
| void * | usr | ||
| ) | [virtual] |
Deprecated form of removeTaskProcessorCallback.
Callback signature does not include DtTaskState.
| static void DtTaskControllerComponent::deprecatedTaskProcessorCallbackAdapter | ( | DtSimMessage * | msg, |
| void * | usr, | ||
| DtSimTaskStatePtr | taskState | ||
| ) | [static] |
Task processor callback function that acts as an adapter for the deprecated forms of addTaskProcessorCallback and removeTaskProcessorCallback (the deprecated form is is version that.
| virtual bool DtTaskControllerComponent::taskActive | ( | int | taskId | ) | const [pure virtual] |
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual bool DtTaskControllerComponent::clearTopLevelTasks | ( | ) | [pure virtual] |
If this controller has any top level tasks (not subtasks), they are cleared.
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual void DtTaskControllerComponent::clearConflictingTopLevelTasks | ( | int | conflictId | ) | [pure virtual] |
Clears any top level tasks on this controller that conflict with the conflictId.
The task manager is used to determine what tasks conflict.
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual void DtTaskControllerComponent::clearTasksByType | ( | int | taskType | ) | [pure virtual] |
Clears any tasks of the specified type running in this controller.
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual void DtTaskControllerComponent::clearTaskById | ( | int | taskId | ) | [pure virtual] |
Clears any task of the specified ID running in this controller.
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual std::list<DtTaskMessage*> DtTaskControllerComponent::currentTaskMessages | ( | ) | const [pure virtual] |
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual DtTaskWithTaskStateListPtr DtTaskControllerComponent::topLevelTasks | ( | ) | const [pure virtual] |
Implemented in DtSingleTaskControllerComponent, and DtMultiTaskControllerComponent.
| virtual void DtTaskControllerComponent::enable | ( | ) | [virtual] |
Overridden to call registerTaskMsgCallbacks().
Reimplemented from DtSimComponent.
Reimplemented in DtEmbarkationController.
| virtual void DtTaskControllerComponent::disable | ( | ) | [virtual] |
Overridden to 1) remove any task message callbacks registered by this controller 2) call clear task.
Reimplemented from DtSimComponent.
Reimplemented in DtEmbarkationController.
| const DtTaskControllerComponent& DtTaskControllerComponent::operator= | ( | const DtTaskControllerComponent & | orig | ) | [private] |
assignment operator
std::list<DtTaskProcessorCallbackInfo*> DtTaskControllerComponent::myTaskProcessorCallbackInfoList [protected] |
This list stores any DtTaskProcessorCallbackInfo allocated locally so that they can be deleted when the component is deleted.