VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtDisaggregatedPatrolBetweenController Class Reference

DtAggregatePatrolBetweenController is a task controller responsible for executing DtPatrolBetweenTasks in aggregate entities. More...

Inheritance diagram for DtDisaggregatedPatrolBetweenController:
Inheritance graph
[legend]

List of all members.

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 DtSimComponentcreator (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

DtAggregatePatrolBetweenPSRmyProcessState
 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
DtDisaggregatedPatrolBetweenControlleroperator= (const DtDisaggregatedPatrolBetweenController &orig)
 not implemented

Detailed Description

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


Constructor & Destructor Documentation

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject 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).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

not implemented


Member Function Documentation

Overridden to call createPSR().

Reimplemented from DtControllerComponent.

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.

Returns:
DtAggregatePatrolBetweenControllerType

Implements DtTaskControllerComponent.

Registers task and set data request callbacks for following type: DtPatrolTwoPointsType.

Reimplemented from DtTaskControllerComponent.

Overridden to handle legacy order of battle formats (generated by pre-3.8 versions of VR-Forces.

Reimplemented from DtSimComponent.

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.

Parameters:
msgMessage containing a DtPatrolTwoPointsTask.
usrPointer to instance of this class.
static void DtDisaggregatedPatrolBetweenController::taskCompleteReportCallback ( DtSimMessage msg,
void *  usr 
) [static]

Calls onTaskComplete to process the message.

Parameters:
msgMessage containing a DtTaskCompleteReport.
usrPointer 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*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject 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).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.
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().

Parameters:
msgMessage 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).

Parameters:
msgMessage 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


Member Data Documentation

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.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)