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

The DtSimComponent class is the base class for the entire simulation model component hierarchy. More...

Inheritance diagram for DtSimComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtSimComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual ~DtSimComponent ()
 destructor
void setParentSystem (DtComponentSystem *system)
 Sets the parent system of this component.
virtual bool init ()
 Calls createPorts and createPortGroups Initializes myLastTickSimTime.
virtual bool postAddComponentsInit ()
 Called after all components have been created, initialized and added to the component manager.
virtual void tick ()
 This gives the thread of control to the component.
virtual void postTick ()
 This function is called immediately after tick() is called.
virtual void timedTick ()
 This version of tick checks to see if the time to tick has arrived.
virtual void setMinTickPeriod (double minTickPeriod)
 specifies a minimum tick period (which can also be thought of as
virtual double minTickPeriod () const
 access the minimum tick period
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 set the variance in the minimum tick time
virtual double minTickPeriodVariance () const
 access the variance in the minimum tick period
virtual void setNextTickTime (double nextTickTime)
 The next tick time is normally calculated internally.
virtual double nextTickTime () const
 access the next tick time
virtual double calculateNextTickTime () const
 The next tick time is equal to mySimManager->exerciseClock()-> approximateElapsedRealTime() + myMinTickPeriod + a random # between -myMinTickPeriodVariance/2.
virtual double calculateFirstTickTime () const
 Returns the first time value that the component should tick at.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void setEntity (DtVrfObject *entity)
 The entity's state repository is the place that actuator components make updates and other components look to see our current state.
virtual DtSimComponentnextComponent ()
 List management functions.
virtual DtSimComponentprevComponent ()
virtual void setListItem (DtListItem *item)
 Used by DtComponentList.
virtual DtListItem * listItem ()
virtual void putData (FILE *fp, int indentLevel=0)
 putData writes our type, which is provided by the virtual type accessor of the deriving class.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 getData is just used to get us past the type in the data stream, since it's not actual stored.
virtual void addInputPort (DtInputPort *port)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPort (DtInputPort *port)
virtual DtInputPortlookupInputPort (const DtString &portName)
 Returns a pointer to the input port registered on this component with the specified name.
virtual DtList inputPortList () const
 Returns the list of DtInputPorts registered on this component.
virtual void addOutputPort (DtOutputPort *port)
 Adds this output port to the components output port list so that other components can look it up and attach to it.
virtual void removeOutputPort (DtOutputPort *port)
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 Returns a pointer to the output port registered on this component with the specified name.
virtual DtList outputPortList () const
 Returns the list of DtOutputPorts registered on this component.
virtual void addInputPortGroup (DtInputPortGroup *group)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPortGroup (DtInputPortGroup *group)
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 Returns a pointer the input port group registered on this component with the specified name.
virtual DtList inputPortGroupList () const
 Returns the list of DtInputPortGroups registered on this component.
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 Adds this output port group to the components output port group list so that other components can look it up and attach to it.
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 Returns a pointer the output port group registered on this component with the specified name.
virtual DtList outputPortGroupList () const
 Returns the list of DtOutputPortGroups registered on this component.
virtual int priority () const
 Return the current connection priority for this component.
virtual void setPriority (int priority)
 Sets a new connection priority for this component, and changes all current outgoing connections from this component to the new value.
double dT () const
 This is the delta-t for this component, which may or may not be the same as the exerciseClock dT.
virtual void setDT (double deltaT)
 Note that while dT is calculated internally, this makes it possible to 'lie' to the component about dT if necessary.
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 The component descriptor specified in the order of battle file or parameter file that was used to create this component.
virtual const
DtComponentDescriptor
componentDescriptor () const
virtual bool tickWhileDestroyed () const
 If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.
DtVrfProcessStateRepositoryManagerpsrManager ()
virtual DtString componentFullName () const
virtual void enable ()
 Is this component enabled or not.
virtual void disable ()
 Is this component enabled or not.
virtual bool isEnabled ()
 Is this component enabled or not.
virtual void setIsEnabled (bool yesNo)
 Is this component enabled or not.
virtual DtOutputStream & objectConsoleDebug () const
virtual DtOutputStream & objectConsoleVerbose () const
virtual DtOutputStream & objectConsoleInfo () const
virtual DtOutputStream & objectConsoleWarn () const
virtual DtOutputStream & objectConsoleError () const
virtual DtSimResourceManagerresourceManager ()
virtual const
DtSimResourceManager
resourceManager () const

Static Public Member Functions

static DtSimComponentFactoryfactory ()
 A DtSimComponentFactory is allocated by the DtSimCreator, and this pointer is set.
static void setFactory (DtSimComponentFactory *factory)
static DtSimComponentcreateComponent (const DtString &name, const DtString &type, DtVrfObject *owner, DtSimManager *simManager, DtComponentSystem *parentSystem, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 Creates a DtSimComponent using the factory, then initializes it via the MTL stream.
static void addSimComponentCreatorFcn (const DtString &type, DtSimComponentCreatorFcn fcn)
 Adds a DtSimComponent creation function to the DtSimComponentFactory, using the given type as the key.

Protected Types

typedef std::map< DtString,
DtInputPort * > 
DtInputPortMap
typedef std::map< DtString,
DtOutputPort * > 
DtOutputPortMap
typedef std::map< DtString,
DtInputPortGroup * > 
DtInputPortGroupMap
typedef std::map< DtString,
DtOutputPortGroup * > 
DtOutputPortGroupMap

Protected Member Functions

bool testInvariant () const
virtual bool createPortGroups ()
 Called by init.
virtual bool createPorts ()
 Called by init.
virtual DtPhysicalWorldphysicalWorld ()
 Gets the physical world that this component's entity exists in.
virtual const DtPhysicalWorldphysicalWorld () const
virtual DtAttachedTerrainterrainAttachedTo ()
 Gets the terrain that this component's entity is attached to, if any.
virtual const DtAttachedTerrainterrainAttachedTo () const
virtual DtVrfObjectentity ()
 Gets the entity.
virtual const DtVrfObjectentity () const
virtual DtSimManagersimManager ()
 Gets the sim manager.
virtual const DtSimManagersimManager () const
virtual const Coordinate_SystemcoordinateSystem () const
 Gets the coordinate system, as it should always exist if the physical world is in a valid state!
virtual Coordinate_SystemcoordinateSystem ()
virtual
DtVrfObjectStateRepository
localStateRepository ()
 Gets the local state repository.
virtual const
DtVrfObjectStateRepository
localStateRepository () const

Protected Attributes

DtVrfObjectmyEntity
DtVrfObjectStateRepositorymyLocalStateRepository
DtSimManagermySimManager
DtComponentSystemmySystem
 Pointer to the DtComponentSystem that this component belongs.
DtListItem * myListItem
DtInputPortMap myInputPortList
DtOutputPortMap myOutputPortList
DtInputPortGroupMap myInputPortGroupList
DtOutputPortGroupMap myOutputPortGroupList
int myPriority
double myMinTickPeriod
double myMinTickPeriodVariance
double myNextTickTime
double myLastTickSimTime
double myDT
bool myIsEnabled
 Indiates whether this component should be enabled for ticking or not.
const DtComponentDescriptormyComponentDescriptor

Static Protected Attributes

static DtSimComponentFactorymyFactory

Private Member Functions

 DtSimComponent ()
 default constructor; should not be called.
 DtSimComponent (const DtSimComponent &orig)
 copy constructor, not implemented
DtSimComponentoperator= (const DtSimComponent &orig)
 assignment operator, not implemented

Detailed Description

The DtSimComponent class is the base class for the entire simulation model component hierarchy.

****** NOTE of API change for version 3.7 ****** Due to a performance enhancement change, the myComponentDescriptor member variable is now defined to be const and all access to this descriptor (including the componentDescriptor() method) have been changed to be const access. If you have used this descriptor to modify values within the descriptor (either in the original descriptor or a derived descriptor class), this modification will effect all entities that share this descriptor as this descriptor now points to the original parameter database entry.

If you currently modify member variables in a descriptor class, it is suggested to instead make those member variables part of the component that uses them and modify them there. If you must modify the entries in the component descriptor, instead of using the supplied descriptor pointer, you will need to clone the descriptor entry and work with that clone. You will also need to delete this clone in your component destructor to avoid a memory leak.

Examples

Member Typedef Documentation

typedef std::map<DtString, DtInputPort*> DtSimComponent::DtInputPortMap [protected]
typedef std::map<DtString, DtOutputPort*> DtSimComponent::DtOutputPortMap [protected]

Constructor & Destructor Documentation

DtSimComponent::DtSimComponent ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)
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).
virtual DtSimComponent::~DtSimComponent ( ) [virtual]

