VR-Link API Documentation for HLA 1516
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
DtHlaObjectManager Class Reference

class DtHlaObjectManager: More...

+ Collaboration diagram for DtHlaObjectManager:

List of all members.

Public Member Functions

 DtHlaObjectManager (DtHlaObjectFactory *factory, DtExerciseConn *conn)
 Constructor.
virtual ~DtHlaObjectManager ()
 Destructor.
virtual const DtListallHlaObjects () const
 Get the list of all HLA objects known to the federate.
virtual const DtListregisteredObjects () const
 Get the list of all HLA objects registered by the federate.
virtual const DtListdiscoveredObjects () const
 Get the list of all HLA objects discovered by the federate.
virtual DtHlaObjecthlaObject (RTI::ObjectInstanceHandle id) const
 Get the HLA object based on its identifier.
virtual DtHlaObjecthlaObject (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 DtHlaObjectprocessDiscoverObject (RTI::ObjectInstanceHandle id, RTI::ObjectClassHandle handle, const std::wstring &name)
 Process the discovery of an object.
virtual const DtHlaObjectprocessDiscoverObject (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 DtHlaObjectregisterHlaObject (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 &regionSet, 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.
DtHlaObjectManageroperator= (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 DtHlaObjectaddKnownObject (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 DtListdiscoverCbList (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.
DtHlaObjectFactorymyFactory
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.
DtExerciseConnmyExConn
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

Detailed Description

class DtHlaObjectManager:

Instances of DtHlaObjectManager are used to manage the set of HLA objects known to the federate.


Constructor & Destructor Documentation

Constructor.

Destructor.

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


Member Function Documentation

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::ObjectInstanceHandle  id,
RTI::ObjectClassHandle  hand,
const std::wstring &  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::ObjectInstanceHandle  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::ObjectInstanceHandle  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::ObjectInstanceHandle  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 bool DtHlaObjectManager::isNameReserved ( const std::wstring &  theName) const [virtual]

returns true if theName has been reserved.

There is no promise that the name is not already used.

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.

static void DtHlaObjectManager::nameReservationFailedCb ( const std::wstring &  theName,
void *  theUserData 
) [static, protected]
static void DtHlaObjectManager::nameReservationSuceededCb ( const std::wstring &  theName,
void *  theUserData 
) [static, protected]

Called by the FederateAmbassador anytime a name reservation succeeds or fails.

Set/Get the number of times to tick the RTI after a name reservation request.

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::ObjectInstanceHandle  id,
const RTI::AttributeHandleSet &  attrs 
) [virtual]

Process RTI's attributeOwnershipAcquisitionNotification service.

virtual void DtHlaObjectManager::processAttributeDivestiture ( RTI::ObjectInstanceHandle  id,
const RTI::AttributeHandleSet &  attrs 
) [virtual]

Process RTI's attributeOwnershipDivestitureNotification service.

virtual void DtHlaObjectManager::processConfirmAcquisitionCancellation ( RTI::ObjectInstanceHandle  id,
const RTI::AttributeHandleSet &  attrs 
) [virtual]

Process RTI's conformAttributeOwnershipAcquisitionCancellation service.

virtual const DtHlaObject* DtHlaObjectManager::processDiscoverObject ( RTI::ObjectInstanceHandle  id,
RTI::ObjectClassHandle  handle,
const std::wstring &  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::ObjectInstanceHandle  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::ObjectInstanceHandle  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::ObjectInstanceHandle  id,
const RTI::AttributeHandleSet &  attrs,
const RTI::VariableLengthData &  tag 
) [virtual]

Process RTI's requestAttributeOwnershipAssumption service.

virtual void DtHlaObjectManager::processRequestRelease ( RTI::ObjectInstanceHandle  id,
const RTI::AttributeHandleSet &  attrs,
const RTI::VariableLengthData &  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::ObjectInstanceHandle &  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::ObjectInstanceHandle  id,
DtRemoveObjectCb  cb,
void *  usr 
) [virtual]
static double DtHlaObjectManager::requestNameTickMaxTime ( ) [static]
static double DtHlaObjectManager::requestNameTickMinTime ( ) [static]

Sets/Gets the time in seconds to call evoke callbacks for each try after a name reservation request.

virtual void DtHlaObjectManager::reservedNameFailed ( const std::wstring &  theName) [protected, virtual]

Called when a name request Failed.

virtual void DtHlaObjectManager::reservedNameSuceeded ( const std::wstring &  theName) [protected, virtual]

Adds a new name to the reserved object Name list.

This method is called by the RTI to indicate a name request succeeded.

virtual void DtHlaObjectManager::reserveName ( const std::wstring &  theName,
bool  pushRti 
) [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 void DtHlaObjectManager::setNumberOfRequestNameTries ( int  tries) [static]
static void DtHlaObjectManager::setRequestNameTickMaxTime ( double  time) [static]
static void DtHlaObjectManager::setRequestNameTickMinTime ( double  time) [static]

Member Data Documentation

List of all DtHlaObjects that we've discovered, possibly including local objects that we are also reflecting.

Referenced by discoveredObjects().

DtHashlist that maps object class handles (DtIntHashKeys) to pointers to DtLists of callback functions.

List of all known DtHlaObjects (by id).

Referenced by allHlaObjects().

List of all known DtHlaObjects (by String).

std::set<std::wstring> DtHlaObjectManager::myPendingNameReservationNameSet [protected]

booleans set to true if the pending reserved name passes, or fails respectively.

List of all DtHlaObjects that we've registered locally.

Referenced by registeredObjects().

std::set<std::wstring> DtHlaObjectManager::myReservedObjectInstanceNameSet [protected]

A Set of all known successfully reserved object names.


The documentation for this class was generated from the following file:

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)