![]() |
VR-Forces 4.0.4 Class Documentation
|
DtAggregatePatrolBetweenController is a task controller responsible for executing DtPatrolBetweenTasks in aggregate entities. More...

Public Member Functions | |
| DtDisaggregatedPatrolBetweenController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtDisaggregatedPatrolBetweenController () |
| virtual bool | init () |
| Overridden to call createPSR(). | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | registerTaskMsgCallbacks () |
| Registers task and set data request callbacks for following type: DtPatrolTwoPointsType. | |
| virtual void | tick () |
| Overridden to handle legacy order of battle formats (generated by pre-3.8 versions of VR-Forces. | |
| virtual DtSimTaskStatePtr | currentTaskState () const |
| Return the current state of our patrol task. | |
Static Public Member Functions | |
| static void | patrolTwoPointsTaskCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskStatePtr) |
| Callback function for handling incoming turn to move to task message. | |
| static void | taskCompleteReportCallback (DtSimMessage *msg, void *usr) |
| Calls onTaskComplete to process the message. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual void | onPatrolTwoPointsTask (DtSimMessage *msg, DtSimTaskStatePtr taskStatePtr) |
| Unpacks incoming DtPatrolTwoPointsTask, caches names of waypoints in the task, calls moveTo() with the name of the first waypoint, sets myReverseDirection to true and calls startTask(). | |
| virtual void | onTaskComplete (DtSimMessage *msg) |
| If tasked() is true and report is for a DtMoveIntoFormationTask type, calls moveTo() (with the other waypoint). | |
| virtual bool | moveTo (const DtString &controlPointName) |
| Looks up given control point name. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
Protected Attributes | |
| DtAggregatePatrolBetweenPSR * | myProcessState |
| Container for state data associated with this component. | |
| bool | myFirstTick |
| Flag set to true until the first non-zero dT() tick, false thereafter. | |
Private Member Functions | |
| DtDisaggregatedPatrolBetweenController (const DtDisaggregatedPatrolBetweenController &orig) | |
| not implemented | |
| DtDisaggregatedPatrolBetweenController & | operator= (const DtDisaggregatedPatrolBetweenController &orig) |
| not implemented | |
DtAggregatePatrolBetweenController is a task controller responsible for executing DtPatrolBetweenTasks in aggregate entities.
End User Description: DtAggregatePatrolBetweenController models an aggregate's patrol-between <waypoints> behavior. The behavior is implemented by issuing move-along subtasks to itself, alternating between the two waypoints given in the patrol-between task. The DtAggregateMoveToController executes the subtasks. The task executes indefinitely (unless stopped by an external event, such as receipt of a skip task message).
This controller may only be configured as a part of an entity that has a vrf-aggregate-state-repository.
Uses Descriptor Type: DtComponentDescriptor
| DtDisaggregatedPatrolBetweenController::DtDisaggregatedPatrolBetweenController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| 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 DtDisaggregatedPatrolBetweenController::~DtDisaggregatedPatrolBetweenController | ( | ) | [virtual] |
| DtDisaggregatedPatrolBetweenController::DtDisaggregatedPatrolBetweenController | ( | const DtDisaggregatedPatrolBetweenController & | orig | ) | [private] |
not implemented
| virtual bool DtDisaggregatedPatrolBetweenController::init | ( | ) | [virtual] |
Overridden to call createPSR().
Reimplemented from DtControllerComponent.
| virtual DtString DtDisaggregatedPatrolBetweenController::type | ( | ) | const [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.
Implements DtTaskControllerComponent.
| virtual void DtDisaggregatedPatrolBetweenController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Registers task and set data request callbacks for following type: DtPatrolTwoPointsType.
Reimplemented from DtTaskControllerComponent.
| virtual void DtDisaggregatedPatrolBetweenController::tick | ( | ) | [virtual] |
Overridden to handle legacy order of battle formats (generated by pre-3.8 versions of VR-Forces.
Reimplemented from DtSimComponent.
| virtual DtSimTaskStatePtr DtDisaggregatedPatrolBetweenController::currentTaskState | ( | ) | const [virtual] |
Return the current state of our patrol task.
Reimplemented from DtSingleTaskControllerComponent.
| static void DtDisaggregatedPatrolBetweenController::patrolTwoPointsTaskCallback | ( | DtSimMessage * | msg, |
| void * | usr, | ||
| DtSimTaskStatePtr | taskStatePtr | ||
| ) | [static] |
Callback function for handling incoming turn to move to task message.
Calls onMoveToTask to actually handle the message.
| msg | Message containing a DtPatrolTwoPointsTask. |
| usr | Pointer to instance of this class. |
| static void DtDisaggregatedPatrolBetweenController::taskCompleteReportCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls onTaskComplete to process the message.
| msg | Message containing a DtTaskCompleteReport. |
| usr | Pointer to instance of this class. |
| static DtSimComponent* DtDisaggregatedPatrolBetweenController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
(const DtString&,DtVrfObject*,DtSimManager*,
| 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 void DtDisaggregatedPatrolBetweenController::onPatrolTwoPointsTask | ( | DtSimMessage * | msg, |
| DtSimTaskStatePtr | taskStatePtr | ||
| ) | [protected, virtual] |
Unpacks incoming DtPatrolTwoPointsTask, caches names of waypoints in the task, calls moveTo() with the name of the first waypoint, sets myReverseDirection to true and calls startTask().
| msg | Message containing a DtPatrolTwoPointsTask. |
| virtual void DtDisaggregatedPatrolBetweenController::onTaskComplete | ( | DtSimMessage * | msg | ) | [protected, virtual] |
If tasked() is true and report is for a DtMoveIntoFormationTask type, calls moveTo() (with the other waypoint).
| msg | Message containing a DtTaskCompleteReport. |
| virtual bool DtDisaggregatedPatrolBetweenController::moveTo | ( | const DtString & | controlPointName | ) | [protected, virtual] |
Looks up given control point name.
If it exists, calculates heading to the waypoint from current aggregate location. Sends a move into formation subtask to ourself with the following parameters: location of waypoint heading from ourself to waypoint formation type of DtKeepExistingFormation, apply formation to subordinate is false
| virtual bool DtDisaggregatedPatrolBetweenController::createPSR | ( | ) | [protected, virtual] |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
| DtDisaggregatedPatrolBetweenController& DtDisaggregatedPatrolBetweenController::operator= | ( | const DtDisaggregatedPatrolBetweenController & | orig | ) | [private] |
not implemented
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
Flag set to true until the first non-zero dT() tick, false thereafter.