destructor

default constructor; should not be called.

Here because the compiler will generate an unprotected one otherwise.

DtSimComponent::DtSimComponent ( const DtSimComponent orig) [private]

copy constructor, not implemented


Member Function Documentation

Sets the parent system of this component.

This is called before init() when the component is created. Non-virtual since this will probably be moved to the constructor some day, and we don't want to have users overriding this method.

virtual bool DtSimComponent::init ( ) [virtual]

Calls createPorts and createPortGroups Initializes myLastTickSimTime.

Reimplemented in DtTargetSelectionController, DtDisaggregatedFormationController, DtDisaggregatedMoveAlongController, DtSurfaceEntityPilotController, DtDamageAdjudicationActuator, DtRailPathController, DtPathMovementController, BHAVE::DtBhaveMovementChooserController, DtFixedWingEmbarkationController, DtDIGuyController, DtObjectSensor, BHAVE::DtSpawnController, DtTurretAcquireController, DtWeaponController, DtLauncherController, DtGroundMovementChooserController, DtMissileDistractionController, DtBallisticGunController, DtSpotReportGeneratorController, BHAVE::DtKynapseGroundPlatformController, DtDisaggregatedEmbarkationController, DtWeaponActuator, DtActuatorComponent, DtDisaggregatedMoveIntoFormationController, DtObstructionSensor, DtSimpleRotaryWingPilot, DtSurfaceEntityActuator, DtEmitterComponent, DtSurfaceEntityMoveAlongController, DtDetonationController, DtLaunchExpendableResourceController, DtWarheadDetonationActuator, BHAVE::DtKynapseController, DtCruiseMissileLaunchController, DtDisaggregatedOccupancyDirectorController, BHAVE::DtKynapseLifeformController, DtDisaggregatedPatrolAlongController, DtDisaggregatedMoveToLocationController, DtFixedWingTakeoffController, DtRadarObjectSensor, DtSignatureObjectSensor, DtAutomotiveActuatorComponent, DtFixedWingActuatorComponent, DtHumanMovementActuator, DtOccupancyDirectorController, DtRailMovementController, BHAVE::DtBhaveMoveDirectionController, DtAggregatedMoveToController, DtAggregatedPatrolController, DtFixedWingPilotController, DtHumanPatrolController, DtLimitExistenceController, DtOrganizationController, DtTurretSlewController, DtBallisticGun, DtConvoyTaskController, DtHumanCollisionAvoidanceController, DtHumanMoveAlongController, DtLaunchSmokeController, DtContactFusionController, DtAirVehicleWeaponHoldController, DtGroundCollisionAvoidanceController, DtLaserGuidedLauncherController, DtLauncherActuator, DtRotaryWingActuatorComponent, DtSpotReportReceiver, DtDisaggregatedWaitController, DtEmbarkationController, DtGroundMoveToDestinationControllerComponent, DtHumanMoveToController, DtLasingMissileTrackController, DtUnderFireDeterminationSensor, DtFallingFromSkyActuatorComponent, DtFixedWingLandingController, DtHumanFollowController, DtTurretScanController, DtGroundMoveDirectionController, DtMissileCollisionActuator, DtMissileManeuverActComponent, DtTopLevelOrganizationController, DtWaitController, DtDisaggregatedPatrolBetweenController, DtLasingController, DtRotaryWingWaitController, DtHumanPostureController, DtSwingingPartActuator, DtControllerComponent, DtAggregatedSetController, DtDefaultLandingGearController, DtFixedWingDefaultController, DtGroundAutoControllerComponent, DtHumanLauncherAcquireController, DtIndirectFireController, DtRotaryWingPilotController, DtCombatRangeController, DtIntegratedLaserGuidedLauncherController, DtMissileControllerComponent, DtDisaggregatedSetController, DtGlobalEnvironmentActuator, DtIndirectArtilleryComponent, DtAggregateModelResolutionController, DtAutoAggregateDisaggregateController, DtFixedWingFlightCommandController, DtMovementBasedTerrainPreloadController, DtBaseWeaponController, DtShapeBasedTerrainPreloadController, DtVrfObjectDataMessenger, DtHumanEyepointController, DtLocalEntitySetController, DtRotaryWingFlightCommandController, DtRotaryWingJoyFlightController, DtRotaryWingTaskController, DtRotaryWingMoveAlongControllerComponent, DtCruiseMissileDefaultController, DtHumanAcquireController, DtIffControllerComponent, DtAggregatedMoveAlongController, DtHumanTurnToController, DtSendRadioMessageController, DtTurnAndMoveController, DtRotaryWingCollisionAvoidanceController, DtHumanAimWeaponController, DtHumanStopMovingController, DtLaserDetector, DtAggregatedMovementActuator, DtIndividualLifeFormDamageAdjudicationActuator, DtMultipleHitDamageActuator, DtTimeKeeperComponent, DtSimpleRadarWarningReceiver, DtSystemSwitcherComponent, and MyActuatorComponent.

