![]() |
VR-Link API Documentation for HLA 1516
|
An instance of DtObjClassDesc is a "class descriptor" for an HLA Object class. More...
Collaboration diagram for DtObjClassDesc:Public Member Functions | |
| DtObjClassDesc (const char *className, DtObjClassDesc *base, RTI::ObjectClassHandle handle, DtExerciseConn *exConn) | |
| Constructor. | |
| virtual | ~DtObjClassDesc () |
| destructor | |
| virtual void | addAttr (const char *attrName, bool withSpace=false) |
| Add an attribute (Used when reading FED file). | |
| virtual RTI::ObjectClassHandle | handle () const |
| Get the object's class handle. | |
| virtual RTI::AttributeHandle | attributeHandleByName (const char *attrName) const |
| Returns the attribute handle for this attribute name. | |
| virtual DtString | attributeNameByHandle (const RTI::AttributeHandle &hand) const |
| Returns a string holding the name of the attribute handle. | |
| virtual const char * | name () const |
| Get the object's class handle. | |
| virtual const DtObjClassDesc * | baseClass () const |
| Return a pointer to the base class's descriptor, NULL if none. | |
| virtual DtObjClassDesc * | baseClass () |
| Return a pointer to the base class's descriptor, NULL if none. | |
| virtual int | isOfClass (RTI::ObjectClassHandle hand) const |
| Returns 1 if the class is of class hand or a subclass of hand, 0 otherwise. | |
| virtual int | numAttributes () const |
| Get the number of attributes associated with this object, including privilege to delete. | |
| virtual bool | hasAttribute (const char *attrName) const |
| Determine whether a particular object has the attribute name specified. | |
| virtual const RTI::AttributeHandleSet & | attrHandleSet () const |
| Get the set of valid attribute handles for this class. | |
| virtual const RTI::AttributeHandleSet & | ownAttrHandles () const |
| Get the set of non-inherited attribute handles for this class. | |
| virtual bool | classNeededByFederation () |
| Returns true if the class is currently needed by the federation. | |
| virtual void | publish () |
| Publishes the class, along with the attributes specified by hSet (or all attributes if no hSet is given). | |
| virtual void | publish (const RTI::AttributeHandleSet &hSet) |
| virtual void | unpublish () |
| Unpublishes the class. Same as publish with an empty attribute set. | |
| virtual void | subscribe (std::wstring const &updateRateDesignator=L"", bool active=true) |
| Subscribes to the class, along with the attributes specified by hSet (or all attributes is no hSet is given) and a boolean to indicate whether VR-Link should subscribe actively or passively. | |
| virtual void | subscribe (const DtDDMRegionSet ®ion, std::wstring const &updateRateDesignator=L"", bool active=true) |
| virtual void | subscribe (const RTI::AttributeHandleSet &hSet, std::wstring const &updateRateDesignator=L"", bool active=true) |
| virtual void | subscribe (const RTI::AttributeHandleSet &hSet, DtDDMRegionSP region, std::wstring const &updateRateDesignator=L"", bool active=true) |
| subscribe with the region passed in. | |
| virtual void | passiveSubscribe () |
| virtual void | unsubscribe () |
| Unsubscribe to the class. | |
| virtual void | unsubscribe (const DtDDMRegionSet ®ionSet) |
| virtual void | requestUpdates () |
| Request updates of all objects of this class, include the attributes specified by hSet (or all subscribed attributes if no hSet is given). | |
| virtual void | requestUpdates (const DtDDMRegionSet ®ion) |
| virtual void | requestUpdates (const RTI::AttributeHandleSet &hSet) |
| virtual void | requestUpdates (const RTI::AttributeHandleSet &hSet, DtDDMRegionSP region) |
| virtual const RTI::AttributeHandleSet & | publishedAttrs () const |
| Returns the set of published attributes. | |
| virtual bool | everPublished () const |
| Return true if we have ever published the class using DtObjClassDesc::publish, false otherwise. | |
| virtual const RTI::AttributeHandleSet & | subscribedAttrs () const |
| Returns the set of subscribed attributes. | |
| virtual const RTI::AttributeHandleSet & | attributesWithSpace () const |
| virtual const RTI::AttributeHandleSet & | attributesWithoutSpace () const |
| virtual const RTI::AttributeHandleSet & | subscribedAttrsWithSpace () const |
| virtual const RTI::AttributeHandleSet & | subscribedAttrsWithoutSpace () const |
| virtual bool | everSubscribed () const |
| Return true if we have ever subscribed to the class using DtObjClassDesc::subscribe, false otherwise. | |
| virtual DtVrlRtiAmbassador * | rtiAmb () |
| Get my RTI ambassador. | |
| virtual DtVrlFederateAmbassador * | fedAmb () |
| Get my federate ambassador. | |
| virtual RTI::AttributeHandle | privilegeHandle () const |
| Returns the attribute handle of the privilegeToDelete attribute. | |
| virtual void | setUserTagModifier (DtObjectTagModifierSP modifier) |
| virtual DtObjectTagModifierSP | userTagModifier () |
| virtual void | setSubscribeToUnspecifiedAttributesFlag (bool subscribe) |
| Set/get whether subscriptions default unspecified attributes to subscription without region When true, subscriptions with regionset will subscribe without region to attributes not specified anywhere When false, subscriptions with regionset will only subscribe to specified attributes. | |
| virtual bool | subscribeToUnspecifiedAttributesFlag () |
| virtual void | setUnknownAttributeEncoder (DtHlaStateEncoder::DtAttributeEncoder encoder) |
| Set an encoder to be called for this object class for any attribute that doesn't have an encoder set for it. | |
| virtual void | setUnknownAttributeDecoder (DtHlaStateDecoder::DtAttributeDecoder decoder) |
| Set a decoder to be called for this object class for any attribute received in an update that doesn't have a decoder. | |
| virtual DtHlaStateEncoder::DtAttributeEncoder | unknownAttributeEncoder () |
| Returns the unknown attribute encoder. Returns null if not set. | |
| virtual DtHlaStateDecoder::DtAttributeDecoder | unknownAttributeDecoder () |
| Returns the unknown attribute decoder. Returns null if not set. | |
Static Public Member Functions | |
| static void | setSubscriptionTimeDelay (double delay) |
| Set a time delay to occur after calling RTI::RTIambassador::subscribe() The purpose of this function is to get around a bug in DMSO RTI NG v3.2 for Win98. | |
Protected Types | |
| typedef std::map < RTI::AttributeHandle, DtString > | StringToAttributeHandleMap |
| typedef std::vector < RTI::AttributeHandleSetRegionHandleSetPair > | RegionHandleVector |
Protected Member Functions | |
| virtual void | processStartReg (RTI::ObjectClassHandle h) |
| Callback for handling startRegistration RTI callback. | |
| virtual void | processStopReg (RTI::ObjectClassHandle h) |
| Callback for handling stopRegistration RTI callback. | |
| virtual DtObjClassDesc * | self () const |
| Casts away const-ness. Use with caution. | |
| virtual void | synchSubscribedAttributes () |
| Updates subscribed attributes using values from subscribed attributes with/without space. | |
| virtual void | fillInAttributeHandleSetRegionHandleSetPairVector (const RTI::AttributeHandleSet &hSet, DtDDMRegionSP region, RTI::AttributeHandleSetRegionHandleSetPairVector &pairVector) |
| Utility function that fills in the pair vector for subscription with region in HLA 1516. | |
Static Protected Member Functions | |
| static void | startRegCb (RTI::ObjectClassHandle h, void *usr) |
| Callback for handling startRegistration RTI callback. | |
| static void | stopRegCb (RTI::ObjectClassHandle h, void *usr) |
| Callback for handling stopRegistration RTI callback. | |
| static void | ddmDisabled () |
Protected Attributes | |
| DtString | myName |
| RTI::ObjectClassHandle | myHandle |
| RTI::AttributeHandleSet * | myAttrs |
| RTI::AttributeHandleSet * | myOwnAttrs |
| RTI::AttributeHandleSet * | mySubAttrs |
| RTI::AttributeHandleSet * | myPubAttrs |
| RTI::AttributeHandleSet * | myAttrsWithSpace |
| Attributes with a space (or dimensions in 1516) defined in the FOM. | |
| RTI::AttributeHandleSet * | myAttrsWithoutSpace |
| Attributes without a space (or dimensions in 1516) defined in the FOM. | |
| RTI::AttributeHandleSet * | mySubAttrsWithSpace |
| RTI::AttributeHandleSet * | mySubAttrsWithoutSpace |
| bool | myClassNeeded |
| DtObjClassDesc * | myBase |
| DtExerciseConn * | myExConn |
| bool | myPublished |
| bool | myEverPublished |
| bool | myEverSubscribed |
| int | myNumSubscribeRequests |
| bool | mySubscribeToUnspecifiedAttributesFlag |
| RTI::AttributeHandle | myPrivHandle |
| Handle of the privilegeToDelete attribute. | |
| RTI::AttributeHandle | myMinAttrHand |
| RTI::AttributeHandle | myMaxAttrHand |
| StringToAttributeHandleMap | myStringToHandleMap |
| DtObjectTagModifierSP | myTagModifier |
| RegionHandleVector | mySubscribedRegions |
| DtHlaStateEncoder::DtAttributeEncoder | myUnknownAttributeEncoder |
| DtHlaStateDecoder::DtAttributeDecoder | myUnknownAttributeDecoder |
Static Protected Attributes | |
| static bool | theDdmEnabled |
| static double | theSubscriptionTimeDelay |
An instance of DtObjClassDesc is a "class descriptor" for an HLA Object class.
A list of all DtObjClassDescs for the various classes in a FOM can be obtained from a DtFom. A DtObjClassDesc can tell you the set of attributes associated with the class, the class's handle, name, and base class. Publication, subscription and update requests are done through the DtObjClassDesc as well, and the DtObjClassDesc maintains information on which attributes of the class are subscribed to by remote federates. By registering callbacks on start/stopUpdates, a DtObjClassDesc can tell you which attributes of the class have been subscribed to by other federates.
typedef std::vector<RTI::AttributeHandleSetRegionHandleSetPair> DtObjClassDesc::RegionHandleVector [protected] |
typedef std::map<RTI::AttributeHandle, DtString> DtObjClassDesc::StringToAttributeHandleMap [protected] |
| DtObjClassDesc::DtObjClassDesc | ( | const char * | className, |
| DtObjClassDesc * | base, | ||
| RTI::ObjectClassHandle | handle, | ||
| DtExerciseConn * | exConn | ||
| ) |
Constructor.
Adds the base class's attributes to our attribute set. Used when reading FED file.
| virtual DtObjClassDesc::~DtObjClassDesc | ( | ) | [virtual] |
destructor
| virtual void DtObjClassDesc::addAttr | ( | const char * | attrName, |
| bool | withSpace = false |
||
| ) | [virtual] |
Add an attribute (Used when reading FED file).
| const RTI::AttributeHandleSet & DtObjClassDesc::attrHandleSet | ( | ) | const [inline, virtual] |
Get the set of valid attribute handles for this class.
Includes attributes inherited from base classes.
References myAttrs.
Referenced by DtHlaObject::attrHandleSet().
| virtual RTI::AttributeHandle DtObjClassDesc::attributeHandleByName | ( | const char * | attrName | ) | const [virtual] |
Returns the attribute handle for this attribute name.
| virtual DtString DtObjClassDesc::attributeNameByHandle | ( | const RTI::AttributeHandle & | hand | ) | const [virtual] |
Returns a string holding the name of the attribute handle.
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::attributesWithoutSpace | ( | ) | const [virtual] |
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::attributesWithSpace | ( | ) | const [virtual] |
| const DtObjClassDesc * DtObjClassDesc::baseClass | ( | ) | const [inline, virtual] |
Return a pointer to the base class's descriptor, NULL if none.
References myBase.
| DtObjClassDesc * DtObjClassDesc::baseClass | ( | ) | [inline, virtual] |
Return a pointer to the base class's descriptor, NULL if none.
References myBase.
| virtual bool DtObjClassDesc::classNeededByFederation | ( | ) | [virtual] |
Returns true if the class is currently needed by the federation.
If VR-Link is using advisories, this function will return true if we've either received a startRegistrationForObjectClass call for the class; otherwise this function will always return true. NOTE: We will only receive calls such as startRegistrationForObjectClass if the class has been published using DtObjClassDesc::publish.
| static void DtObjClassDesc::ddmDisabled | ( | ) | [static, protected] |
| virtual bool DtObjClassDesc::everPublished | ( | ) | const [virtual] |
Return true if we have ever published the class using DtObjClassDesc::publish, false otherwise.
| virtual bool DtObjClassDesc::everSubscribed | ( | ) | const [virtual] |
Return true if we have ever subscribed to the class using DtObjClassDesc::subscribe, false otherwise.
| virtual DtVrlFederateAmbassador* DtObjClassDesc::fedAmb | ( | ) | [virtual] |
Get my federate ambassador.
| virtual void DtObjClassDesc::fillInAttributeHandleSetRegionHandleSetPairVector | ( | const RTI::AttributeHandleSet & | hSet, |
| DtDDMRegionSP | region, | ||
| RTI::AttributeHandleSetRegionHandleSetPairVector & | pairVector | ||
| ) | [protected, virtual] |
Utility function that fills in the pair vector for subscription with region in HLA 1516.
| RTI::ObjectClassHandle DtObjClassDesc::handle | ( | ) | const [inline, virtual] |
| virtual bool DtObjClassDesc::hasAttribute | ( | const char * | attrName | ) | const [virtual] |
Determine whether a particular object has the attribute name specified.
| virtual int DtObjClassDesc::isOfClass | ( | RTI::ObjectClassHandle | hand | ) | const [virtual] |
Returns 1 if the class is of class hand or a subclass of hand, 0 otherwise.
| const char * DtObjClassDesc::name | ( | ) | const [inline, virtual] |
Get the object's class handle.
References DtString::c_str(), and myName.
| int DtObjClassDesc::numAttributes | ( | ) | const [inline, virtual] |
Get the number of attributes associated with this object, including privilege to delete.
References myAttrs.
Referenced by DtHlaObject::numAttributes().
| const RTI::AttributeHandleSet & DtObjClassDesc::ownAttrHandles | ( | ) | const [inline, virtual] |
Get the set of non-inherited attribute handles for this class.
References myOwnAttrs.
| virtual void DtObjClassDesc::passiveSubscribe | ( | ) | [virtual] |
| RTI::AttributeHandle DtObjClassDesc::privilegeHandle | ( | ) | const [inline, virtual] |
Returns the attribute handle of the privilegeToDelete attribute.
References myPrivHandle.
| virtual void DtObjClassDesc::processStartReg | ( | RTI::ObjectClassHandle | h | ) | [protected, virtual] |
Callback for handling startRegistration RTI callback.
| virtual void DtObjClassDesc::processStopReg | ( | RTI::ObjectClassHandle | h | ) | [protected, virtual] |
Callback for handling stopRegistration RTI callback.
| virtual void DtObjClassDesc::publish | ( | ) | [virtual] |
Publishes the class, along with the attributes specified by hSet (or all attributes if no hSet is given).
Also, registers start and stopUpdates callbacks on the published classes. Can be called multiple times to change the set of published classes.
| virtual void DtObjClassDesc::publish | ( | const RTI::AttributeHandleSet & | hSet | ) | [virtual] |
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::publishedAttrs | ( | ) | const [virtual] |
Returns the set of published attributes.
For this to work correctly, do not publish directly through the RTI. Instead, use DtObjClassDesc::publish.
| virtual void DtObjClassDesc::requestUpdates | ( | ) | [virtual] |
Request updates of all objects of this class, include the attributes specified by hSet (or all subscribed attributes if no hSet is given).
| virtual void DtObjClassDesc::requestUpdates | ( | const DtDDMRegionSet & | region | ) | [virtual] |
| virtual void DtObjClassDesc::requestUpdates | ( | const RTI::AttributeHandleSet & | hSet | ) | [virtual] |
| virtual void DtObjClassDesc::requestUpdates | ( | const RTI::AttributeHandleSet & | hSet, |
| DtDDMRegionSP | region | ||
| ) | [virtual] |
| virtual DtVrlRtiAmbassador* DtObjClassDesc::rtiAmb | ( | ) | [virtual] |
Get my RTI ambassador.
| DtObjClassDesc * DtObjClassDesc::self | ( | ) | const [inline, protected, virtual] |
Casts away const-ness. Use with caution.
| virtual void DtObjClassDesc::setSubscribeToUnspecifiedAttributesFlag | ( | bool | subscribe | ) | [virtual] |
Set/get whether subscriptions default unspecified attributes to subscription without region When true, subscriptions with regionset will subscribe without region to attributes not specified anywhere When false, subscriptions with regionset will only subscribe to specified attributes.
| void DtObjClassDesc::setSubscriptionTimeDelay | ( | double | delay | ) | [inline, static] |
Set a time delay to occur after calling RTI::RTIambassador::subscribe() The purpose of this function is to get around a bug in DMSO RTI NG v3.2 for Win98.
If a delay is not used on Win98, DMSO RTI NG may miss subscribe messages and then fail to call discoverObjectInstance() when it's appropriate In most circumstances, you would never want to call this function.
References theSubscriptionTimeDelay.
| virtual void DtObjClassDesc::setUnknownAttributeDecoder | ( | DtHlaStateDecoder::DtAttributeDecoder | decoder | ) | [virtual] |
Set a decoder to be called for this object class for any attribute received in an update that doesn't have a decoder.
| virtual void DtObjClassDesc::setUnknownAttributeEncoder | ( | DtHlaStateEncoder::DtAttributeEncoder | encoder | ) | [virtual] |
Set an encoder to be called for this object class for any attribute that doesn't have an encoder set for it.
Note that this will be called every tick for each unknown attribute in the object class, as there is no checker. The user can simply not add the handle/value to the AttributeHandleValuePairSet if an update should not be made.
| virtual void DtObjClassDesc::setUserTagModifier | ( | DtObjectTagModifierSP | modifier | ) | [virtual] |
| static void DtObjClassDesc::startRegCb | ( | RTI::ObjectClassHandle | h, |
| void * | usr | ||
| ) | [static, protected] |
Callback for handling startRegistration RTI callback.
| static void DtObjClassDesc::stopRegCb | ( | RTI::ObjectClassHandle | h, |
| void * | usr | ||
| ) | [static, protected] |
Callback for handling stopRegistration RTI callback.
| virtual void DtObjClassDesc::subscribe | ( | std::wstring const & | updateRateDesignator = L"", |
| bool | active = true |
||
| ) | [virtual] |
Subscribes to the class, along with the attributes specified by hSet (or all attributes is no hSet is given) and a boolean to indicate whether VR-Link should subscribe actively or passively.
Additionally place the update rate restriction on the subscription The updateRateDesignator takes effect on HLA Evolved ONLY.
| virtual void DtObjClassDesc::subscribe | ( | const DtDDMRegionSet & | region, |
| std::wstring const & | updateRateDesignator = L"", |
||
| bool | active = true |
||
| ) | [virtual] |
| virtual void DtObjClassDesc::subscribe | ( | const RTI::AttributeHandleSet & | hSet, |
| std::wstring const & | updateRateDesignator = L"", |
||
| bool | active = true |
||
| ) | [virtual] |
| virtual void DtObjClassDesc::subscribe | ( | const RTI::AttributeHandleSet & | hSet, |
| DtDDMRegionSP | region, | ||
| std::wstring const & | updateRateDesignator = L"", |
||
| bool | active = true |
||
| ) | [virtual] |
subscribe with the region passed in.
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::subscribedAttrs | ( | ) | const [virtual] |
Returns the set of subscribed attributes.
For this to work correctly, do not publish directly through the RTI. Instead, use DtObjClassDesc::subscribe.
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::subscribedAttrsWithoutSpace | ( | ) | const [virtual] |
| virtual const RTI::AttributeHandleSet& DtObjClassDesc::subscribedAttrsWithSpace | ( | ) | const [virtual] |
| virtual bool DtObjClassDesc::subscribeToUnspecifiedAttributesFlag | ( | ) | [virtual] |
| virtual void DtObjClassDesc::synchSubscribedAttributes | ( | ) | [protected, virtual] |
Updates subscribed attributes using values from subscribed attributes with/without space.
| virtual DtHlaStateDecoder::DtAttributeDecoder DtObjClassDesc::unknownAttributeDecoder | ( | ) | [virtual] |
Returns the unknown attribute decoder. Returns null if not set.
| virtual DtHlaStateEncoder::DtAttributeEncoder DtObjClassDesc::unknownAttributeEncoder | ( | ) | [virtual] |
Returns the unknown attribute encoder. Returns null if not set.
| virtual void DtObjClassDesc::unpublish | ( | ) | [virtual] |
Unpublishes the class. Same as publish with an empty attribute set.
| virtual void DtObjClassDesc::unsubscribe | ( | ) | [virtual] |
Unsubscribe to the class.
| virtual void DtObjClassDesc::unsubscribe | ( | const DtDDMRegionSet & | regionSet | ) | [virtual] |
| virtual DtObjectTagModifierSP DtObjClassDesc::userTagModifier | ( | ) | [virtual] |
RTI::AttributeHandleSet* DtObjClassDesc::myAttrs [protected] |
Referenced by attrHandleSet(), and numAttributes().
RTI::AttributeHandleSet* DtObjClassDesc::myAttrsWithoutSpace [protected] |
Attributes without a space (or dimensions in 1516) defined in the FOM.
RTI::AttributeHandleSet* DtObjClassDesc::myAttrsWithSpace [protected] |
Attributes with a space (or dimensions in 1516) defined in the FOM.
DtObjClassDesc* DtObjClassDesc::myBase [protected] |
Referenced by baseClass().
bool DtObjClassDesc::myClassNeeded [protected] |
bool DtObjClassDesc::myEverPublished [protected] |
bool DtObjClassDesc::myEverSubscribed [protected] |
DtExerciseConn* DtObjClassDesc::myExConn [protected] |
RTI::ObjectClassHandle DtObjClassDesc::myHandle [protected] |
Referenced by handle().
RTI::AttributeHandle DtObjClassDesc::myMaxAttrHand [protected] |
RTI::AttributeHandle DtObjClassDesc::myMinAttrHand [protected] |
DtString DtObjClassDesc::myName [protected] |
Referenced by name().
int DtObjClassDesc::myNumSubscribeRequests [protected] |
RTI::AttributeHandleSet* DtObjClassDesc::myOwnAttrs [protected] |
Referenced by ownAttrHandles().
RTI::AttributeHandle DtObjClassDesc::myPrivHandle [protected] |
Handle of the privilegeToDelete attribute.
Referenced by privilegeHandle().
RTI::AttributeHandleSet* DtObjClassDesc::myPubAttrs [protected] |
bool DtObjClassDesc::myPublished [protected] |
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrs [protected] |
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrsWithoutSpace [protected] |
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrsWithSpace [protected] |
bool DtObjClassDesc::mySubscribeToUnspecifiedAttributesFlag [protected] |
DtObjectTagModifierSP DtObjClassDesc::myTagModifier [protected] |
bool DtObjClassDesc::theDdmEnabled [static, protected] |
double DtObjClassDesc::theSubscriptionTimeDelay [static, protected] |
Referenced by setSubscriptionTimeDelay().