![]() |
VR-Forces 4.0.4 Class Documentation
|
DtOccupancyDirectorController allocates reserved embarkation slots and determines which (if any) objects can be embarked on an object. More...

Public Member Functions | |
| DtOccupancyDirectorController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtOccupancyDirectorController () |
| destructor | |
| virtual bool | init () |
| Initializes any state that is needed. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | processRequestEmbarkationInformation (DtSimMessage *msg) |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| static void | requestEmbarkationInformationCallback (DtSimMessage *msg, void *usr) |
Protected Member Functions | |
| virtual void | registerTaskMsgCallbacks () |
| Override for interest in both disembark all tasks. | |
| virtual void | tick () |
| Ticks and performs current state. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual void | giveUpSlot (int iSlot, const DtString &name) |
| Gives up the slot (if reserved) for the specified entity. | |
| virtual DtEmbarkationSlotInformation | embarkationSlotEntryFor (const DtString &) const |
| Returns a slot information structure for given entity. | |
| virtual DtEmbarkationSlotInformation | disembarkationInformationFor (const DtString &, int &iResult) const |
| Returns slot that the entity that is currently in has, and whether or not it can disembark. | |
| virtual int | disembarkationResult (const DtEmbarkationSlotInformation &) const |
| Returns the status of a potential disembark (can or cannot). Default can always disembark. | |
| virtual bool | reserveSlot (const DtEmbarkationSlotInformation &entry, const DtString &name) |
| Reserves the slot so it cannot be used by any other entity. | |
| virtual void | sendSlotInformationTo (const DtString &name, const DtEmbarkationSlotInformation &entry, int, int reqId=0xFFFFFFFF) |
| Sends a response back to the requestor with the entry information. | |
| virtual void | processDeleteVrfObjectCallback (DtVrfObject *obj) |
| virtual void | processDisembarkAllTask (DtSimMessage *msg) |
| The disembarkAll task will issue a disembark task to all items that are embarked on this object. | |
| virtual bool | objectDisembarked (const DtString &objectName) |
| virtual void | disembarkNextObject () |
| Sends a task to the first object on the embarked objects list (from the state repository), and sets that object's name to the PSR. | |
| virtual void | sendTask (const DtSimTask &task, const DtString &objectName) |
| Sends the specified task to the named object. | |
| virtual void | processDisembarkObjectCallback (DtSimMessage *msg) |
| Processes DtIfDisembarkObject if address to this object and it is a disembarkAll type message. | |
| virtual DtVector | disembarkedPositionFor (const DtString &entityName, const DtEmbarkationSlotInformation &) const |
| When disembarking, this will return the final disembark spot for the specified entity. | |
| virtual bool | nextEntityCanDisembark (const DtVrfObject *curEntity) const |
| Returns true if the entity that is currently disembarking, it's bounding volume is not occluding the next entitiest to disembark disembarkation point. | |
| virtual bool | isValidForDisembarkLayout (const DtVrfObject *) const |
| Return true if this entity kind (or type) can be part of disembarkation layour. | |
| virtual bool | createCollisionDetector () |
| Override to provide a new collision detector implementation. | |
| virtual void | setObstructionIDsInCollisionDetector () |
| Currently sets up to avoid entity kinds 1 - 3. | |
| virtual void | setupSlots () |
| Sets up slot information for slots that are currently available by looking at the state repository to see what is currently reserved and removing any slots that are not available. | |
| virtual void | initializeSlotManager () |
| Initializes mySlotManager with slots found in the descriptor. | |
| virtual void | calculateDisembarkPositions (const std::list< DtString > &) |
| Calls down to the slot manager to set up grid and spacing for disembarking objects. | |
| virtual void | generateListForDisembarkation (std::list< DtString > &list) |
| Parse the embarked objects list to send disembark tasks only to top entities in hierarchies and avoid multimessaging for subordinates. | |
| virtual void | removeAllSubordinates (DtVrfObject *obj) |
| Remove All subordinates of the given object and the object from the list in the state repository. | |
Static Protected Member Functions | |
| static void | deleteVrfObjectCallback (DtVrfObject *msg, void *usr) |
| If an object is deleted and it is the object that has a slot reserved, give up the slot. | |
| static void | disembarkAllTaskCallback (DtSimMessage *msg, void *usr) |
| static void | disembarkObjectCallback (DtSimMessage *msg, void *usr) |
| Callback for responding to DtIfDisembarkObject messages. | |
Protected Attributes | |
| DtVrfOccupancyDirectorPSR * | myProcessState |
| Container for state data associated with this component. | |
| bool | myFirstTick |
| const DtOccupancyDirectorDescriptor * | myOccupancyDirectorDescriptor |
| DtEmbarkationSlotManager * | mySlotManager |
| DtCollisionDetector * | myCollisionDetector |
| std::set< DtString > | myObjectsToDisembark |
| Variable to control which units were disembarked by a superior to avoid multi messages. | |
Private Member Functions | |
| DtOccupancyDirectorController () | |
| default constructor; not implemented | |
| DtOccupancyDirectorController (const DtOccupancyDirectorController &orig) | |
| copy constructor; not implemented | |
| const DtOccupancyDirectorController & | operator= (const DtOccupancyDirectorController &orig) |
| assignment operator; not implemented | |
DtOccupancyDirectorController allocates reserved embarkation slots and determines which (if any) objects can be embarked on an object.
Developer Description: This controller responds to messages of type DtIfRequestEmbarkationInformation. When a request is received, the controller looks to see if there are any slots available, and, if so, reserves it (if requested) and then returns a DtIfEmbarkationInformation structure with the reservation information. This controller is also responsible for disembarkation information and responds to those requests. If an entity cannot embark because the object does not support the requesting object type or because the slots are full, an information return structure is sent, but with the DtEmbarkCannotEmbark result status. It will accomplish this task through a series of message requests that are made of the controller (interface) and sends those interface messages back to the requestor.
Uses Descriptor Type: DtOccupancyDirectorDescriptor
| DtOccupancyDirectorController::DtOccupancyDirectorController | ( | 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 DtOccupancyDirectorController::~DtOccupancyDirectorController | ( | ) | [virtual] |
destructor
default constructor; not implemented
| DtOccupancyDirectorController::DtOccupancyDirectorController | ( | const DtOccupancyDirectorController & | orig | ) | [private] |
copy constructor; not implemented
| virtual bool DtOccupancyDirectorController::init | ( | ) | [virtual] |
Initializes any state that is needed.
Reimplemented from DtControllerComponent.
| virtual DtString DtOccupancyDirectorController::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.
| static DtSimComponent* DtOccupancyDirectorController::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). |
| static void DtOccupancyDirectorController::requestEmbarkationInformationCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
| virtual void DtOccupancyDirectorController::processRequestEmbarkationInformation | ( | DtSimMessage * | msg | ) | [virtual] |
| virtual void DtOccupancyDirectorController::registerTaskMsgCallbacks | ( | ) | [protected, virtual] |
Override for interest in both disembark all tasks.
Reimplemented from DtTaskControllerComponent.
| virtual void DtOccupancyDirectorController::tick | ( | ) | [protected, virtual] |
Ticks and performs current state.
Reimplemented from DtSimComponent.
| virtual bool DtOccupancyDirectorController::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 void DtOccupancyDirectorController::giveUpSlot | ( | int | iSlot, |
| const DtString & | name | ||
| ) | [protected, virtual] |
Gives up the slot (if reserved) for the specified entity.
| virtual DtEmbarkationSlotInformation DtOccupancyDirectorController::embarkationSlotEntryFor | ( | const DtString & | ) | const [protected, virtual] |
Returns a slot information structure for given entity.
| virtual DtEmbarkationSlotInformation DtOccupancyDirectorController::disembarkationInformationFor | ( | const DtString & | , |
| int & | iResult | ||
| ) | const [protected, virtual] |
Returns slot that the entity that is currently in has, and whether or not it can disembark.
| virtual int DtOccupancyDirectorController::disembarkationResult | ( | const DtEmbarkationSlotInformation & | ) | const [protected, virtual] |
Returns the status of a potential disembark (can or cannot). Default can always disembark.
| virtual bool DtOccupancyDirectorController::reserveSlot | ( | const DtEmbarkationSlotInformation & | entry, |
| const DtString & | name | ||
| ) | [protected, virtual] |
Reserves the slot so it cannot be used by any other entity.
If cannot reserve, returns false
| virtual void DtOccupancyDirectorController::sendSlotInformationTo | ( | const DtString & | name, |
| const DtEmbarkationSlotInformation & | entry, | ||
| int | , | ||
| int | reqId = 0xFFFFFFFF |
||
| ) | [protected, virtual] |
Sends a response back to the requestor with the entry information.
If entry is NULL, then no entry exists for the,
| static void DtOccupancyDirectorController::deleteVrfObjectCallback | ( | DtVrfObject * | msg, |
| void * | usr | ||
| ) | [static, protected] |
If an object is deleted and it is the object that has a slot reserved, give up the slot.
| virtual void DtOccupancyDirectorController::processDeleteVrfObjectCallback | ( | DtVrfObject * | obj | ) | [protected, virtual] |
| virtual void DtOccupancyDirectorController::processDisembarkAllTask | ( | DtSimMessage * | msg | ) | [protected, virtual] |
The disembarkAll task will issue a disembark task to all items that are embarked on this object.
It will issue disembark tasks one at a time until all items are disembarked. When all items are disembarked, then it will consider the task complete
| static void DtOccupancyDirectorController::disembarkAllTaskCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
| virtual bool DtOccupancyDirectorController::objectDisembarked | ( | const DtString & | objectName | ) | [protected, virtual] |
| virtual void DtOccupancyDirectorController::disembarkNextObject | ( | ) | [protected, virtual] |
Sends a task to the first object on the embarked objects list (from the state repository), and sets that object's name to the PSR.
If there are no embarked objects, calls taskComplete().
| virtual void DtOccupancyDirectorController::sendTask | ( | const DtSimTask & | task, |
| const DtString & | objectName | ||
| ) | [protected, virtual] |
Sends the specified task to the named object.
| static void DtOccupancyDirectorController::disembarkObjectCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Callback for responding to DtIfDisembarkObject messages.
| virtual void DtOccupancyDirectorController::processDisembarkObjectCallback | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Processes DtIfDisembarkObject if address to this object and it is a disembarkAll type message.
| virtual DtVector DtOccupancyDirectorController::disembarkedPositionFor | ( | const DtString & | entityName, |
| const DtEmbarkationSlotInformation & | |||
| ) | const [protected, virtual] |
When disembarking, this will return the final disembark spot for the specified entity.
This will be determined as follows:
In either case. each entity will wait to being disembarking until the entity before it is no longer occluding the disembark point
| virtual bool DtOccupancyDirectorController::nextEntityCanDisembark | ( | const DtVrfObject * | curEntity | ) | const [protected, virtual] |
Returns true if the entity that is currently disembarking, it's bounding volume is not occluding the next entitiest to disembark disembarkation point.
| virtual bool DtOccupancyDirectorController::isValidForDisembarkLayout | ( | const DtVrfObject * | ) | const [protected, virtual] |
Return true if this entity kind (or type) can be part of disembarkation layour.
| virtual bool DtOccupancyDirectorController::createCollisionDetector | ( | ) | [protected, virtual] |
Override to provide a new collision detector implementation.
| virtual void DtOccupancyDirectorController::setObstructionIDsInCollisionDetector | ( | ) | [protected, virtual] |
Currently sets up to avoid entity kinds 1 - 3.
| virtual void DtOccupancyDirectorController::setupSlots | ( | ) | [protected, virtual] |
Sets up slot information for slots that are currently available by looking at the state repository to see what is currently reserved and removing any slots that are not available.
Called every time a slot reservation changes and also upon initialization
| virtual void DtOccupancyDirectorController::initializeSlotManager | ( | ) | [protected, virtual] |
Initializes mySlotManager with slots found in the descriptor.
Should only be called once and must be called before setupSlots()
| virtual void DtOccupancyDirectorController::calculateDisembarkPositions | ( | const std::list< DtString > & | ) | [protected, virtual] |
Calls down to the slot manager to set up grid and spacing for disembarking objects.
Only valid for disembarkAll call
| virtual void DtOccupancyDirectorController::generateListForDisembarkation | ( | std::list< DtString > & | list | ) | [protected, virtual] |
Parse the embarked objects list to send disembark tasks only to top entities in hierarchies and avoid multimessaging for subordinates.
| virtual void DtOccupancyDirectorController::removeAllSubordinates | ( | DtVrfObject * | obj | ) | [protected, virtual] |
Remove All subordinates of the given object and the object from the list in the state repository.
| const DtOccupancyDirectorController& DtOccupancyDirectorController::operator= | ( | const DtOccupancyDirectorController & | orig | ) | [private] |
assignment operator; not implemented
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
bool DtOccupancyDirectorController::myFirstTick [protected] |
const DtOccupancyDirectorDescriptor* DtOccupancyDirectorController::myOccupancyDirectorDescriptor [protected] |
std::set<DtString> DtOccupancyDirectorController::myObjectsToDisembark [protected] |
Variable to control which units were disembarked by a superior to avoid multi messages.