virtual bool DtSimComponent::postAddComponentsInit ( ) [inline, virtual]
virtual void DtSimComponent::enable ( ) [virtual]

Is this component enabled or not.

If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

Reimplemented in DtEmbarkationController, DtDisaggregatedFormationController, DtTaskControllerComponent, DtLocalEntitySetController, DtAggregateModelResolutionController, DtSystemSwitcherComponent, and DtAggregatedSetController.

virtual void DtSimComponent::disable ( ) [virtual]

Is this component enabled or not.

If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

Reimplemented in DtEmbarkationController, DtTaskControllerComponent, DtDisaggregatedFormationController, DtLocalEntitySetController, DtAggregateModelResolutionController, DtSystemSwitcherComponent, and DtAggregatedSetController.

virtual bool DtSimComponent::isEnabled ( ) [virtual]

Is this component enabled or not.

If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

virtual void DtSimComponent::setIsEnabled ( bool  yesNo) [virtual]

Is this component enabled or not.

If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).

virtual void DtSimComponent::tick ( ) [virtual]

This gives the thread of control to the component.

The component is ticked once each simulation from by the component list it's on. This base class tick has no functionality.

Reimplemented in DtBaseWeaponController, DtDamageAdjudicationActuator, vrfLua::DtLuaScriptController, DtTargetSelectionController, DtRailPathController, DtPathMovementController, DtSurfaceEntityFollowEntityController, BHAVE::DtKynapseController, BHAVE::DtSpawnController, DtSurfaceEntityActuator, DtDisaggregatedMoveAlongController, DtDisaggregatedEmbarkationController, DtRotaryWingFollowEntityController, DtConvoyTaskController, DtDisaggregatedFormationController, DtSurfaceEntityPilotController, DtLocalEntitySetController, DtObjectSensor, BHAVE::DtBhaveMovementChooserController, DtDIGuyController, DtRetreatController, DtWarheadDetonationActuator, DtFixedWingTakeoffController, DtOccupancyDirectorController, DtWeaponController, DtMissileDistractionController, DtCruiseMissileLaunchController, DtLauncherController, DtSignatureObjectSensor, DtFixedWingLandingController, DtRadarObjectSensor, DtSpotReportGeneratorController, DtSurfaceEntityMoveToController, DtObstructionSensor, DtSimpleRotaryWingPilot, DtVrfObjectDataMessenger, DtTurretAcquireController, DtWeaponActuator, DtBallisticGunController, DtUnderFireDeterminationSensor, DtEmbarkationController, DtTurnAndMoveController, DtBallisticGun, DtTurretActuatorComponent, DtDisaggregatedMoveIntoFormationController, DtDetonationController, DtLaunchExpendableResourceController, DtFixedWingActuatorComponent, DtHumanCollisionAvoidanceController, DtLaserGuidedLauncherController, DtAutomotiveActuatorComponent, DtCombatRangeController, DtTurretSlewController, DtDisaggregatedPatrolAlongController, DtGroundCollisionAvoidanceController, DtHumanMoveAlongController, DtHumanMovementActuator, DtIndirectFireController, DtOrganizationController, DtRailMovementController, DtContactFusionController, DtGroundMoveToDestinationControllerComponent, DtAggregatedMoveToController, DtLasingController, DtAggregateOrganizationController, DtBaseMountingController, DtDisaggregatedPatrolBetweenController, DtFixedWingPilotController, DtHumanFollowController, DtLimitExistenceController, DtAirVehicleWeaponHoldController, DtRotaryWingActuatorComponent, DtWaitController, DtFallingFromSkyActuatorComponent, DtFixedWingMoveAlongController, DtRotaryWingWaitController, DtSpotReportReceiver, DtAggregateModelResolutionController, DtHumanMoveToController, DtIndirectArtilleryComponent, DtLaunchSmokeController, DtMissileCollisionActuator, DtSwingingPartActuator, DtTopLevelOrganizationController, DtEmitterComponent, DtMissileManeuverActComponent, DtGroundMoveDirectionController, DtBallisticGunJoy, DtDisaggregatedWaitController, DtHumanAcquireController, DtDefaultLandingGearController, DtHumanPostureController, DtIndirectFireActuator, DtTurretScanController, DtFixedWingFollowEntityController, DtIndividualLifeFormDamageAdjudicationActuator, DtLaserDetector, DtAutoAggregateDisaggregateController, DtGroundOrbitController, DtFixedWingDefaultController, DtHumanWeaponStateActuator, DtRotaryWingPilotController, DtSimpleRadarWarningReceiver, DtFixedWingFlightCommandController, DtIntegratedLaserGuidedLauncherController, DtMountingAzimuthActuator, DtMountingElevationActuator, DtRotaryWingLandingController, DtRotaryWingTurnToHeadingController, DtBallisticGunJoyController, DtDisaggregatedActuator, DtHumanEyepointController, DtMissileMoveToControllerComponent, DtRotaryWingPatrolBetweenController, DtGlobalEnvironmentActuator, DtGroundStopMovingControllerComponent, DtAggregatedMoveAlongController, DtHumanTurnToController, DtTimeKeeperComponent, DtCruiseMissileDefaultController, DtDisaggregatedMoveToController, DtFixedWingJoyFlightController, DtRotaryWingJoyFlightController, DtRotaryWingMoveAlongControllerComponent, DtDisaggregatedDamageActuator, DtGroundMoveAlongControllerComponent, DtHumanAimWeaponController, DtHumanStopMovingController, DtIffControllerComponent, DtRotaryWingFlightCommandController, DtRotaryWingLoiterControllerComponent, DtAggregatedMovementActuator, DtFixedWingMoveToController, DtGroundTurnToControllerComponent, DtMultipleHitDamageActuator, DtTacticalSmokeActuator, DtRotaryWingCollisionAvoidanceController, DtRotaryWingMoveToControllerComponent, DtSendRadioMessageController, DtHumanJoystickMovementController, DtGroundJoyMoveController, DtSystemSwitcherComponent, DtGroundJoyTurretController, DtSimpleRadarWarningResponse, and MyActuatorComponent.

