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

End User Description: The first time the controller is ticked will record the simulation time. More...

Inheritance diagram for DtLimitExistenceController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLimitExistenceController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtLimitExistenceController ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Initialize the component.
virtual void tick ()
 Calculate new control values.
virtual void setElapsedTimeSinceCreation (DtTime elapsedTime)
 Stored in the PSR, this keeps track of the amount of time that has passed since the entity was created.
virtual DtTime elapsedTimeSinceCreation () const
virtual void removeEntity ()
 When duration is reached, call removeEntity.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual bool createPSR ()
 Called by init to create the process state repository.
 DtLimitExistenceController ()
 Not implemented.
 DtLimitExistenceController (const DtLimitExistenceController &orig)
 Not implemented.
const DtLimitExistenceControlleroperator= (const DtLimitExistenceController &orig)
 Not implemented.

Protected Attributes

DtLimitExistencePSRmyProcessState
 Pointer to a process state repository used to store state data associated with this component.
const
DtLimitExistenceControllerDescriptor
myLimitExistenceDescriptor
 Descriptor for this component.
bool myFirstTick

Detailed Description

End User Description: The first time the controller is ticked will record the simulation time.

Each tick will updated the elapsed time since creation. In the descriptor for this controller is a duration parameter. This is the life time of the entity. The controller will keep track of time and when the entity has been in the simulation for the specified duration, this controller will remove the entity from the simulation. What this really means: Say you have a flare launcher. When it gets a DtLaunchCounterMeasuresTask it will create a flare entity in the simulation. You attach this controller component to it. In the descriptor you say 30 seconds. Once the entity is created this controller will count down the 30 seconds representing the flare buring in the sky. After 30 seconds the flare dies out so there is no longer any use for the flare entity. This controll hence removes it. Uses Descriptor Type: DtLimitExistenceControllerDescriptor


Constructor & Destructor Documentation

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

destructor

Not implemented.

Not implemented.


Member Function Documentation

virtual DtString DtLimitExistenceController::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:
DtLimitExistenceControllerType

Implements DtTaskControllerComponent.

virtual bool DtLimitExistenceController::init ( ) [virtual]

Initialize the component.

Calls createPSR()

Reimplemented from DtControllerComponent.

virtual void DtLimitExistenceController::tick ( ) [virtual]

Calculate new control values.

The first call to tick will restore the checkpointed value of myCurrentMunition and myCurrentFuze from the the munition loader of the DtVrfBalGunPSR.

Reimplemented from DtSimComponent.

virtual void DtLimitExistenceController::setElapsedTimeSinceCreation ( DtTime  elapsedTime) [virtual]

Stored in the PSR, this keeps track of the amount of time that has passed since the entity was created.

virtual DtTime DtLimitExistenceController::elapsedTimeSinceCreation ( ) const [virtual]
virtual void DtLimitExistenceController::removeEntity ( ) [virtual]

When duration is reached, call removeEntity.

This will queue the entity for removal from the simulation in the vrfObjectManager.

static DtSimComponent* DtLimitExistenceController::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 bool DtLimitExistenceController::createPSR ( ) [protected, virtual]

Called by init to create the process state repository.

This will save out how long the entity has left to live.

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

Not implemented.


Member Data Documentation

Pointer to a process state repository used to store state data associated with this component.

Stores the time the entity was created.

Descriptor for this component.

Allows user to specify how long the entity should exist for.


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)