VR-Link API Documentation for HLA 1.3
List of all members | 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:

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 void addChildClass (DtObjClassDesc *child)
 Informs base class that it has a new child class.
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 DtObjClassDescfirstSubscribed ()
 Return the class descriptor for the first subscribed ancestor including this class.
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.
virtual void addAttr (const char *attrName, RTI::AttributeHandle attrHandle, bool isPrivilegeToDelete, bool withSpace=false)
 Add an attribute after the handle is known.

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
std::list< DtObjClassDesc * > myChildren
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).

virtual void DtObjClassDesc::addAttr ( const char *  attrName,
RTI::AttributeHandle  attrHandle,
bool  isPrivilegeToDelete,
bool  withSpace = false 
)
protectedvirtual

Add an attribute after the handle is known.

void DtObjClassDesc::addChildClass ( DtObjClassDesc child)
inlinevirtual

Informs base class that it has a new child class.

References myChildren.

const RTI::AttributeHandleSet & DtObjClassDesc::attrHandleSet ( ) const
inlinevirtual

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
inlinevirtual

Return a pointer to the base class's descriptor, NULL if none.

References myBase.

DtObjClassDesc * DtObjClassDesc::baseClass ( )
inlinevirtual

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.

virtual DtVrlFederateAmbassador* DtObjClassDesc::fedAmb ( )
virtual

Get my federate ambassador.

virtual DtObjClassDesc* DtObjClassDesc::firstSubscribed ( )
virtual

Return the class descriptor for the first subscribed ancestor including this class.

Null is returned if no ancestor is subscribed.

RTI::ObjectClassHandle DtObjClassDesc::handle ( ) const
inlinevirtual

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 ( )
inlinestatic

References theMaxAttrs.

virtual int DtObjClassDesc::minAttrHandle ( ) const
virtual

Returns minimum/maximum attribute handle for the class.

const char * DtObjClassDesc::name ( ) const
inlinevirtual

Get the object's class handle.

References DtString::c_str(), and myName.

int DtObjClassDesc::numAttributes ( ) const
inlinevirtual

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
inlinevirtual

Get the set of non-inherited attribute handles for this class.

References myOwnAttrs.

virtual void DtObjClassDesc::passiveSubscribe ( )
virtual
RTI::AttributeHandle DtObjClassDesc::privilegeHandle ( ) const
inlinevirtual

Returns the attribute handle of the privilegeToDelete attribute.

References myPrivHandle.

virtual void DtObjClassDesc::processStartReg ( RTI::ObjectClassHandle  h)
protectedvirtual

Callback for handling startRegistration RTI callback.

virtual void DtObjClassDesc::processStopReg ( RTI::ObjectClassHandle  h)
protectedvirtual

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
inlineprotectedvirtual

Casts away const-ness. Use with caution.

void DtObjClassDesc::setMaxAttributes ( int  num)
inlinestatic

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)
inlinestatic

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 
)
staticprotected

Callback for handling startRegistration RTI callback.

static void DtObjClassDesc::stopRegCb ( RTI::ObjectClassHandle  h,
void *  usr 
)
staticprotected

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 bool DtObjClassDesc::subscribeToUnspecifiedAttributesFlag ( )
virtual
virtual void DtObjClassDesc::synchSubscribedAttributes ( )
protectedvirtual

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

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.

DtObjClassDesc* DtObjClassDesc::myBase
protected

Referenced by baseClass().

std::list<DtObjClassDesc*> DtObjClassDesc::myChildren
protected

Referenced by addChildClass().

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
StringToAttributeHandleMap DtObjClassDesc::myStringToHandleMap
protected
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrs
protected
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrsWithoutSpace
protected
RTI::AttributeHandleSet* DtObjClassDesc::mySubAttrsWithSpace
protected
std::vector<DtDDMRegionSP> DtObjClassDesc::mySubscribedRegions
protected
bool DtObjClassDesc::mySubscribeToUnspecifiedAttributesFlag
protected
DtObjectTagModifierSP DtObjClassDesc::myTagModifier
protected
DtHlaStateDecoder::DtAttributeDecoder DtObjClassDesc::myUnknownAttributeDecoder
protected
DtHlaStateEncoder::DtAttributeEncoder DtObjClassDesc::myUnknownAttributeEncoder
protected
int DtObjClassDesc::theMaxAttrs
staticprotected

Referenced by maxAttributes(), and setMaxAttributes().

double DtObjClassDesc::theSubscriptionTimeDelay
staticprotected

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

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)