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

DtWaitController is a controller that models waiting behavior ground and surface entities. More...

Inheritance diagram for DtWaitController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtWaitController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtWaitController ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Override to create the DtWaitingPSR process state repository.
virtual void tick ()
 See if we've waited long enough.
virtual void registerTaskMsgCallbacks ()
 Overrides this so it can register its interest in wait* commands.
virtual void processWaitTask (DtSimMessage *msg, DtSimTaskStatePtr taskState)
 Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of wait tasks.
virtual void processWaitDurationTask (DtSimMessage *msg, DtSimTaskStatePtr taskState)
 Sets the member variable myWaitTime to the current elapsed simulation time plus the seconds to wait indicated in the message.
virtual void processWaitElapsedTask (DtSimMessage *msg, DtSimTaskStatePtr taskState)
 Sets the member variable myWaitTime to the elapsed simulation time indicated in the message.
virtual DtSimTaskStatePtr currentTaskState () const
 Return the current state of our wait task.

Static Public Member Functions

static void waitCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
static void waitDurationCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
static void waitElapsedCallback (DtSimMessage *msg, void *usr, DtSimTaskStatePtr taskState)
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

 DtWaitController ()
 Default constructor; should not be called.
 DtWaitController (const DtWaitController &orig)
 copy constructor; shallow; does not copy the ports.
const DtWaitControlleroperator= (const DtWaitController &orig)
 assignment operator; see comments on copy constructor!
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.

Protected Attributes

DtWaitingPSRmyProcessState
 Container for state data associated with this component.

Detailed Description

DtWaitController is a controller that models waiting behavior ground and surface entities.

Developer Description: It registers for wait, wait duration, and wait elapsed messages and calls entity->taskComplete() when elapsed time or proper duration expires. It doesn't do anything with an actual wait.

Uses Descriptor Type: DtComponentDescriptor


Constructor & Destructor Documentation

DtWaitController::DtWaitController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

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

virtual DtWaitController::~DtWaitController ( ) [virtual]

destructor

Default constructor; should not be called.

Here because the compiler will generate an unprotected one otherwise.

copy constructor; shallow; does not copy the ports.


Member Function Documentation

virtual DtString DtWaitController::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.

Returns:
DtWaitControllerType

Implements DtTaskControllerComponent.

Reimplemented in DtDisaggregatedWaitController.

virtual bool DtWaitController::init ( ) [virtual]

Override to create the DtWaitingPSR process state repository.

Reimplemented from DtControllerComponent.

Reimplemented in DtDisaggregatedWaitController.

virtual void DtWaitController::tick ( ) [virtual]

See if we've waited long enough.

Checks the tasked() flag. If it is true, it checks the myWaitState member variable. If myWaitState is “Waiting” or “NotWaiting”, tick() returns. If myWaitState is “WaitingElapsed” or “WaitingDuration”, tick() checks to see if the current elapsed simulation time is greater than or equal to myWaitTime. If it is, tick() calls taskComplete(). If it is not, tick() returns.

Reimplemented from DtSimComponent.

Reimplemented in DtDisaggregatedWaitController.

virtual void DtWaitController::registerTaskMsgCallbacks ( ) [virtual]

Overrides this so it can register its interest in wait* commands.

Reimplemented from DtTaskControllerComponent.

Reimplemented in DtDisaggregatedWaitController.

virtual void DtWaitController::processWaitTask ( DtSimMessage msg,
DtSimTaskStatePtr  taskState 
) [virtual]

Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of wait tasks.

Sets the member variable myWaitTime to 0.0. It sets the member variable myWaitState to “Waiting”, calls startTask(), and deletes the task message.

Reimplemented in DtDisaggregatedWaitController.

virtual void DtWaitController::processWaitDurationTask ( DtSimMessage msg,
DtSimTaskStatePtr  taskState 
) [virtual]

Sets the member variable myWaitTime to the current elapsed simulation time plus the seconds to wait indicated in the message.

It sets the member variable myWaitState to “WaitingDuration”, calls startTask(), and deletes the task message.

Reimplemented in DtDisaggregatedWaitController.

virtual void DtWaitController::processWaitElapsedTask ( DtSimMessage msg,
DtSimTaskStatePtr  taskState 
) [virtual]

Sets the member variable myWaitTime to the elapsed simulation time indicated in the message.

It sets the member variable myWaitState to “WaitingElapsed”, calls startTask(), and deletes the task message.

Reimplemented in DtDisaggregatedWaitController.

Return the current state of our wait task.

Reimplemented from DtSingleTaskControllerComponent.

static void DtWaitController::waitCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskState 
) [static]
static void DtWaitController::waitDurationCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskState 
) [static]
static void DtWaitController::waitElapsedCallback ( DtSimMessage msg,
void *  usr,
DtSimTaskStatePtr  taskState 
) [static]
static DtSimComponent* DtWaitController::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.

Reimplemented in DtDisaggregatedWaitController.

const DtWaitController& DtWaitController::operator= ( const DtWaitController orig) [protected]

assignment operator; see comments on copy constructor!

virtual bool DtWaitController::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.


Member Data Documentation

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)