+ SGSharedPtr<HLAFederate> federate = _federate.lock();
+ if (!federate.valid()) {
+ SG_LOG(SG_NETWORK, SG_ALERT, "RTI: could not find parent federate while discovering object instance");
+ return;
+ }
+
+ SGSharedPtr<HLAObjectInstance> objectInstance = createObjectInstance(rtiObjectInstance->getName());
+ if (!objectInstance.valid()) {
+ SG_LOG(SG_NETWORK, SG_INFO, "RTI: could not create new object instance for discovered \""
+ << rtiObjectInstance->getName() << "\" object");
+ return;
+ }
+ SG_LOG(SG_NETWORK, SG_INFO, "RTI: create new object instance for discovered \""
+ << rtiObjectInstance->getName() << "\" object");
+ objectInstance->_setRTIObjectInstance(rtiObjectInstance);
+ if (!federate->_insertObjectInstance(objectInstance)) {
+ SG_LOG(SG_NETWORK, SG_ALERT, "RTI: could not insert new object instance for discovered \""
+ << rtiObjectInstance->getName() << "\" object");