+
+ _rtiObjectInstance = rtiObjectInstance;
+ _rtiObjectInstance->setObjectInstance(this);
+ _name = _rtiObjectInstance->getName();
+
+ unsigned numAttributes = getNumAttributes();
+ _attributeVector.resize(numAttributes);
+ for (unsigned i = 0; i < numAttributes; ++i) {
+ HLAUpdateType updateType = _objectClass->getAttributeUpdateType(i);
+ if (getAttributeOwned(i) && updateType != HLAUndefinedUpdate) {
+ _attributeVector[i]._enabledUpdate = true;
+ _attributeVector[i]._unconditionalUpdate = (updateType == HLAPeriodicUpdate);
+ // In case of an owned attribute, now encode its value
+ encodeAttributeValue(i);
+ } else {
+ _attributeVector[i]._enabledUpdate = false;
+ _attributeVector[i]._unconditionalUpdate = false;
+ }
+ }
+
+ // This makes sense with any new object. Even if we registered one, there might be unpublished attributes.
+ HLAIndexList indexList;
+ for (unsigned i = 0; i < numAttributes; ++i) {
+ HLAUpdateType updateType = _objectClass->getAttributeUpdateType(i);
+ if (getAttributeOwned(i))
+ continue;
+ if (updateType == HLAUndefinedUpdate)
+ continue;
+ if (updateType == HLAPeriodicUpdate)
+ continue;
+ indexList.push_back(i);
+ }
+ _rtiObjectInstance->requestObjectAttributeValueUpdate(indexList);
+}
+
+void
+HLAObjectInstance::_clearRTIObjectInstance()
+{
+ if (!_rtiObjectInstance.valid())
+ return;
+
+ for (unsigned i = 0; i < _attributeVector.size(); ++i) {
+ _attributeVector[i]._enabledUpdate = false;
+ _attributeVector[i]._unconditionalUpdate = false;
+ }
+
+ _rtiObjectInstance->setObjectInstance(0);
+ _rtiObjectInstance = 0;
+}
+
+void
+HLAObjectInstance::_removeInstance(const RTIData& tag)
+{
+ if (!_objectClass.valid())
+ return;
+ _objectClass->_removeInstance(*this, tag);
+}
+
+void
+HLAObjectInstance::_reflectAttributeValues(const HLAIndexList& indexList, const RTIData& tag)
+{
+ if (_reflectCallback.valid()) {
+ _reflectCallback->reflectAttributeValues(*this, indexList, tag);
+ } else {
+ reflectAttributeValues(indexList, tag);
+ }
+}
+
+void
+HLAObjectInstance::_reflectAttributeValues(const HLAIndexList& indexList, const SGTimeStamp& timeStamp, const RTIData& tag)
+{
+ if (_reflectCallback.valid()) {
+ _reflectCallback->reflectAttributeValues(*this, indexList, timeStamp, tag);
+ } else {
+ reflectAttributeValues(indexList, timeStamp, tag);
+ }