VR-Link API Documentation for HLA Evolved
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
DtObjClassDesc Class Reference

An instance of DtObjClassDesc is a "class descriptor" for an HLA Object class. More...

+ Collaboration diagram for DtObjClassDesc:

List of all members.

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 DtObjClassDescbaseClass () const
 Return a pointer to the base class's descriptor, NULL if none.
virtual DtObjClassDescbaseClass ()
 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 int minAttrHandle () const
 Returns minimum/maximum attribute handle for the class.
virtual int maxAttrHandle () const
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 (const RTI::AttributeHandleSet &hSet, 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 RTI::AttributeHandleSet &hSet, DtDDMRegionSP region, bool active=true)
 Subscribes to the class attributes specified by hSet, a region, and a boolean to indicate whether VR-Link should subscribe actively or passively.
virtual void subscribe ()
virtual void subscribe (const DtDDMRegionSet &regionSet)
virtual void passiveSubscribe ()
virtual void unsubscribe ()
 Unsubscribe to the class.
virtual void unsubscribe (const DtDDMRegionSet &regionSet)
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 &region)
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 DtVrlRtiAmbassadorrtiAmb ()
 Get my RTI ambassador.
virtual DtVrlFederateAmbassadorfedAmb ()
 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 setMaxAttributes (int num)
 Set/Get the maximum number of attributes that any class can have this exercise.
static int maxAttributes ()
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

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 DtObjClassDescself () const
 Casts away const-ness. Use with caution.
virtual void synchSubscribedAttributes ()
 Updates subscribed attributes using values from subscribed attributes with/without space.

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.

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
DtObjClassDescmyBase
DtExerciseConnmyExConn
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
std::vector< DtDDMRegionSPmySubscribedRegions
DtHlaStateEncoder::DtAttributeEncoder myUnknownAttributeEncoder
DtHlaStateDecoder::DtAttributeDecoder myUnknownAttributeDecoder

Static Protected Attributes

static int theMaxAttrs
static double theSubscriptionTimeDelay

Detailed Description

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.


Member Typedef Documentation

typedef std::map<RTI::AttributeHandle, DtString> DtObjClassDesc::StringToAttributeHandleMap [protected]

Constructor & Destructor Documentation

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


Member Function Documentation

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.

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.

Get my federate ambassador.

RTI::ObjectClassHandle DtObjClassDesc::handle ( ) const [inline, virtual]

Get the object's class handle.

References myHandle.

Referenced by DtHlaObject::objectClassHandle().

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.

virtual int DtObjClassDesc::maxAttrHandle ( ) const [virtual]
int DtObjClassDesc::maxAttributes ( ) [inline, static]

References theMaxAttrs.

virtual int DtObjClassDesc::minAttrHandle ( ) const [virtual]

Returns minimum/maximum attribute handle for the class.

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]

Get my RTI ambassador.

DtObjClassDesc * DtObjClassDesc::self ( ) const [inline, protected, virtual]

Casts away const-ness. Use with caution.

void DtObjClassDesc::setMaxAttributes ( int  num) [inline, static]

Set/Get the maximum number of attributes that any class can have this exercise.

References theMaxAttrs.

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.

Set a decoder to be called for this object class for any attribute received in an update that doesn't have a decoder.

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 ( const RTI::AttributeHandleSet &  hSet,
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.

virtual void DtObjClassDesc::subscribe ( const RTI::AttributeHandleSet &  hSet,
DtDDMRegionSP  region,
bool  active = true 
) [virtual]

Subscribes to the class attributes specified by hSet, a region, and a boolean to indicate whether VR-Link should subscribe actively or passively.

Will subscribe with the region passed in.

virtual void DtObjClassDesc::subscribe ( ) [virtual]
virtual void DtObjClassDesc::subscribe ( const DtDDMRegionSet regionSet) [virtual]
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 void DtObjClassDesc::synchSubscribedAttributes ( ) [protected, virtual]

Updates subscribed attributes using values from subscribed attributes with/without space.

Returns the unknown attribute decoder. Returns null if not set.

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]

Member Data Documentation

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.

Referenced by baseClass().

RTI::ObjectClassHandle DtObjClassDesc::myHandle [protected]

Referenced by handle().

RTI::AttributeHandle DtObjClassDesc::myMaxAttrHand [protected]
RTI::AttributeHandle DtObjClassDesc::myMinAttrHand [protected]

Referenced by name().

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]
int DtObjClassDesc::theMaxAttrs [static, protected]

Referenced by maxAttributes(), and setMaxAttributes().

double DtObjClassDesc::theSubscriptionTimeDelay [static, protected]

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)