Before they send any data, HLA federates must tell the RTI the set of FOM classes and the set of attributes of object classes for which it is capable of sending data.
The HLA specification refers to this initialization activity as "publishing" a class, or "publishing" a class with a set of attributes. (Though some people refer to the act of sending interactions or sending attribute value updates as publishing, that is not the meaning of the word as defined by the RTI or HLA specification.)
Similarly, an HLA federate must indicate to the RTI the set of FOM classes and the set of attributes of object classes for which it is interested in receiving data from other federates. This initialization activity is called "subscribing".
Most VR-Link applications do not need to do anything special to fulfill the publishing and subscribing requirement; VR-Link takes care of this for you. However, if you want to alter the set of classes or attributes that get subscribed to or published, you can do so through VR-Link.
When you create an instance of a particular kind of object publisher (for example, a DtEntityPublisher), VR-Link determines which object class from the FOM should be used to represent the object (typically by either using the class handle passed to the publisher's constructor, or by asking the FOM Mapper). Before registering the new HLA object with the RTI, we publish the object class if the federate has not already published the class or explicitly unpublished it. By default, the class's full set of valid attributes is published.
To publish only a subset of an object class's attributes, you must explicitly publish the object class, along with the desired attribute set, before creating the object publisher. This is done using DtObjClassDesc::publish(). When the object publisher is constructed, it sees that the class has already been published, and does not perform the default publication.
For example, to publish only the EntityType and Position attributes of the GroundVehicle class:
Attribute publications apply only to the class that you specify, not to subclasses or superclasses. So you will need to call publish() on multiple class descriptors to change the set of attributes published for a whole portion of a class hierarchy.
Publishing interactions works a little differently from publishing objects. You cannot publish only a subset of the parameters of an interaction. You either publish an interaction class with all of its parameters, or not at all. When you send an interaction of a particular class using DtExerciseConn::send() or DtExerciseConn::sendStamped(), VR-Link publishes the interaction class if it is not currently published by the federate.
Usually, a reflected object list's constructor subscribes to object classes. A particular kind of reflected object list (for example, a DtReflectedEntityList) determines which FOM classes it is interested in, typically by either using the class handles passed to the constructor, or by asking the FOM Mapper. Then, it subscribes to each of those classes to which the federate is not already subscribed.
Most reflected object lists in VR-Link take an optional handleList argument, which lets you specify exactly which FOM classes should be subscribed to (and managed by the reflected object list). If this argument to the DtReflectedEntityList constructor is omitted, it gets the set of classes to subscribe to from the FOM Mapper. (The default FOM Mapper says that BaseEntity and all of its subclasses except AggregateEntity should be managed by DtReflectedEntityList.)
HLA 1.3: The handleList is a DtList of RTI::ObjectClassHandles, cast to void*. HLA 1516: The handleList is a list of pointers to valid RTI::ObjectClassHandles.
The following example demonstrates the procedure for telling a DtReflectedEntityList to subscribe to and manage only the GroundVehicle and Munition FOM classes:
By default, when VR-Link subscribes to an object class, it subscribes to all attributes of the class. If you want to subscribe to only a subset of an object class's attributes, the procedure is the same as that for publishing a subset of an object class's attributes, except that you use the DtObjClassDesc::subscribe() function, instead of publish(). For more information, please see 5.4.1 Publishing Classes and Attributes.
Subscription to interaction classes normally takes place when you register a callback function with a VR-Link interaction class. That action tells VR-Link that you are interested in a certain set of interaction classes, and VR-Link passes that information on to the RTI. Just as with publication, the RTI API does not let you subscribe to a subset of an interaction's parameters.
[<< Getting Information About the FOM] [Home] [Top of Page] [Managing HLA Objects >>]