virtual void DtSimComponent::postTick ( ) [virtual]

This function is called immediately after tick() is called.

Implementation in this class does nothing.

Reimplemented in DtTaskControllerComponent, DtMultiTaskControllerComponent, and DtSingleTaskControllerComponent.

virtual void DtSimComponent::timedTick ( ) [virtual]

This version of tick checks to see if the time to tick has arrived.

It checks to see if myNextTickTime <= currentTime, where current time is either exerciseClock()->approximateElapsedRealTime() or exerciseClock()->simTime() depending on the tick-period-uses-real-time parameter. If true, it calls tick(), then calls postTick(), and then recalculates the next time to call timedTick() (myNextTickTime) by calling calculateNextTickTime().

virtual void DtSimComponent::setMinTickPeriod ( double  minTickPeriod) [virtual]

specifies a minimum tick period (which can also be thought of as

  1. / maximum tick rate). This is specified in seconds.
virtual double DtSimComponent::minTickPeriod ( ) const [virtual]

access the minimum tick period

virtual void DtSimComponent::setMinTickPeriodVariance ( double  minTickPeriodVariance) [virtual]

set the variance in the minimum tick time

virtual double DtSimComponent::minTickPeriodVariance ( ) const [virtual]

access the variance in the minimum tick period

virtual void DtSimComponent::setNextTickTime ( double  nextTickTime) [virtual]

