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

DtAggregatePatrolAlongController is a task controller responsible for executing DtPatrolAlongTasks in aggregate entities. More...

Inheritance diagram for DtDisaggregatedPatrolAlongController:
Inheritance graph
[legend]

List of all members.

Public Types

enum  DtPatrolAlongState { DtMovingAlongRoute = 0, DtReversingDirection = 1 }

Public Member Functions

 DtDisaggregatedPatrolAlongController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtDisaggregatedPatrolAlongController ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Override to cache a pointer to our DtFormationState and register formationStateChangedCallback to be invoked when formation state changes.
virtual void tick ()
 Override to check and set myFirstTick flag.
virtual void registerTaskMsgCallbacks ()
 Registers patrolAlongTaskCallback callback for DtPatrolRouteTasks.
DtSimTaskStatePtr currentTaskState () const
 Returns current task execution state (i.e.

Static Public Member Functions

static void patrolAlongTaskCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskStatePtr)
 Called upon reciept of DtPatrolRotueTasks.
static void taskCompleteReportCallback (DtSimMessage *msg, void *usr)
 Called upon receipt of a DtTaskCompleteReport.
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual void processPatrolAlongTask (DtSimMessage *msg, DtSimTaskStatePtr taskStatePtr)
 Unpacks the incoming DtPatrolRouteTask and calls myMoveAlongController->moveAlong(), sets myReverseDirection to true, and calls startTask().
virtual void onTaskComplete (DtSimMessage *msg)
 If tasked() is true and report is for a DtMoveAlongTask type, send set heading request to reverse direction and sends new move along task to ourself to start moving in opposite direction along route.
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual DtIteratorDirection initialTraversalDirection (const DtString &routeName, const DtVector &initialWorldPosition) const
 Determines initial traversal direction for patrol task.
virtual void sendMoveAlongToSelf (const DtString &routeName, enum DtIteratorDirection traversalDirection, bool startAtClosestPoint)
 Send move along task as subtask to ourself.

Protected Attributes

const
DtAggregatePatrolAlongDescriptor * 
myAggregatePatrolAlongDescriptor
 Descriptor used to configure this component.
DtFormationStatemyFormationState
 Aggregate's formation state, cached in this class for convenience.
DtAggregatePatrolAlongPSRmyProcessState
 Container for state data associated with this component.
bool myFirstTick

Private Member Functions

 DtDisaggregatedPatrolAlongController (const DtDisaggregatedPatrolAlongController &orig)
 copy constructor - not implemented
DtDisaggregatedPatrolAlongControlleroperator= (const DtDisaggregatedPatrolAlongController &orig)
 assignment operator - not implemented

Detailed Description

DtAggregatePatrolAlongController is a task controller responsible for executing DtPatrolAlongTasks in aggregate entities.

End User Description: DtAggregatePatrolAlongController models an aggregate's patrol-along <route> behavior. The behavior is implemented by issuing move-along subtasks to itself, alternating between forward and reverse directions along ther route. The DtAggregateMoveAlongController 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: DtAggregatePatrolAlongDescriptor


Member Enumeration Documentation

Enumerator:
DtMovingAlongRoute 
DtReversingDirection 

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)

destructor

copy constructor - not implemented


Member Function Documentation

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:
DtAggregatePatrolAlongControllerType

Implements DtTaskControllerComponent.

Override to cache a pointer to our DtFormationState and register formationStateChangedCallback to be invoked when formation state changes.

Reimplemented from DtControllerComponent.

virtual void DtDisaggregatedPatrolAlongController::tick ( ) [virtual]

Override to check and set myFirstTick flag.

Reimplemented from DtSimComponent.

Registers patrolAlongTaskCallback callback for DtPatrolRouteTasks.

Reimplemented from DtTaskControllerComponent.

Returns current task execution state (i.e.

what is our traversal direction). Creates and fills out a DtPatrolRouteTaskState object.

Reimplemented from DtSingleTaskControllerComponent.

static void DtDisaggregatedPatrolAlongController::patrolAlongTaskCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskStatePtr 
) [static]

Called upon reciept of DtPatrolRotueTasks.

Calls processPatrolAlongTask().

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

Called upon receipt of a DtTaskCompleteReport.

Calls onTaskComplete to process the message.

Parameters:
msgMessage containing a DtTaskCompleteReport.
usrPointer to an instance of this class.
static DtSimComponent* DtDisaggregatedPatrolAlongController::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 DtDisaggregatedPatrolAlongController::processPatrolAlongTask ( DtSimMessage msg,
DtSimTaskStatePtr  taskStatePtr 
) [protected, virtual]

Unpacks the incoming DtPatrolRouteTask and calls myMoveAlongController->moveAlong(), sets myReverseDirection to true, and calls startTask().

Parameters:
msgMessage containing a DtPatrolAlongTask.
virtual void DtDisaggregatedPatrolAlongController::onTaskComplete ( DtSimMessage msg) [protected, virtual]

If tasked() is true and report is for a DtMoveAlongTask type, send set heading request to reverse direction and sends new move along task to ourself to start moving in opposite direction along route.

Parameters:
msgMessage containing a DtTaskCompleteReport.
virtual bool DtDisaggregatedPatrolAlongController::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.

virtual DtIteratorDirection DtDisaggregatedPatrolAlongController::initialTraversalDirection ( const DtString routeName,
const DtVector initialWorldPosition 
) const [protected, virtual]

Determines initial traversal direction for patrol task.

Returns traversal in forward direction, unless closest vertex is the last vertex. If closest vertex is the last vertex, checks to see if aggregate is beyond the end of the route. If so, returns a traversal direction of reverse, otherwise returns traversal direction of forward.

Parameters:
routeNameObject name of the route we are following.
worldPositionInitial position in geocentric coordinates.
virtual void DtDisaggregatedPatrolAlongController::sendMoveAlongToSelf ( const DtString routeName,
enum DtIteratorDirection  traversalDirection,
bool  startAtClosestPoint 
) [protected, virtual]

Send move along task as subtask to ourself.

Parameters:
routeNameObject name of the route we are following.
traversalDirectionDirection to move along route. Increasing vertex index corresponds to forward direction, decreasing vertex index corresponds to reverse direction.
startAtClosestPointIf true, starts at nearest vertex, otherwise starts at logical beginning of route (which may be at the 'end', if the traversal direction is reverse).
DtDisaggregatedPatrolAlongController& DtDisaggregatedPatrolAlongController::operator= ( const DtDisaggregatedPatrolAlongController orig) [private]

assignment operator - not implemented


Member Data Documentation

const DtAggregatePatrolAlongDescriptor* DtDisaggregatedPatrolAlongController::myAggregatePatrolAlongDescriptor [protected]

Descriptor used to configure this component.

Aggregate's formation state, cached in this class for convenience.

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).


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)