![]() |
VR-Link API Documentation for HLA 1.3
|
class DtHlaObjectManager: More...
Collaboration diagram for DtHlaObjectManager:Public Member Functions | |
| DtHlaObjectManager (DtHlaObjectFactory *factory, DtExerciseConn *conn) | |
| Constructor. | |
| virtual | ~DtHlaObjectManager () |
| Destructor. | |
| virtual const DtList & | allHlaObjects () const |
| Get the list of all HLA objects known to the federate. | |
| virtual const DtList & | registeredObjects () const |
| Get the list of all HLA objects registered by the federate. | |
| virtual const DtList & | discoveredObjects () const |
| Get the list of all HLA objects discovered by the federate. | |
| virtual DtHlaObject * | hlaObject (RTI::ObjectHandle id) const |
| Get the HLA object based on its identifier. | |
| virtual DtHlaObject * | hlaObject (const char *name) const |
| Get the HLA object based on its name. | |
| virtual void | addDiscoverObjectCallback (RTI::ObjectClassHandle handle, DtDiscoverObjectCb cb, void *usr) |
| Add/remove a callback to be called when an object which meets the federate's subscription criteria is discovered. | |
| virtual void | removeDiscoverObjectCallback (RTI::ObjectClassHandle handle, DtDiscoverObjectCb cb, void *usr) |
| virtual void | addRemoveObjectCallback (RTI::ObjectHandle id, DtRemoveObjectCb cb, void *usr) |
| Add/remove a callback to be called when an object has been removed from the federation or no longer meets the interest criteria of the federate. | |
| virtual void | removeRemoveObjectCallback (RTI::ObjectHandle id, DtRemoveObjectCb cb, void *usr) |
| virtual const DtHlaObject * | processDiscoverObject (RTI::ObjectHandle id, RTI::ObjectClassHandle handle, const char *name) |
| Process the discovery of an object. | |
| virtual const DtHlaObject * | processDiscoverObject (DtHlaObject *hlaObj) |
| Same as above, but takes an existing DtHlaObject. | |
| virtual void | processRemoveObject (RTI::ObjectHandle id) |
| Process the removal of an object. | |
| virtual void | processRemoveObject (DtHlaObject *obj) |
| Same as above, but takes an existing DtHlaObject. | |
| virtual void | processReflectAttributeValues (const DtStateMsg &msg) |
| Process an update message. | |
| virtual void | processProvideUpdate (RTI::ObjectHandle id, const RTI::AttributeHandleSet &theAttributes) |
| Process RTI's provideUpdate service. | |
| virtual void | processLocalUpdateRequest (RTI::ObjectClassHandle hand, const RTI::AttributeHandleSet &set) |
| When we are reflecting local data, this function is called to let the object manager know that we have locally requested updates for a class/set of attributes. | |
| virtual void | localSubscriptionChanged (RTI::ObjectClassHandle handle) |
| Called when the local subscription information changes. | |
| virtual void | publicationChanged (RTI::ObjectClassHandle handle) |
| Called when the local publication information changes. | |
| virtual void | processAttributeAcquisition (RTI::ObjectHandle id, const RTI::AttributeHandleSet &attrs) |
| Process RTI's attributeOwnershipAcquisitionNotification service. | |
| virtual void | processAttributeDivestiture (RTI::ObjectHandle id, const RTI::AttributeHandleSet &attrs) |
| Process RTI's attributeOwnershipDivestitureNotification service. | |
| virtual void | processRequestAssumption (RTI::ObjectHandle id, const RTI::AttributeHandleSet &attrs, const char *tag) |
| Process RTI's requestAttributeOwnershipAssumption service. | |
| virtual void | processRequestRelease (RTI::ObjectHandle id, const RTI::AttributeHandleSet &attrs, const char *tag) |
| Process RTI's requestAttributeOwnershipRelease service. | |
| virtual void | processConfirmAcquisitionCancellation (RTI::ObjectHandle id, const RTI::AttributeHandleSet &attrs) |
| Process RTI's conformAttributeOwnershipAcquisitionCancellation service. | |
| virtual DtHlaObject * | registerHlaObject (RTI::ObjectClassHandle classHand, const char *name, const DtDDMRegionSet *regionSet=0) |
| Use this function instead of the RTI's version to create a new HLA object. | |
| virtual void | registerHlaObjectWithRegion (RTI::ObjectClassHandle classHand, const char *name, const DtDDMRegionSet ®ionSet, RTI::ObjectHandle &id) |
| virtual void | deleteHlaObject (RTI::ObjectHandle objHand) |
| Use this function instead of the RTI's version to delete an HLA object. | |
| virtual void | setRegionsForRegister (int numAttrs, RTI::AttributeHandle *attrs, RTI::Region **regions) |
| By calling setRegionsForRegister, you are telling VR-Link that until you call setRegionsForRegister again (or call setNoRegionsForRegister), VR-Link should use the DDM version of registerObjectInstance whenever it registers an object for you. | |
| virtual void | setNoRegionsForRegister () |
Protected Member Functions | |
| DtHlaObjectManager (const DtHlaObjectManager &orig) | |
| Note: The copy constructor and assignment operator are protected because there should only be one object manager per exercise connection. | |
| DtHlaObjectManager & | operator= (const DtHlaObjectManager &orig) |
| assignment operator -- Not Implemented | |
| virtual void | objectProcessRemoveObject (DtHlaObject *hlaObj) |
| Call DtHlaObject::processRemoveObject(). | |
| virtual void | objectProcessReflect (DtHlaObject *hlaObj, const DtStateMsg &msg) |
| Call DtHlaObject::callReflect(). | |
| virtual DtHlaObject * | addKnownObject (RTI::ObjectHandle id, RTI::ObjectClassHandle hand, const char *name, bool reflecting) |
| Call whenever a new object has been registered or discovered. | |
| virtual void | removeKnownObject (DtHlaObject *hlaObj) |
| Call whenever an object is to be deleted, either by delete, or remove. | |
| virtual void | removeAllObjects () |
| Called by destructor to remove and delete all DtHlaObjects. | |
| virtual DtList * | discoverCbList (RTI::ObjectClassHandle handle) |
| Returns the list of discover callbacks registered for a particular object class. | |
Protected Attributes | |
| DtHashlist | myDiscoverCbLists |
| DtHashlist that maps object class handles (DtIntHashKeys) to pointers to DtLists of callback functions. | |
| DtHlaObjectFactory * | myFactory |
| DtObjectIdHashlist | myObjectList |
| List of all known DtHlaObjects (by id). | |
| DtHashlist | myObjectListByName |
| List of all known DtHlaObjects (by String). | |
| DtObjectIdHashlist | myRegObjectList |
| List of all DtHlaObjects that we've registered locally. | |
| DtObjectIdHashlist | myDiscObjectList |
| List of all DtHlaObjects that we've discovered, possibly including local objects that we are also reflecting. | |
| DtExerciseConn * | myExConn |
| RTI::AttributeHandle * | myAttrsForDDMRegister |
| JIMK REVISIT -- DDM. | |
| RTI::Region ** | myRegionsForDDMRegister |
| int | myNumAttrsForDDMRegister |
class DtHlaObjectManager:
Instances of DtHlaObjectManager are used to manage the set of HLA objects known to the federate.
| DtHlaObjectManager::DtHlaObjectManager | ( | DtHlaObjectFactory * | factory, |
| DtExerciseConn * | conn | ||
| ) |
Constructor.
| virtual DtHlaObjectManager::~DtHlaObjectManager | ( | ) | [virtual] |
Destructor.
| DtHlaObjectManager::DtHlaObjectManager | ( | const DtHlaObjectManager & | orig | ) | [protected] |
Note: The copy constructor and assignment operator are protected because there should only be one object manager per exercise connection.
These should not be called. copy constructor -- Not Implemented
| virtual void DtHlaObjectManager::addDiscoverObjectCallback | ( | RTI::ObjectClassHandle | handle, |
| DtDiscoverObjectCb | cb, | ||
| void * | usr | ||
| ) | [virtual] |
Add/remove a callback to be called when an object which meets the federate's subscription criteria is discovered.
| virtual DtHlaObject* DtHlaObjectManager::addKnownObject | ( | RTI::ObjectHandle | id, |
| RTI::ObjectClassHandle | hand, | ||
| const char * | name, | ||
| bool | reflecting | ||
| ) | [protected, virtual] |
Call whenever a new object has been registered or discovered.
It creates a DtHlaObject, adds it to the set of managed objects, and returns it.
| virtual void DtHlaObjectManager::addRemoveObjectCallback | ( | RTI::ObjectHandle | id, |
| DtRemoveObjectCb | cb, | ||
| void * | usr | ||
| ) | [virtual] |
Add/remove a callback to be called when an object has been removed from the federation or no longer meets the interest criteria of the federate.
| const DtList & DtHlaObjectManager::allHlaObjects | ( | ) | const [inline, virtual] |
Get the list of all HLA objects known to the federate.
References DtObjectIdHashlist::list(), and myObjectList.
| virtual void DtHlaObjectManager::deleteHlaObject | ( | RTI::ObjectHandle | objHand | ) | [virtual] |
Use this function instead of the RTI's version to delete an HLA object.
This function calls RTI's deleteObjectInstance. You should have ownership of the priviledgeToDelete for this object before calling.
| virtual DtList* DtHlaObjectManager::discoverCbList | ( | RTI::ObjectClassHandle | handle | ) | [protected, virtual] |
Returns the list of discover callbacks registered for a particular object class.
| const DtList & DtHlaObjectManager::discoveredObjects | ( | ) | const [inline, virtual] |
Get the list of all HLA objects discovered by the federate.
References DtObjectIdHashlist::list(), and myDiscObjectList.
| virtual DtHlaObject* DtHlaObjectManager::hlaObject | ( | RTI::ObjectHandle | id | ) | const [virtual] |
Get the HLA object based on its identifier.
| virtual DtHlaObject* DtHlaObjectManager::hlaObject | ( | const char * | name | ) | const [virtual] |
Get the HLA object based on its name.
| virtual void DtHlaObjectManager::localSubscriptionChanged | ( | RTI::ObjectClassHandle | handle | ) | [virtual] |
Called when the local subscription information changes.
As a result, we call localSubscriptionChanged for all DtHlaObjects that may be affected.
| virtual void DtHlaObjectManager::objectProcessReflect | ( | DtHlaObject * | hlaObj, |
| const DtStateMsg & | msg | ||
| ) | [protected, virtual] |
Call DtHlaObject::callReflect().
Provides friendship towards DtHlaObject to derived classes.
| virtual void DtHlaObjectManager::objectProcessRemoveObject | ( | DtHlaObject * | hlaObj | ) | [protected, virtual] |
Call DtHlaObject::processRemoveObject().
Provides friendship towards DtHlaObject to derived classes.
| DtHlaObjectManager& DtHlaObjectManager::operator= | ( | const DtHlaObjectManager & | orig | ) | [protected] |
assignment operator -- Not Implemented
| virtual void DtHlaObjectManager::processAttributeAcquisition | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | attrs | ||
| ) | [virtual] |
Process RTI's attributeOwnershipAcquisitionNotification service.
| virtual void DtHlaObjectManager::processAttributeDivestiture | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | attrs | ||
| ) | [virtual] |
Process RTI's attributeOwnershipDivestitureNotification service.
| virtual void DtHlaObjectManager::processConfirmAcquisitionCancellation | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | attrs | ||
| ) | [virtual] |
Process RTI's conformAttributeOwnershipAcquisitionCancellation service.
| virtual const DtHlaObject* DtHlaObjectManager::processDiscoverObject | ( | RTI::ObjectHandle | id, |
| RTI::ObjectClassHandle | handle, | ||
| const char * | name | ||
| ) | [virtual] |
Process the discovery of an object.
Creates the object, sets it up for reflecting, and calls discover callbacks. Called on real discovers. Returns the added instance.
| virtual const DtHlaObject* DtHlaObjectManager::processDiscoverObject | ( | DtHlaObject * | hlaObj | ) | [virtual] |
Same as above, but takes an existing DtHlaObject.
Called on real discovers and when discovering objects that we register locally, if reflecting is on. returns the instance.
| virtual void DtHlaObjectManager::processLocalUpdateRequest | ( | RTI::ObjectClassHandle | hand, |
| const RTI::AttributeHandleSet & | set | ||
| ) | [virtual] |
When we are reflecting local data, this function is called to let the object manager know that we have locally requested updates for a class/set of attributes.
As a result, we will call processProvideUpdate for all relevant objects.
| virtual void DtHlaObjectManager::processProvideUpdate | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | theAttributes | ||
| ) | [virtual] |
Process RTI's provideUpdate service.
| virtual void DtHlaObjectManager::processReflectAttributeValues | ( | const DtStateMsg & | msg | ) | [virtual] |
Process an update message.
| virtual void DtHlaObjectManager::processRemoveObject | ( | RTI::ObjectHandle | id | ) | [virtual] |
Process the removal of an object.
Cleans up the object from reflecting. Called on real removals.
| virtual void DtHlaObjectManager::processRemoveObject | ( | DtHlaObject * | obj | ) | [virtual] |
Same as above, but takes an existing DtHlaObject.
Called on real removals, and on removals from the discovered list of objects that we are deleting locally, if reflecting is on.
| virtual void DtHlaObjectManager::processRequestAssumption | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | attrs, | ||
| const char * | tag | ||
| ) | [virtual] |
Process RTI's requestAttributeOwnershipAssumption service.
| virtual void DtHlaObjectManager::processRequestRelease | ( | RTI::ObjectHandle | id, |
| const RTI::AttributeHandleSet & | attrs, | ||
| const char * | tag | ||
| ) | [virtual] |
Process RTI's requestAttributeOwnershipRelease service.
| virtual void DtHlaObjectManager::publicationChanged | ( | RTI::ObjectClassHandle | handle | ) | [virtual] |
Called when the local publication information changes.
As a result, we call publicationChanged for all DtHlaObjects that may be affected.
| const DtList & DtHlaObjectManager::registeredObjects | ( | ) | const [inline, virtual] |
Get the list of all HLA objects registered by the federate.
References DtObjectIdHashlist::list(), and myRegObjectList.
| virtual DtHlaObject* DtHlaObjectManager::registerHlaObject | ( | RTI::ObjectClassHandle | classHand, |
| const char * | name, | ||
| const DtDDMRegionSet * | regionSet = 0 |
||
| ) | [virtual] |
Use this function instead of the RTI's version to create a new HLA object.
This function calls RTI's registerObjectInstance.
| virtual void DtHlaObjectManager::registerHlaObjectWithRegion | ( | RTI::ObjectClassHandle | classHand, |
| const char * | name, | ||
| const DtDDMRegionSet & | regionSet, | ||
| RTI::ObjectHandle & | id | ||
| ) | [virtual] |
| virtual void DtHlaObjectManager::removeAllObjects | ( | ) | [protected, virtual] |
Called by destructor to remove and delete all DtHlaObjects.
| virtual void DtHlaObjectManager::removeDiscoverObjectCallback | ( | RTI::ObjectClassHandle | handle, |
| DtDiscoverObjectCb | cb, | ||
| void * | usr | ||
| ) | [virtual] |
| virtual void DtHlaObjectManager::removeKnownObject | ( | DtHlaObject * | hlaObj | ) | [protected, virtual] |
Call whenever an object is to be deleted, either by delete, or remove.
It removes hlaObj from the set of managed objects, and deletes it.
| virtual void DtHlaObjectManager::removeRemoveObjectCallback | ( | RTI::ObjectHandle | id, |
| DtRemoveObjectCb | cb, | ||
| void * | usr | ||
| ) | [virtual] |
| virtual void DtHlaObjectManager::setNoRegionsForRegister | ( | ) | [virtual] |
| virtual void DtHlaObjectManager::setRegionsForRegister | ( | int | numAttrs, |
| RTI::AttributeHandle * | attrs, | ||
| RTI::Region ** | regions | ||
| ) | [virtual] |
By calling setRegionsForRegister, you are telling VR-Link that until you call setRegionsForRegister again (or call setNoRegionsForRegister), VR-Link should use the DDM version of registerObjectInstance whenever it registers an object for you.
The specified arguments will be passed to the RTI. (VR-Link typically registers an object from within a DtObjectPublisher constructor). In order to restore VR-Link back to the default state, when registers are done with the non-DDM version of registerObjectInstance, call setNoRegionsForRegister. attrs is an array of numAttrs attribute handles, regions is an array of numAttrs pointers to RTI::regions. The lifetime of the arrays must extend through the time that the register occurs. Deletion of the arrays is the caller's responsibility. JIMK REVISIT -- implement DDM
RTI::AttributeHandle* DtHlaObjectManager::myAttrsForDDMRegister [protected] |
JIMK REVISIT -- DDM.
List of all DtHlaObjects that we've discovered, possibly including local objects that we are also reflecting.
Referenced by discoveredObjects().
DtHashlist DtHlaObjectManager::myDiscoverCbLists [protected] |
DtHashlist that maps object class handles (DtIntHashKeys) to pointers to DtLists of callback functions.
DtExerciseConn* DtHlaObjectManager::myExConn [protected] |
DtHlaObjectFactory* DtHlaObjectManager::myFactory [protected] |
int DtHlaObjectManager::myNumAttrsForDDMRegister [protected] |
DtObjectIdHashlist DtHlaObjectManager::myObjectList [protected] |
List of all known DtHlaObjects (by id).
Referenced by allHlaObjects().
DtHashlist DtHlaObjectManager::myObjectListByName [protected] |
List of all known DtHlaObjects (by String).
RTI::Region** DtHlaObjectManager::myRegionsForDDMRegister [protected] |
List of all DtHlaObjects that we've registered locally.
Referenced by registeredObjects().