![]() |
VR-Link API Documentation for HLA 1516
|
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::ObjectInstanceHandle 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::ObjectInstanceHandle 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::ObjectInstanceHandle id, DtRemoveObjectCb cb, void *usr) |
| virtual const DtHlaObject * | processDiscoverObject (RTI::ObjectInstanceHandle id, RTI::ObjectClassHandle handle, const std::wstring &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::ObjectInstanceHandle 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::ObjectInstanceHandle 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::ObjectInstanceHandle id, const RTI::AttributeHandleSet &attrs) |
| Process RTI's attributeOwnershipAcquisitionNotification service. | |
| virtual void | processAttributeDivestiture (RTI::ObjectInstanceHandle id, const RTI::AttributeHandleSet &attrs) |
| Process RTI's attributeOwnershipDivestitureNotification service. | |
| virtual void | processRequestAssumption (RTI::ObjectInstanceHandle id, const RTI::AttributeHandleSet &attrs, const RTI::VariableLengthData &tag) |
| Process RTI's requestAttributeOwnershipAssumption service. | |
| virtual void | processRequestRelease (RTI::ObjectInstanceHandle id, const RTI::AttributeHandleSet &attrs, const RTI::VariableLengthData &tag) |
| Process RTI's requestAttributeOwnershipRelease service. | |
| virtual void | processConfirmAcquisitionCancellation (RTI::ObjectInstanceHandle 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::ObjectInstanceHandle &id) |
| virtual void | deleteHlaObject (RTI::ObjectInstanceHandle objHand) |
| Use this function instead of the RTI's version to delete an HLA object. | |
| virtual void | reserveName (const std::wstring &theName, bool pushRti) |
| 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 bool | isNameReserved (const std::wstring &theName) const |
| returns true if theName has been reserved. | |
Static Public Member Functions | |
| static double | requestNameTickMinTime () |
| Sets/Gets the time in seconds to call evoke callbacks for each try after a name reservation request. | |
| static void | setRequestNameTickMinTime (double time) |
| static double | requestNameTickMaxTime () |
| static void | setRequestNameTickMaxTime (double time) |
| static int | numberOfRequestNameTries () |
| Set/Get the number of times to tick the RTI after a name reservation request. | |
| static void | setNumberOfRequestNameTries (int tries) |
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::ObjectInstanceHandle id, RTI::ObjectClassHandle hand, const std::wstring &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. | |
| virtual void | reservedNameSuceeded (const std::wstring &theName) |
| Adds a new name to the reserved object Name list. | |
| virtual void | reservedNameFailed (const std::wstring &theName) |
| Called when a name request Failed. | |
Static Protected Member Functions | |
| static void | nameReservationSuceededCb (const std::wstring &theName, void *theUserData) |
| Called by the FederateAmbassador anytime a name reservation succeeds or fails. | |
| static void | nameReservationFailedCb (const std::wstring &theName, void *theUserData) |
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 |
| std::set< std::wstring > | myReservedObjectInstanceNameSet |
| A Set of all known successfully reserved object names. | |
| bool | myPendingNameReservationPassedFlag |
| booleans set to true if the pending reserved name passes, or fails respectively. | |
| bool | myPendingNameReservationFailedFlag |
| std::wstring | myPendingNameReservationName |
| std::set< std::wstring > | myPendingNameReservationNameSet |
| int | myNumAttrsForDDMRegister |
Static Protected Attributes | |
| static double | theRequestNameTickMinTime |
| static double | theRequestNameTickMaxTime |
| static int | theNumberOfRequestNameTries |
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 |
Destructor.
|
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 |
Add/remove a callback to be called when an object which meets the federate's subscription criteria is discovered.
|
protectedvirtual |
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 |
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.
|
inlinevirtual |
Get the list of all HLA objects known to the federate.
References DtObjectIdHashlist::list(), and myObjectList.
|
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.
|
protectedvirtual |
Returns the list of discover callbacks registered for a particular object class.
|
inlinevirtual |
Get the list of all HLA objects discovered by the federate.
References DtObjectIdHashlist::list(), and myDiscObjectList.
|
virtual |
Get the HLA object based on its identifier.
|
virtual |
Get the HLA object based on its name.
|
virtual |
returns true if theName has been reserved.
There is no promise that the name is not already used.
|
virtual |
Called when the local subscription information changes.
As a result, we call localSubscriptionChanged for all DtHlaObjects that may be affected.
|
staticprotected |
|
staticprotected |
Called by the FederateAmbassador anytime a name reservation succeeds or fails.
|
static |
Set/Get the number of times to tick the RTI after a name reservation request.
|
protectedvirtual |
Call DtHlaObject::callReflect().
Provides friendship towards DtHlaObject to derived classes.
|
protectedvirtual |
Call DtHlaObject::processRemoveObject().
Provides friendship towards DtHlaObject to derived classes.
|
protected |
assignment operator – Not Implemented
|
virtual |
Process RTI's attributeOwnershipAcquisitionNotification service.
|
virtual |
Process RTI's attributeOwnershipDivestitureNotification service.
|
virtual |
Process RTI's conformAttributeOwnershipAcquisitionCancellation service.
|
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 |
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 |
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 |
Process RTI's provideUpdate service.
|
virtual |
Process an update message.
|
virtual |
Process the removal of an object.
Cleans up the object from reflecting. Called on real removals.
|
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 |
Process RTI's requestAttributeOwnershipAssumption service.
|
virtual |
Process RTI's requestAttributeOwnershipRelease service.
|
virtual |
Called when the local publication information changes.
As a result, we call publicationChanged for all DtHlaObjects that may be affected.
|
inlinevirtual |
Get the list of all HLA objects registered by the federate.
References DtObjectIdHashlist::list(), and myRegObjectList.
|
virtual |
Use this function instead of the RTI's version to create a new HLA object.
This function calls RTI's registerObjectInstance.
|
virtual |
|
protectedvirtual |
Called by destructor to remove and delete all DtHlaObjects.
|
virtual |
|
protectedvirtual |
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 |
|
static |
|
static |
Sets/Gets the time in seconds to call evoke callbacks for each try after a name reservation request.
|
protectedvirtual |
Called when a name request Failed.
|
protectedvirtual |
Adds a new name to the reserved object Name list.
This method is called by the RTI to indicate a name request succeeded.
|
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. request a name be reserved by the RTI. If pushRti is true, evokeCallbacks will be called to drain any waiting RTI Events. The goal is to try to make the name reservation right away.
|
static |
|
static |
|
static |
|
protected |
List of all DtHlaObjects that we've discovered, possibly including local objects that we are also reflecting.
Referenced by discoveredObjects().
|
protected |
DtHashlist that maps object class handles (DtIntHashKeys) to pointers to DtLists of callback functions.
|
protected |
|
protected |
|
protected |
|
protected |
List of all known DtHlaObjects (by id).
Referenced by allHlaObjects().
|
protected |
List of all known DtHlaObjects (by String).
|
protected |
|
protected |
|
protected |
|
protected |
booleans set to true if the pending reserved name passes, or fails respectively.
|
protected |
List of all DtHlaObjects that we've registered locally.
Referenced by registeredObjects().
|
protected |
A Set of all known successfully reserved object names.
|
staticprotected |
|
staticprotected |
|
staticprotected |