![]() |
VR-Forces 4.0.4 Class Documentation
|
DtWaitController is a controller that models waiting behavior ground and surface entities. More...

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 DtSimComponent * | creator (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 DtWaitController & | operator= (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 | |
| DtWaitingPSR * | myProcessState |
| Container for state data associated with this component. | |
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
| DtWaitController::DtWaitController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtWaitController::~DtWaitController | ( | ) | [virtual] |
destructor
| DtWaitController::DtWaitController | ( | ) | [protected] |
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtWaitController::DtWaitController | ( | const DtWaitController & | orig | ) | [protected] |
copy constructor; shallow; does not copy the ports.
| 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.
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.
| virtual DtSimTaskStatePtr DtWaitController::currentTaskState | ( | ) | const [virtual] |
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*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
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.
DtWaitingPSR* DtWaitController::myProcessState [protected] |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).