The next tick time is normally calculated internally.

setNextTickTime can be used to force a tick (set nextTickTime to exerciseClock()-> approximateElapsedRealTime())

virtual double DtSimComponent::nextTickTime ( ) const [virtual]

access the next tick time

virtual double DtSimComponent::calculateNextTickTime ( ) const [virtual]

The next tick time is equal to mySimManager->exerciseClock()-> approximateElapsedRealTime() + myMinTickPeriod + a random # between -myMinTickPeriodVariance/2.

and +myMinTickPeriodVariance/2. If the exercise clock is paused, the variance is always set to zero to insure that the extra calls to DtFRand() don't prevent repeatability.

virtual double DtSimComponent::calculateFirstTickTime ( ) const [virtual]

Returns the first time value that the component should tick at.

This is a randomized interval from the current time up to the tick period of the component. Returns either real time or sim time, depending on the value of the tickPeriodUsesRealTime flag in the descriptor.

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

Reimplemented in DtDamageAdjudicationActuator, DtHumanCollisionAvoidanceController, DtTargetSelectionController, DtDisaggregatedFormationController, DtRailPathController, DtGroundCollisionAvoidanceController, DtPathMovementController, DtSurfaceEntityPilotController, DtDisaggregatedMoveAlongController, DtObstructionSensor, DtWarheadDetonationActuator, DtObjectSensor, DtMultipleHitDamageActuator, DtGroundMovementChooserController, DtLauncherController, DtDIGuyController, DtMissileDistractionController, vrfLua::DtLuaScriptController, DtSpotReportGeneratorController, DtVrfObjectDataMessenger, DtWeaponActuator, BHAVE::DtKynapseGroundPlatformController, DtSimpleRotaryWingPilot, DtSurfaceEntityActuator, DtUnderFireDeterminationSensor, DtEmitterComponent, DtTurretAcquireController, DtSurfaceEntityMoveAlongController, DtBallisticGun, DtGroundMoveToDestinationControllerComponent, DtSurfaceEntityPatrolRouteController, DtTurretActuatorComponent, DtWeaponController, DtFixedWingTakeoffController, DtIndirectFireActuator, BHAVE::DtKynapseController, DtBallisticGunController, DtFixedWingPilotController, BHAVE::DtKynapseLifeformController, DtRadarObjectSensor, DtSignatureObjectSensor, DtDisaggregatedMoveIntoFormationController, DtFixedWingMoveAlongController, DtAutomotiveActuatorComponent, DtFixedWingActuatorComponent, DtHumanMovementActuator, DtTaskControllerComponent, DtRetreatController, DtOccupancyDirectorController, BHAVE::DtBhaveMoveDirectionController, DtOrganizationController, DtSurfaceEntityPatrolBetweenController, DtTurretSlewController, DtAggregatedMoveToController, DtConvoyTaskController, DtDetonationController, DtHumanMoveAlongController, DtContactFusionController, DtCruiseMissileLaunchController, DtIndirectFireController, DtAirVehicleWeaponHoldController, DtDisaggregatedMoveToLocationController, DtDisaggregatedPatrolAlongController, DtFixedWingLandingController, DtLauncherActuator, DtRotaryWingActuatorComponent, DtRotaryWingCollisionAvoidanceController, DtSpotReportReceiver, DtEmbarkationController, DtAggregateModelResolutionController, DtAggregateOrganizationController, DtBaseWeaponController, DtCulturalFeatureSetController, DtDisaggregatedEmbarkationController, DtFallingFromSkyActuatorComponent, DtHumanMoveToController, DtIndirectArtilleryComponent, DtSwingingPartActuator, DtFixedWingFlyIntoController, DtFixedWingDefaultController, DtGroundMoveToControllerComponent, DtGroundMoveDirectionController, DtMissileCollisionActuator, DtMissileManeuverActComponent, DtRailMovementController, DtRotaryWingPilotController, DtSurfaceEntityMoveToLocationController, DtTopLevelOrganizationController, DtDisaggregatedPatrolBetweenController, DtFixedWingFlightCommandController, DtHumanAcquireController, DtLasingController, DtRotaryWingLandingController, DtRotaryWingTurnToHeadingController, DtAggregatedPatrolController, DtAirVehicleSetController, DtHumanPatrolController, DtLimitExistenceController, DtMissileMoveToControllerComponent, DtRotaryWingPatrolBetweenController, DtSurfaceEntityFollowEntityController, DtDefaultLandingGearController, DtGlobalEnvironmentActuator, DtGroundAutoControllerComponent, DtGroundPatrolRouteController, DtGroundStopMovingControllerComponent, DtHumanLauncherAcquireController, DtHumanPostureController, DtMissileTrackEntityController, DtDisaggregatedWaitController, DtFixedWingPatrolRouteController, DtGroundFollowEntityController, DtGroundInterceptAndDestroyController, DtMissileControllerComponent, DtRotaryWingPatrolRouteController, DtBaseMountingController, DtCruiseMissileDefaultController, DtDisaggregatedMoveToController, DtFixedWingJoyFlightController, DtLaserGuidedLauncherController, DtLasingMissileTrackController, DtRotaryWingJoyFlightController, DtRotaryWingMoveAlongControllerComponent, DtSurfaceEntityMoveToController, DtTurretScanController, DtAutoAggregateDisaggregateController, DtFixedWingFollowEntityController, DtGroundPatrolBetweenController, DtHumanFollowController, DtIffControllerComponent, DtMovementBasedTerrainPreloadController, DtRotaryWingFlightCommandController, DtRotaryWingFollowEntityController, DtRotaryWingLoiterControllerComponent, BHAVE::DtSpawnController, DtDisaggregatedOccupancyDirectorController, DtDisaggregatedTurnToHeadingController, DtFixedWingMoveToController, DtFixedWingPatrolBetweenController, DtGroundTurnToControllerComponent, DtShapeBasedTerrainPreloadController, DtWaitController, DtTurnAndMoveController, DtHumanEyepointController, DtHumanSetController, DtLocalEntitySetController, DtMountingAzimuthActuator, DtMountingElevationActuator, DtRotaryWingMoveToControllerComponent, DtRotaryWingWaitController, DtFixedWingEntitySetController, DtHumanJoystickMovementController, DtRotaryWingTaskController, DtControllerComponent, DtBallisticGunJoy, DtHumanWeaponStateActuator, DtIndirectFireWeaponController, DtAggregatedMoveAlongController, DtDisaggregatedActuator, DtDisaggregatedSetController, DtFixedWingEmbarkationController, DtGroundJoyMoveController, DtGroundMoveToLocationControllerComponent, DtHumanTurnToController, DtBallisticGunJoyController, DtGroundOrbitController, DtHumanAimWeaponController, DtIntegratedLaserGuidedLauncherController, DtGroundJoyTurretController, DtHumanStopMovingController, DtIndividualLifeFormDamageAdjudicationActuator, DtLaunchExpendableResourceController, DtMountingController, DtAggregatedMovementActuator, DtCruiseMissileMoveAlongController, DtGroundMoveAlongControllerComponent, DtTacticalSmokeActuator, DtDisaggregatedDamageActuator, DtFixedWingMoveToLocationController, DtLaunchSmokeController, DtRotaryWingEmbarkationController, DtRotaryWingMoveToLocationControllerComponent, DtSendRadioMessageController, DtHumanObstructionSensor, DtSystemSwitcherComponent, DtVerticalLauncherController, DtCombatRangeController, DtSimpleRadarWarningResponse, DtTimeKeeperComponent, and MyActuatorComponent.

virtual void DtSimComponent::setEntity ( DtVrfObject entity) [virtual]

The entity's state repository is the place that actuator components make updates and other components look to see our current state.

This provides a basic communication mechanism between components. Having the entity changeable makes it possible to migrate a component from one entity to another... A local copy of the entity's state repository is also made by this call for ease of use.

Reimplemented in DtLaserDetector, and DtSimpleRadarWarningReceiver.

List management functions.

virtual void DtSimComponent::setListItem ( DtListItem *  item) [virtual]

Used by DtComponentList.

virtual DtListItem* DtSimComponent::listItem ( ) [virtual]
virtual void DtSimComponent::putData ( FILE *  fp,
int  indentLevel = 0 
) [virtual]

putData writes our type, which is provided by the virtual type accessor of the deriving class.

Reimplemented from DtReaderWriter.

virtual DtlObjPtr DtSimComponent::getData ( DtlObjPtr  args,
const DtFilename &  searchPath,
const DtVariableBindingsList variableBindings 
) [virtual]

getData is just used to get us past the type in the data stream, since it's not actual stored.

virtual void DtSimComponent::addInputPort ( DtInputPort port) [virtual]

Adds this input port to the components input port list so that other components can look it up and attach to it.

virtual void DtSimComponent::removeInputPort ( DtInputPort port) [virtual]
virtual DtInputPort* DtSimComponent::lookupInputPort ( const DtString portName) [virtual]

Returns a pointer to the input port registered on this component with the specified name.

portName can specify a group and port in the form "groupname:portname" which will cause this function to look for the port inside the specified group.

virtual DtList DtSimComponent::inputPortList ( ) const [virtual]

Returns the list of DtInputPorts registered on this component.

virtual void DtSimComponent::addOutputPort ( DtOutputPort port) [virtual]

Adds this output port to the components output port list so that other components can look it up and attach to it.

virtual void DtSimComponent::removeOutputPort ( DtOutputPort port) [virtual]
virtual DtOutputPort* DtSimComponent::lookupOutputPort ( const DtString portName) [virtual]

Returns a pointer to the output port registered on this component with the specified name.

portName can specify a group and port in the form "groupname:portname" which will cause this function to look for the port inside the specified group.

virtual DtList DtSimComponent::outputPortList ( ) const [virtual]

Returns the list of DtOutputPorts registered on this component.

virtual void DtSimComponent::addInputPortGroup ( DtInputPortGroup group) [virtual]

Adds this input port to the components input port list so that other components can look it up and attach to it.

virtual void DtSimComponent::removeInputPortGroup ( DtInputPortGroup group) [virtual]
virtual DtInputPortGroup* DtSimComponent::lookupInputPortGroup ( const DtString groupName) [virtual]

Returns a pointer the input port group registered on this component with the specified name.

virtual DtList DtSimComponent::inputPortGroupList ( ) const [virtual]

Returns the list of DtInputPortGroups registered on this component.

virtual void DtSimComponent::addOutputPortGroup ( DtOutputPortGroup group) [virtual]

Adds this output port group to the components output port group list so that other components can look it up and attach to it.

virtual void DtSimComponent::removeOutputPortGroup ( DtOutputPortGroup group) [virtual]
virtual DtOutputPortGroup* DtSimComponent::lookupOutputPortGroup ( const DtString groupName) [virtual]

Returns a pointer the output port group registered on this component with the specified name.

virtual DtList DtSimComponent::outputPortGroupList ( ) const [virtual]

Returns the list of DtOutputPortGroups registered on this component.

virtual int DtSimComponent::priority ( ) const [virtual]

Return the current connection priority for this component.

This value determines which component will take precedence when multiple connections attempts are active on the same input port. Lower numbers will take precedence. By default, component priorities are based on the order they were listed in the OPD entry, starting with 0.

virtual void DtSimComponent::setPriority ( int  priority) [virtual]

Sets a new connection priority for this component, and changes all current outgoing connections from this component to the new value.

By default, component priorities are based on the order they were listed in the OPD entry, starting with 0. It is only necessary to use this method if components are being added or removed after object-creation time.

double DtSimComponent::dT ( ) const [inline]

This is the delta-t for this component, which may or may not be the same as the exerciseClock dT.

Note that dT() is not virtual, as it is inlined.

Returns:
time in seconds

References myDT.

virtual void DtSimComponent::setDT ( double  deltaT) [virtual]

Note that while dT is calculated internally, this makes it possible to 'lie' to the component about dT if necessary.

Parameters:
Input
deltaTtime in seconds
virtual void DtSimComponent::setComponentDescriptor ( DtComponentDescriptor componentDescriptor) [virtual]
virtual const DtComponentDescriptor* DtSimComponent::componentDescriptor ( ) const [virtual]
virtual bool DtSimComponent::tickWhileDestroyed ( ) const [virtual]

If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.

Otherwise, tick will only be called when the entity is alive.

Returns:
false.

Reimplemented in vrfLua::DtLuaScriptController, DtDIGuyController, DtObjectSensor, DtOrganizationController, DtUnderFireDeterminationSensor, DtAggregateModelResolutionController, DtActuatorComponent, DtRailMovementController, DtEmitterComponent, DtSpotReportReceiver, and DtFixedWingLandingController.

virtual DtOutputStream& DtSimComponent::objectConsoleDebug ( ) const [virtual]
Returns:
The stream that is routed to the owning object's console.
virtual DtOutputStream& DtSimComponent::objectConsoleVerbose ( ) const [virtual]
Returns:
The stream that is routed to the owning object's console.
virtual DtOutputStream& DtSimComponent::objectConsoleInfo ( ) const [virtual]
Returns:
The stream that is routed to the owning object's console.
virtual DtOutputStream& DtSimComponent::objectConsoleWarn ( ) const [virtual]
Returns:
The stream that is routed to the owning object's console.
virtual DtOutputStream& DtSimComponent::objectConsoleError ( ) const [virtual]
Returns:
The stream that is routed to the owning object's console.
Returns:
The PSR manager that should be used by this component. This will be the PSR manager that is owned by the component's parent system. Non-virtual so that it can be used by the destructor.
Returns:
A pointer to the resource manager of the system that this component is part of.
virtual const DtSimResourceManager& DtSimComponent::resourceManager ( ) const [virtual]
Returns:
A pointer to the resource manager of the system that this component is part of.
virtual DtString DtSimComponent::componentFullName ( ) const [virtual]
Returns:
A string that uniquely names this component on the entity. The name will be composed of the systems containing this component, and the reader-writer name of this component.

A DtSimComponentFactory is allocated by the DtSimCreator, and this pointer is set.

The DtSimCreator deletes this pointer when it is deleted. This is done this way because we don't allow static initialization.

Reimplemented from DtReaderWriter.

static void DtSimComponent::setFactory ( DtSimComponentFactory factory) [static]
static DtSimComponent* DtSimComponent::createComponent ( const DtString name,
const DtString type,
DtVrfObject owner,
DtSimManager simManager,
DtComponentSystem parentSystem,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

Creates a DtSimComponent using the factory, then initializes it via the MTL stream.

static void DtSimComponent::addSimComponentCreatorFcn ( const DtString type,
DtSimComponentCreatorFcn  fcn 
) [static]

Adds a DtSimComponent creation function to the DtSimComponentFactory, using the given type as the key.

The type string is one of the types defined in compTypes.h.

Parameters:
typeType identifying particular derived type of DtSimComponent
fcnCreation function that instantiates a new DtSimComponent.
bool DtSimComponent::testInvariant ( ) const [protected]
Returns:
A boolean indicating whether or not the class invariant remains valid or not. Should always be true at the beginning of every public member function, and also at the end of all non-const public member functions.
virtual bool DtSimComponent::createPortGroups ( ) [protected, virtual]
virtual bool DtSimComponent::createPorts ( ) [protected, virtual]

Called by init.

Derived classes should override this method to create all their input/output ports and port groups.

Reimplemented in DtAutomotiveActuatorComponent, DtFixedWingPilotController, DtGroundMoveToDestinationControllerComponent, DtFixedWingActuatorComponent, DtHumanCollisionAvoidanceController, DtWeaponController, DtGroundCollisionAvoidanceController, DtHumanFollowController, DtBallisticGun, DtObstructionSensor, DtSurfaceEntityActuator, DtSurfaceEntityPilotController, DtHumanMovementActuator, DtAggregatedMoveToController, DtSimpleRotaryWingPilot, DtDIGuyController, DtBaseWeaponController, DtGroundAutoControllerComponent, DtLauncherController, vrfLua::DtLuaScriptController, DtHumanMoveToController, DtTargetSelectionController, DtBaseMountingController, DtGroundInterceptAndDestroyController, DtIndirectFireActuator, BHAVE::DtBhaveMovementChooserController, DtWeaponActuator, DtGroundFollowEntityController, DtMissileControllerComponent, DtBallisticGunController, BHAVE::DtKynapseController, DtDetonationController, DtHumanMoveAlongController, DtSpotReportGeneratorController, DtObjectSensor, DtRotaryWingPilotController, DtHumanAcquireController, DtTurretAcquireController, DtTurretSlewController, DtAggregatedMoveAlongController, DtFixedWingLandingController, DtTurretActuatorComponent, DtRotaryWingActuatorComponent, BHAVE::DtKynapseGroundPlatformController, DtWarheadDetonationActuator, DtRotaryWingTaskController, DtLauncherActuator, DtBallisticGunJoyController, DtMountingElevationActuator, DtLaserGuidedLauncherController, DtMountingAzimuthActuator, DtMissileManeuverActComponent, BHAVE::DtBhaveMoveDirectionController, BHAVE::DtKynapseLifeformController, DtContactFusionController, DtSpotReportReceiver, DtAirVehicleWeaponHoldController, DtHumanPostureController, DtAggregatedMovementActuator, DtHumanEyepointController, DtLaserDetector, DtGroundMoveDirectionController, DtIndirectFireWeaponController, DtSwingingPartActuator, DtDefaultLandingGearController, DtIntegratedLaserGuidedLauncherController, DtSimpleRadarWarningReceiver, DtHumanWeaponStateActuator, DtHumanAimWeaponController, DtSimpleRadarWarningResponse, and DtBallisticGunJoy.

virtual DtPhysicalWorld* DtSimComponent::physicalWorld ( ) [protected, virtual]

Gets the physical world that this component's entity exists in.

virtual const DtPhysicalWorld* DtSimComponent::physicalWorld ( ) const [protected, virtual]
virtual DtAttachedTerrain* DtSimComponent::terrainAttachedTo ( ) [protected, virtual]

Gets the terrain that this component's entity is attached to, if any.

virtual const DtAttachedTerrain* DtSimComponent::terrainAttachedTo ( ) const [protected, virtual]
virtual DtVrfObject* DtSimComponent::entity ( ) [protected, virtual]

Gets the entity.

virtual const DtVrfObject* DtSimComponent::entity ( ) const [protected, virtual]
virtual DtSimManager* DtSimComponent::simManager ( ) [protected, virtual]

Gets the sim manager.

virtual const DtSimManager* DtSimComponent::simManager ( ) const [protected, virtual]
virtual const Coordinate_System* DtSimComponent::coordinateSystem ( ) const [protected, virtual]

Gets the coordinate system, as it should always exist if the physical world is in a valid state!

Note:
If this function is called while the physical world is in an invalid state, the results are undefined.
virtual Coordinate_System* DtSimComponent::coordinateSystem ( ) [protected, virtual]

Gets the local state repository.

virtual const DtVrfObjectStateRepository* DtSimComponent::localStateRepository ( ) const [protected, virtual]
DtSimComponent& DtSimComponent::operator= ( const DtSimComponent orig) [private]

assignment operator, not implemented


Member Data Documentation

Pointer to the DtComponentSystem that this component belongs.

DtListItem* DtSimComponent::myListItem [protected]
int DtSimComponent::myPriority [protected]
double DtSimComponent::myMinTickPeriod [protected]
double DtSimComponent::myNextTickTime [protected]
double DtSimComponent::myDT [protected]

Referenced by dT().

Indiates whether this component should be enabled for ticking or not.

Reimplemented in DtLasingController, and DtLaserDetector.


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)