1 // Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #include "RTI13Federate.hxx"
20 #include "RTI13Ambassador.hxx"
24 static std::string toStdString(const char* n)
28 return std::string(n);
31 /// Just the interface class doing the callbacks into the parent class
32 struct RTI13Federate::FederateAmbassador : public RTI::FederateAmbassador {
33 FederateAmbassador() :
34 _timeRegulationEnabled(false),
35 _timeConstrainedEnabled(false),
36 _timeAdvancePending(false)
39 virtual ~FederateAmbassador()
40 throw (RTI::FederateInternalError)
44 /// Generic callback to execute some notification on objects in a way that they are not prone to
45 /// ConcurrentAccess exceptions.
46 class QueueCallback : public SGReferenced {
48 virtual ~QueueCallback() {}
49 virtual void operator()(FederateAmbassador& self) = 0;
51 class TagQueueCallback : public QueueCallback {
53 TagQueueCallback(const char* tag)
56 _tag.setData(tag, std::strlen(tag) + 1);
60 virtual ~TagQueueCallback()
65 /// RTI federate ambassador callback functions.
66 virtual void synchronizationPointRegistrationSucceeded(const char* label)
67 throw (RTI::FederateInternalError)
71 virtual void synchronizationPointRegistrationFailed(const char* label)
72 throw (RTI::FederateInternalError)
76 virtual void announceSynchronizationPoint(const char* label, const char* tag)
77 throw (RTI::FederateInternalError)
79 _pendingSyncLabels.insert(toStdString(label));
82 virtual void federationSynchronized(const char* label)
83 throw (RTI::FederateInternalError)
85 std::string s = toStdString(label);
86 _pendingSyncLabels.erase(s);
87 _syncronizedSyncLabels.insert(s);
90 virtual void initiateFederateSave(const char* label)
91 throw (RTI::UnableToPerformSave,
92 RTI::FederateInternalError)
96 virtual void federationSaved()
97 throw (RTI::FederateInternalError)
101 virtual void federationNotSaved()
102 throw (RTI::FederateInternalError)
106 virtual void requestFederationRestoreSucceeded(const char* label)
107 throw (RTI::FederateInternalError)
111 virtual void requestFederationRestoreFailed(const char* label, const char* reason)
112 throw (RTI::FederateInternalError)
116 virtual void federationRestoreBegun()
117 throw (RTI::FederateInternalError)
121 virtual void initiateFederateRestore(const char* label, RTI::FederateHandle federateHandle)
122 throw (RTI::SpecifiedSaveLabelDoesNotExist,
123 RTI::CouldNotRestore,
124 RTI::FederateInternalError)
128 virtual void federationRestored()
129 throw (RTI::FederateInternalError)
133 virtual void federationNotRestored()
134 throw (RTI::FederateInternalError)
138 // Declaration Management
139 class StartRegistrationForObjectClassCallback : public QueueCallback {
141 StartRegistrationForObjectClassCallback(RTI::ObjectClassHandle objectClassHandle) :
142 _objectClassHandle(objectClassHandle)
144 virtual void operator()(FederateAmbassador& self)
145 { self.startRegistrationForObjectClassCallback(_objectClassHandle); }
147 RTI::ObjectClassHandle _objectClassHandle;
149 virtual void startRegistrationForObjectClass(RTI::ObjectClassHandle objectClassHandle)
150 throw (RTI::ObjectClassNotPublished,
151 RTI::FederateInternalError)
152 { _queueCallbackList.push_back(new StartRegistrationForObjectClassCallback(objectClassHandle)); }
153 void startRegistrationForObjectClassCallback(RTI::ObjectClassHandle objectClassHandle)
155 ObjectClassMap::iterator i = _objectClassMap.find(objectClassHandle);
156 if (i == _objectClassMap.end())
158 if (!i->second.valid())
160 i->second->startRegistration();
163 class StopRegistrationForObjectClassCallback : public QueueCallback {
165 StopRegistrationForObjectClassCallback(RTI::ObjectClassHandle objectClassHandle) :
166 _objectClassHandle(objectClassHandle)
168 virtual void operator()(FederateAmbassador& self)
169 { self.stopRegistrationForObjectClassCallback(_objectClassHandle); }
171 RTI::ObjectClassHandle _objectClassHandle;
173 virtual void stopRegistrationForObjectClass(RTI::ObjectClassHandle objectClassHandle)
174 throw (RTI::ObjectClassNotPublished,
175 RTI::FederateInternalError)
176 { _queueCallbackList.push_back(new StopRegistrationForObjectClassCallback(objectClassHandle)); }
177 void stopRegistrationForObjectClassCallback(RTI::ObjectClassHandle objectClassHandle)
179 ObjectClassMap::iterator i = _objectClassMap.find(objectClassHandle);
180 if (i == _objectClassMap.end())
182 if (!i->second.valid())
184 i->second->stopRegistration();
187 virtual void turnInteractionsOn(RTI::InteractionClassHandle interactionClassHandle)
188 throw (RTI::InteractionClassNotPublished,
189 RTI::FederateInternalError)
193 virtual void turnInteractionsOff(RTI::InteractionClassHandle interactionClassHandle)
194 throw (RTI::InteractionClassNotPublished,
195 RTI::FederateInternalError)
200 class DiscoverObjectCallback : public TagQueueCallback {
202 DiscoverObjectCallback(RTI::ObjectHandle objectHandle, RTI::ObjectClassHandle objectClassHandle, const char *tag) :
203 TagQueueCallback(tag),
204 _objectHandle(objectHandle),
205 _objectClassHandle(objectClassHandle)
207 virtual void operator()(FederateAmbassador& self)
208 { self.discoverObjectInstanceCallback(_objectHandle, _objectClassHandle, _tag); }
210 RTI::ObjectHandle _objectHandle;
211 RTI::ObjectClassHandle _objectClassHandle;
213 virtual void discoverObjectInstance(RTI::ObjectHandle objectHandle, RTI::ObjectClassHandle objectClassHandle, const char* tag)
214 throw (RTI::CouldNotDiscover,
215 RTI::ObjectClassNotKnown,
216 RTI::FederateInternalError)
217 { _queueCallbackList.push_back(new DiscoverObjectCallback(objectHandle, objectClassHandle, tag)); }
218 void discoverObjectInstanceCallback(RTI::ObjectHandle objectHandle, RTI::ObjectClassHandle objectClassHandle, const RTIData& tag)
220 ObjectClassMap::iterator i = _objectClassMap.find(objectClassHandle);
221 if (i == _objectClassMap.end())
223 if (!i->second.valid())
225 SGSharedPtr<RTI13ObjectInstance> objectInstance = new RTI13ObjectInstance(objectHandle, 0, i->second, _rtiAmbassador.get());
226 _objectInstanceMap[objectHandle] = objectInstance;
227 i->second->discoverInstance(objectInstance.get(), tag);
230 class ReflectAttributeValuesTimestampCallback : public TagQueueCallback {
232 ReflectAttributeValuesTimestampCallback(RTI::ObjectHandle objectHandle,
233 RTI13AttributeHandleDataPairList& attributeHandleDataPairList,
234 const SGTimeStamp& timeStamp, const char *tag) :
235 TagQueueCallback(tag),
236 _objectHandle(objectHandle),
237 _timeStamp(timeStamp)
239 _attributeHandleDataPairList.swap(attributeHandleDataPairList);
241 virtual void operator()(FederateAmbassador& self)
243 self.reflectAttributeValuesCallback(_objectHandle, _attributeHandleDataPairList, _timeStamp, _tag);
244 self.freeAttributeHandleDataPairList(_attributeHandleDataPairList);
247 RTI::ObjectHandle _objectHandle;
248 RTI13AttributeHandleDataPairList _attributeHandleDataPairList;
249 SGTimeStamp _timeStamp;
251 virtual void reflectAttributeValues(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleValuePairSet& attributeValuePairSet,
252 const RTI::FedTime& fedTime, const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
253 throw (RTI::ObjectNotKnown,
254 RTI::AttributeNotKnown,
255 RTI::FederateOwnsAttributes,
256 RTI::InvalidFederationTime,
257 RTI::FederateInternalError)
259 RTI13AttributeHandleDataPairList attributeHandleDataPairList;
261 RTI::ULong numAttribs = attributeValuePairSet.size();
262 for (RTI::ULong i = 0; i < numAttribs; ++i) {
263 appendAttributeHandleDataPair(attributeHandleDataPairList);
264 attributeHandleDataPairList.back().first = attributeValuePairSet.getHandle(i);
265 RTI::ULong length = attributeValuePairSet.getValueLength(i);
266 attributeHandleDataPairList.back().second.resize(length);
267 attributeValuePairSet.getValue(i, attributeHandleDataPairList.back().second.data(), length);
270 _queueCallbackList.push_back(new ReflectAttributeValuesTimestampCallback(objectHandle, attributeHandleDataPairList,
271 RTI13Ambassador::toTimeStamp(fedTime), tag));
273 void reflectAttributeValuesCallback(RTI::ObjectHandle objectHandle, RTI13AttributeHandleDataPairList& attributeHandleDataPairList,
274 const SGTimeStamp& timeStamp, const RTIData& tag)
276 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
277 if (i == _objectInstanceMap.end())
279 if (!i->second.valid())
281 i->second->reflectAttributeValues(attributeHandleDataPairList, timeStamp, tag, _indexPool);
284 class ReflectAttributeValuesCallback : public TagQueueCallback {
286 ReflectAttributeValuesCallback(RTI::ObjectHandle objectHandle, RTI13AttributeHandleDataPairList& attributeHandleDataPairList,
288 TagQueueCallback(tag),
289 _objectHandle(objectHandle)
291 _attributeHandleDataPairList.swap(attributeHandleDataPairList);
293 virtual void operator()(FederateAmbassador& self)
295 self.reflectAttributeValuesCallback(_objectHandle, _attributeHandleDataPairList, _tag);
296 self.freeAttributeHandleDataPairList(_attributeHandleDataPairList);
299 RTI::ObjectHandle _objectHandle;
300 RTI13AttributeHandleDataPairList _attributeHandleDataPairList;
302 virtual void reflectAttributeValues(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleValuePairSet& attributeValuePairSet,
304 throw (RTI::ObjectNotKnown,
305 RTI::AttributeNotKnown,
306 RTI::FederateOwnsAttributes,
307 RTI::FederateInternalError)
309 RTI13AttributeHandleDataPairList attributeHandleDataPairList;
311 RTI::ULong numAttribs = attributeValuePairSet.size();
312 for (RTI::ULong i = 0; i < numAttribs; ++i) {
313 appendAttributeHandleDataPair(attributeHandleDataPairList);
314 attributeHandleDataPairList.back().first = attributeValuePairSet.getHandle(i);
315 RTI::ULong length = attributeValuePairSet.getValueLength(i);
316 attributeHandleDataPairList.back().second.resize(length);
317 attributeValuePairSet.getValue(i, attributeHandleDataPairList.back().second.data(), length);
320 _queueCallbackList.push_back(new ReflectAttributeValuesCallback(objectHandle, attributeHandleDataPairList, tag));
322 void reflectAttributeValuesCallback(RTI::ObjectHandle objectHandle, RTI13AttributeHandleDataPairList& attributeHandleDataPairList,
325 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
326 if (i == _objectInstanceMap.end())
328 if (!i->second.valid())
330 i->second->reflectAttributeValues(attributeHandleDataPairList, tag, _indexPool);
333 virtual void receiveInteraction(RTI::InteractionClassHandle interactionClassHandle, const RTI::ParameterHandleValuePairSet& parameters,
334 const RTI::FedTime& fedTime, const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
335 throw (RTI::InteractionClassNotKnown,
336 RTI::InteractionParameterNotKnown,
337 RTI::InvalidFederationTime,
338 RTI::FederateInternalError)
342 virtual void receiveInteraction(RTI::InteractionClassHandle interactionClassHandle,
343 const RTI::ParameterHandleValuePairSet& parameters, const char* tag)
344 throw (RTI::InteractionClassNotKnown,
345 RTI::InteractionParameterNotKnown,
346 RTI::FederateInternalError)
350 class RemoveObjectTimestampCallback : public TagQueueCallback {
352 RemoveObjectTimestampCallback(RTI::ObjectHandle objectHandle, const SGTimeStamp& timeStamp, const char* tag) :
353 TagQueueCallback(tag),
354 _objectHandle(objectHandle),
355 _timeStamp(timeStamp)
357 virtual void operator()(FederateAmbassador& self)
358 { self.removeObjectInstanceCallback(_objectHandle, _timeStamp, _tag); }
360 RTI::ObjectHandle _objectHandle;
361 SGTimeStamp _timeStamp;
363 virtual void removeObjectInstance(RTI::ObjectHandle objectHandle, const RTI::FedTime& fedTime,
364 const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
365 throw (RTI::ObjectNotKnown,
366 RTI::InvalidFederationTime,
367 RTI::FederateInternalError)
368 { _queueCallbackList.push_back(new RemoveObjectTimestampCallback(objectHandle, RTI13Ambassador::toTimeStamp(fedTime), tag)); }
369 void removeObjectInstanceCallback(RTI::ObjectHandle objectHandle, const SGTimeStamp& timeStamp, const RTIData& tag)
371 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
372 if (i == _objectInstanceMap.end())
374 if (i->second.valid())
375 i->second->removeInstance(tag);
376 _objectInstanceMap.erase(i);
379 class RemoveObjectCallback : public TagQueueCallback {
381 RemoveObjectCallback(RTI::ObjectHandle objectHandle, const char* tag) :
382 TagQueueCallback(tag),
383 _objectHandle(objectHandle)
385 virtual void operator()(FederateAmbassador& self)
386 { self.removeObjectInstanceCallback(_objectHandle, _tag); }
388 RTI::ObjectHandle _objectHandle;
390 virtual void removeObjectInstance(RTI::ObjectHandle objectHandle, const char* tag)
391 throw (RTI::ObjectNotKnown,
392 RTI::FederateInternalError)
393 { _queueCallbackList.push_back(new RemoveObjectCallback(objectHandle, tag)); }
394 void removeObjectInstanceCallback(RTI::ObjectHandle objectHandle, const RTIData& tag)
396 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
397 if (i == _objectInstanceMap.end())
399 if (i->second.valid())
400 i->second->removeInstance(tag);
401 _objectInstanceMap.erase(i);
404 class AttributeHandleSetCallback : public QueueCallback {
406 AttributeHandleSetCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributeHandleSet) :
407 _objectHandle(objectHandle)
409 RTI::ULong numAttribs = attributeHandleSet.size();
410 _attributes.reserve(numAttribs);
411 for (RTI::ULong i = 0; i < numAttribs; ++i)
412 _attributes.push_back(attributeHandleSet.getHandle(i));
415 RTI::ObjectHandle _objectHandle;
416 std::vector<RTI::AttributeHandle> _attributes;
418 class AttributesInScopeCallback : public AttributeHandleSetCallback {
420 AttributesInScopeCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
421 AttributeHandleSetCallback(objectHandle, attributes)
423 virtual void operator()(FederateAmbassador& self)
424 { self.attributesInScopeCallback(_objectHandle, _attributes); }
426 virtual void attributesInScope(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
427 throw (RTI::ObjectNotKnown,
428 RTI::AttributeNotKnown,
429 RTI::FederateInternalError)
430 { _queueCallbackList.push_back(new AttributesInScopeCallback(objectHandle, attributes)); }
431 void attributesInScopeCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
433 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
434 if (i == _objectInstanceMap.end())
436 if (!i->second.valid())
438 i->second->attributesInScope(attributes);
441 class AttributesOutOfScopeCallback : public AttributeHandleSetCallback {
443 AttributesOutOfScopeCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
444 AttributeHandleSetCallback(objectHandle, attributes)
446 virtual void operator()(FederateAmbassador& self)
447 { self.attributesOutOfScopeCallback(_objectHandle, _attributes); }
449 virtual void attributesOutOfScope(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
450 throw (RTI::ObjectNotKnown,
451 RTI::AttributeNotKnown,
452 RTI::FederateInternalError)
453 { _queueCallbackList.push_back(new AttributesOutOfScopeCallback(objectHandle, attributes)); }
454 void attributesOutOfScopeCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
456 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
457 if (i == _objectInstanceMap.end())
459 if (!i->second.valid())
461 i->second->attributesOutOfScope(attributes);
464 class ProvideAttributeValueUpdateCallback : public AttributeHandleSetCallback {
466 ProvideAttributeValueUpdateCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
467 AttributeHandleSetCallback(objectHandle, attributes)
469 virtual void operator()(FederateAmbassador& self)
470 { self.provideAttributeValueUpdateCallback(_objectHandle, _attributes); }
472 virtual void provideAttributeValueUpdate(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
473 throw (RTI::ObjectNotKnown,
474 RTI::AttributeNotKnown,
475 RTI::AttributeNotOwned,
476 RTI::FederateInternalError)
477 { _queueCallbackList.push_back(new ProvideAttributeValueUpdateCallback(objectHandle, attributes)); }
478 void provideAttributeValueUpdateCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
480 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
481 if (i == _objectInstanceMap.end())
483 if (!i->second.valid())
485 i->second->provideAttributeValueUpdate(attributes);
488 class TurnUpdatesOnForObjectInstanceCallback : public AttributeHandleSetCallback {
490 TurnUpdatesOnForObjectInstanceCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
491 AttributeHandleSetCallback(objectHandle, attributes)
493 virtual void operator()(FederateAmbassador& self)
494 { self.turnUpdatesOnForObjectInstanceCallback(_objectHandle, _attributes); }
496 virtual void turnUpdatesOnForObjectInstance(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
497 throw (RTI::ObjectNotKnown,
498 RTI::AttributeNotOwned,
499 RTI::FederateInternalError)
500 { _queueCallbackList.push_back(new TurnUpdatesOnForObjectInstanceCallback(objectHandle, attributes)); }
501 void turnUpdatesOnForObjectInstanceCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
503 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
504 if (i == _objectInstanceMap.end())
506 if (!i->second.valid())
508 i->second->turnUpdatesOnForObjectInstance(attributes);
511 class TurnUpdatesOffForObjectInstanceCallback : public AttributeHandleSetCallback {
513 TurnUpdatesOffForObjectInstanceCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
514 AttributeHandleSetCallback(objectHandle, attributes)
516 virtual void operator()(FederateAmbassador& self)
517 { self.turnUpdatesOffForObjectInstanceCallback(_objectHandle, _attributes); }
519 virtual void turnUpdatesOffForObjectInstance(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
520 throw (RTI::ObjectNotKnown,
521 RTI::AttributeNotOwned,
522 RTI::FederateInternalError)
523 { _queueCallbackList.push_back(new TurnUpdatesOffForObjectInstanceCallback(objectHandle, attributes)); }
524 void turnUpdatesOffForObjectInstanceCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
526 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
527 if (i == _objectInstanceMap.end())
529 if (!i->second.valid())
531 i->second->turnUpdatesOffForObjectInstance(attributes);
534 // Ownership Management
535 class RequestAttributeOwnershipAssumptionCallback : public AttributeHandleSetCallback {
537 RequestAttributeOwnershipAssumptionCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes, const RTIData& tag) :
538 AttributeHandleSetCallback(objectHandle, attributes),
541 virtual void operator()(FederateAmbassador& self)
542 { self.requestAttributeOwnershipAssumptionCallback(_objectHandle, _attributes, _tag); }
546 virtual void requestAttributeOwnershipAssumption(RTI::ObjectHandle objectHandle,
547 const RTI::AttributeHandleSet& attributes, const char* tag)
548 throw (RTI::ObjectNotKnown,
549 RTI::AttributeNotKnown,
550 RTI::AttributeAlreadyOwned,
551 RTI::AttributeNotPublished,
552 RTI::FederateInternalError)
553 { _queueCallbackList.push_back(new RequestAttributeOwnershipAssumptionCallback(objectHandle, attributes, tagToData(tag))); }
554 void requestAttributeOwnershipAssumptionCallback(RTI::ObjectHandle objectHandle, std::vector<RTI::AttributeHandle>& attributes, const RTIData& tag)
556 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
557 if (i == _objectInstanceMap.end())
559 if (!i->second.valid())
561 i->second->requestAttributeOwnershipAssumption(attributes, tag);
564 class AttributeOwnershipDivestitureNotificationCallback : public AttributeHandleSetCallback {
566 AttributeOwnershipDivestitureNotificationCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
567 AttributeHandleSetCallback(objectHandle, attributes)
569 virtual void operator()(FederateAmbassador& self)
570 { self.attributeOwnershipDivestitureNotificationCallback(_objectHandle, _attributes); }
572 virtual void attributeOwnershipDivestitureNotification(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
573 throw (RTI::ObjectNotKnown,
574 RTI::AttributeNotKnown,
575 RTI::AttributeNotOwned,
576 RTI::AttributeDivestitureWasNotRequested,
577 RTI::FederateInternalError)
578 { _queueCallbackList.push_back(new AttributeOwnershipDivestitureNotificationCallback(objectHandle, attributes)); }
579 void attributeOwnershipDivestitureNotificationCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
581 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
582 if (i == _objectInstanceMap.end())
584 if (!i->second.valid())
586 i->second->attributeOwnershipDivestitureNotification(attributes);
589 class AttributeOwnershipAcquisitionNotificationCallback : public AttributeHandleSetCallback {
591 AttributeOwnershipAcquisitionNotificationCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
592 AttributeHandleSetCallback(objectHandle, attributes)
594 virtual void operator()(FederateAmbassador& self)
595 { self.attributeOwnershipAcquisitionNotificationCallback(_objectHandle, _attributes); }
597 virtual void attributeOwnershipAcquisitionNotification(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
598 throw (RTI::ObjectNotKnown,
599 RTI::AttributeNotKnown,
600 RTI::AttributeAcquisitionWasNotRequested,
601 RTI::AttributeAlreadyOwned,
602 RTI::AttributeNotPublished,
603 RTI::FederateInternalError)
604 { _queueCallbackList.push_back(new AttributeOwnershipAcquisitionNotificationCallback(objectHandle, attributes)); }
605 void attributeOwnershipAcquisitionNotificationCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
607 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
608 if (i == _objectInstanceMap.end())
610 if (!i->second.valid())
612 i->second->attributeOwnershipAcquisitionNotification(attributes);
615 class AttributeOwnershipUnavailableCallback : public AttributeHandleSetCallback {
617 AttributeOwnershipUnavailableCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
618 AttributeHandleSetCallback(objectHandle, attributes)
620 virtual void operator()(FederateAmbassador& self)
621 { self.attributeOwnershipUnavailableCallback(_objectHandle, _attributes); }
623 virtual void attributeOwnershipUnavailable(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
624 throw (RTI::ObjectNotKnown,
625 RTI::AttributeNotKnown,
626 RTI::AttributeAlreadyOwned,
627 RTI::AttributeAcquisitionWasNotRequested,
628 RTI::FederateInternalError)
629 { _queueCallbackList.push_back(new AttributeOwnershipUnavailableCallback(objectHandle, attributes)); }
630 void attributeOwnershipUnavailableCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
632 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
633 if (i == _objectInstanceMap.end())
635 if (!i->second.valid())
637 i->second->attributeOwnershipUnavailable(attributes);
640 class RequestAttributeOwnershipReleaseCallback : public AttributeHandleSetCallback {
642 RequestAttributeOwnershipReleaseCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes, const RTIData& tag) :
643 AttributeHandleSetCallback(objectHandle, attributes),
646 virtual void operator()(FederateAmbassador& self)
647 { self.requestAttributeOwnershipReleaseCallback(_objectHandle, _attributes, _tag); }
651 virtual void requestAttributeOwnershipRelease(RTI::ObjectHandle objectHandle,
652 const RTI::AttributeHandleSet& attributes, const char* tag)
653 throw (RTI::ObjectNotKnown,
654 RTI::AttributeNotKnown,
655 RTI::AttributeNotOwned,
656 RTI::FederateInternalError)
657 { _queueCallbackList.push_back(new RequestAttributeOwnershipReleaseCallback(objectHandle, attributes, tagToData(tag))); }
658 void requestAttributeOwnershipReleaseCallback(RTI::ObjectHandle objectHandle, std::vector<RTI::AttributeHandle>& attributes, const RTIData& tag)
660 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
661 if (i == _objectInstanceMap.end())
663 if (!i->second.valid())
665 i->second->requestAttributeOwnershipRelease(attributes, tag);
668 class ConfirmAttributeOwnershipAcquisitionCancellationCallback : public AttributeHandleSetCallback {
670 ConfirmAttributeOwnershipAcquisitionCancellationCallback(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes) :
671 AttributeHandleSetCallback(objectHandle, attributes)
673 virtual void operator()(FederateAmbassador& self)
674 { self.confirmAttributeOwnershipAcquisitionCancellationCallback(_objectHandle, _attributes); }
676 virtual void confirmAttributeOwnershipAcquisitionCancellation(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
677 throw (RTI::ObjectNotKnown,
678 RTI::AttributeNotKnown,
679 RTI::AttributeAlreadyOwned,
680 RTI::AttributeAcquisitionWasNotCanceled,
681 RTI::FederateInternalError)
682 { _queueCallbackList.push_back(new ConfirmAttributeOwnershipAcquisitionCancellationCallback(objectHandle, attributes)); }
683 void confirmAttributeOwnershipAcquisitionCancellationCallback(RTI::ObjectHandle objectHandle, const std::vector<RTI::AttributeHandle>& attributes)
685 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
686 if (i == _objectInstanceMap.end())
688 if (!i->second.valid())
690 i->second->confirmAttributeOwnershipAcquisitionCancellation(attributes);
693 class InformAttributeOwnershipCallback : public QueueCallback {
695 InformAttributeOwnershipCallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle, RTI::FederateHandle federateHandle) :
696 _objectHandle(objectHandle),
697 _attributeHandle(attributeHandle),
698 _federateHandle(federateHandle)
700 virtual void operator()(FederateAmbassador& self)
701 { self.informAttributeOwnershipCallback(_objectHandle, _attributeHandle, _federateHandle); }
703 RTI::ObjectHandle _objectHandle;
704 RTI::AttributeHandle _attributeHandle;
705 RTI::FederateHandle _federateHandle;
707 virtual void informAttributeOwnership(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle,
708 RTI::FederateHandle federateHandle)
709 throw (RTI::ObjectNotKnown,
710 RTI::AttributeNotKnown,
711 RTI::FederateInternalError)
712 { _queueCallbackList.push_back(new InformAttributeOwnershipCallback(objectHandle, attributeHandle, federateHandle)); }
713 void informAttributeOwnershipCallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle, RTI::FederateHandle federateHandle)
715 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
716 if (i == _objectInstanceMap.end())
718 if (!i->second.valid())
720 i->second->informAttributeOwnership(attributeHandle, federateHandle);
723 class AttributeIsNotOwnedCallback : public QueueCallback {
725 AttributeIsNotOwnedCallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle) :
726 _objectHandle(objectHandle),
727 _attributeHandle(attributeHandle)
729 virtual void operator()(FederateAmbassador& self)
730 { self.attributeIsNotOwnedCallback(_objectHandle, _attributeHandle); }
732 RTI::ObjectHandle _objectHandle;
733 RTI::AttributeHandle _attributeHandle;
735 virtual void attributeIsNotOwned(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
736 throw (RTI::ObjectNotKnown,
737 RTI::AttributeNotKnown,
738 RTI::FederateInternalError)
739 { _queueCallbackList.push_back(new AttributeIsNotOwnedCallback(objectHandle, attributeHandle)); }
740 void attributeIsNotOwnedCallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
742 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
743 if (i == _objectInstanceMap.end())
745 if (!i->second.valid())
747 i->second->attributeIsNotOwned(attributeHandle);
750 class AttributeOwnedByRTICallback : public QueueCallback {
752 AttributeOwnedByRTICallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle) :
753 _objectHandle(objectHandle),
754 _attributeHandle(attributeHandle)
756 virtual void operator()(FederateAmbassador& self)
757 { self.attributeOwnedByRTICallback(_objectHandle, _attributeHandle); }
759 RTI::ObjectHandle _objectHandle;
760 RTI::AttributeHandle _attributeHandle;
762 virtual void attributeOwnedByRTI(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
763 throw (RTI::ObjectNotKnown,
764 RTI::AttributeNotKnown,
765 RTI::FederateInternalError)
766 { _queueCallbackList.push_back(new AttributeOwnedByRTICallback(objectHandle, attributeHandle)); }
767 void attributeOwnedByRTICallback(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
769 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
770 if (i == _objectInstanceMap.end())
772 if (!i->second.valid())
774 i->second->attributeOwnedByRTI(attributeHandle);
778 virtual void timeRegulationEnabled(const RTI::FedTime& fedTime)
779 throw (RTI::InvalidFederationTime,
780 RTI::EnableTimeRegulationWasNotPending,
781 RTI::FederateInternalError)
783 _timeRegulationEnabled = true;
784 SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeRegulationEnabled: " << RTI13Ambassador::toTimeStamp(fedTime));
787 virtual void timeConstrainedEnabled(const RTI::FedTime& fedTime)
788 throw (RTI::InvalidFederationTime,
789 RTI::EnableTimeConstrainedWasNotPending,
790 RTI::FederateInternalError)
792 _timeConstrainedEnabled = true;
793 SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeConstrainedEnabled: " << RTI13Ambassador::toTimeStamp(fedTime));
796 virtual void timeAdvanceGrant(const RTI::FedTime& fedTime)
797 throw (RTI::InvalidFederationTime,
798 RTI::TimeAdvanceWasNotInProgress,
799 RTI::FederateInternalError)
801 _timeAdvancePending = false;
802 // SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeAdvanceGrant: " << RTI13Ambassador::toTimeStamp(fedTime));
805 virtual void requestRetraction(RTI::EventRetractionHandle eventRetractionHandle)
806 throw (RTI::EventNotKnown,
807 RTI::FederateInternalError)
809 // No retraction concept yet
812 // processes the queues that filled up during the past
815 while (!_queueCallbackList.empty()) {
816 (*_queueCallbackList.front())(*this);
817 // _queueCallbackListPool.splice();
818 _queueCallbackList.pop_front();
822 bool getFederationSynchronizationPointAnnounced(const std::string& label)
823 { return _pendingSyncLabels.find(label) != _pendingSyncLabels.end(); }
824 bool getFederationSynchronized(const std::string& label)
826 std::set<std::string>::iterator i = _syncronizedSyncLabels.find(label);
827 if (i == _syncronizedSyncLabels.end())
829 _syncronizedSyncLabels.erase(i);
833 // The rtiambassador to issue requests
834 SGSharedPtr<RTI13Ambassador> _rtiAmbassador;
836 // All the sync labels we got an announcement for
837 std::set<std::string> _pendingSyncLabels;
838 std::set<std::string> _syncronizedSyncLabels;
840 // All that calls back into user code is just queued.
841 // That is to make sure we do not call recursively into the RTI
842 typedef std::list<SGSharedPtr<QueueCallback> > QueueCallbackList;
843 QueueCallbackList _queueCallbackList;
844 // QueueCallbackList _queueCallbackListPool;
846 RTI13AttributeHandleDataPairList _attributeHandleDataPairPool;
847 void appendAttributeHandleDataPair(RTI13AttributeHandleDataPairList& attributeHandleDataPairList)
849 if (_attributeHandleDataPairPool.empty())
850 attributeHandleDataPairList.push_back(RTI13AttributeHandleDataPair());
852 attributeHandleDataPairList.splice(attributeHandleDataPairList.end(),
853 _attributeHandleDataPairPool, _attributeHandleDataPairPool.begin());
855 void freeAttributeHandleDataPairList(RTI13AttributeHandleDataPairList& attributeHandleDataPairList)
856 { _attributeHandleDataPairPool.splice(_attributeHandleDataPairPool.end(), attributeHandleDataPairList); }
858 // For attribute reflection, pool or indices
859 HLAIndexList _indexPool;
861 // Top level information for dispatching federate object attribute updates
862 typedef std::map<RTI::ObjectHandle, SGSharedPtr<RTI13ObjectInstance> > ObjectInstanceMap;
863 // Map of all available objects
864 ObjectInstanceMap _objectInstanceMap;
866 // Top level information for dispatching creation of federate objects
867 typedef std::map<RTI::ObjectClassHandle, SGSharedPtr<RTI13ObjectClass> > ObjectClassMap;
868 ObjectClassMap _objectClassMap;
870 // Top level information for dispatching creation of federate objects
871 typedef std::map<RTI::InteractionClassHandle, SGSharedPtr<RTI13InteractionClass> > InteractionClassMap;
872 InteractionClassMap _interactionClassMap;
874 bool _timeRegulationEnabled;
875 bool _timeConstrainedEnabled;
876 bool _timeAdvancePending;
879 const RTIData& tagToData(const char* tag)
882 _cachedTag.setData(tag, std::strlen(tag) + 1);
884 _cachedTag.setData("", 1);
890 RTI13Federate::RTI13Federate(const std::list<std::string>& stringList) :
892 _ambassador(new RTI13Ambassador),
893 _federateAmbassador(new FederateAmbassador)
895 _ambassador->_federate = this;
896 _federateAmbassador->_rtiAmbassador = _ambassador;
897 if (stringList.empty()) {
898 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Ignoring non empty connect arguments while connecting to an RTI13 federation!");
902 RTI13Federate::~RTI13Federate()
905 _ambassador->resignFederationExecution();
906 delete _federateAmbassador;
909 RTI13Federate::FederationManagementResult
910 RTI13Federate::createFederationExecution(const std::string& federationName, const std::string& objectModel)
913 _ambassador->createFederationExecution(federationName, objectModel);
914 return FederationManagementSuccess;
915 } catch (RTI::FederationExecutionAlreadyExists& e) {
916 return FederationManagementFail;
917 } catch (RTI::CouldNotOpenFED& e) {
918 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create federation execution: " << e._name << " " << e._reason);
919 return FederationManagementFatal;
920 } catch (RTI::ErrorReadingFED& e) {
921 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create federation execution: " << e._name << " " << e._reason);
922 return FederationManagementFatal;
923 } catch (RTI::ConcurrentAccessAttempted& e) {
924 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create federation execution: " << e._name << " " << e._reason);
925 return FederationManagementFatal;
926 } catch (RTI::RTIinternalError& e) {
927 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create federation execution: " << e._name << " " << e._reason);
928 return FederationManagementFatal;
932 RTI13Federate::FederationManagementResult
933 RTI13Federate::destroyFederationExecution(const std::string& federation)
936 _ambassador->destroyFederationExecution(federation);
937 return FederationManagementSuccess;
938 } catch (RTI::FederatesCurrentlyJoined& e) {
939 return FederationManagementFail;
940 } catch (RTI::FederationExecutionDoesNotExist& e) {
941 return FederationManagementFail;
942 } catch (RTI::ConcurrentAccessAttempted& e) {
943 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not destroy federation execution: " << e._name << " " << e._reason);
944 return FederationManagementFatal;
945 } catch (RTI::RTIinternalError& e) {
946 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not destroy federation execution: " << e._name << " " << e._reason);
947 return FederationManagementFatal;
951 RTI13Federate::FederationManagementResult
952 RTI13Federate::join(const std::string& federateType, const std::string& federationName)
955 _federateHandle = _ambassador->joinFederationExecution(federateType, federationName, _federateAmbassador);
956 SG_LOG(SG_NETWORK, SG_INFO, "RTI: Joined federation \""
957 << federationName << "\" as \"" << federateType << "\"");
959 return FederationManagementSuccess;
960 } catch (RTI::FederateAlreadyExecutionMember& e) {
961 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
962 return FederationManagementFatal;
963 } catch (RTI::FederationExecutionDoesNotExist& e) {
964 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
965 return FederationManagementFail;
966 } catch (RTI::CouldNotOpenFED& e) {
967 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
968 return FederationManagementFatal;
969 } catch (RTI::ErrorReadingFED& e) {
970 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
971 return FederationManagementFatal;
972 } catch (RTI::ConcurrentAccessAttempted& e) {
973 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
974 return FederationManagementFatal;
975 } catch (RTI::SaveInProgress& e) {
976 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
977 return FederationManagementFatal;
978 } catch (RTI::RestoreInProgress& e) {
979 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
980 return FederationManagementFatal;
981 } catch (RTI::RTIinternalError& e) {
982 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not join federation execution: " << e._name << " " << e._reason);
983 return FederationManagementFatal;
988 RTI13Federate::resign()
991 _ambassador->resignFederationExecution();
992 SG_LOG(SG_NETWORK, SG_INFO, "RTI: Resigned from federation.");
994 _federateHandle = -1;
996 } catch (RTI::FederateOwnsAttributes& e) {
997 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not resign federation execution: " << e._name << " " << e._reason);
999 } catch (RTI::FederateNotExecutionMember& e) {
1000 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not resign federation execution: " << e._name << " " << e._reason);
1002 } catch (RTI::InvalidResignAction& e) {
1003 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not resign federation execution: " << e._name << " " << e._reason);
1005 } catch (RTI::ConcurrentAccessAttempted& e) {
1006 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not resign federation execution: " << e._name << " " << e._reason);
1008 } catch (RTI::RTIinternalError& e) {
1009 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not resign federation execution: " << e._name << " " << e._reason);
1015 RTI13Federate::getJoined() const
1021 RTI13Federate::registerFederationSynchronizationPoint(const std::string& label, const RTIData& tag)
1024 _ambassador->registerFederationSynchronizationPoint(label, tag);
1025 SG_LOG(SG_NETWORK, SG_INFO, "RTI: registerFederationSynchronizationPoint(" << label << ", tag )");
1027 } catch (RTI::FederateNotExecutionMember& e) {
1028 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not register federation synchronization point: " << e._name << " " << e._reason);
1030 } catch (RTI::ConcurrentAccessAttempted& e) {
1031 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not register federation synchronization point: " << e._name << " " << e._reason);
1033 } catch (RTI::SaveInProgress& e) {
1034 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not register federation synchronization point: " << e._name << " " << e._reason);
1036 } catch (RTI::RestoreInProgress& e) {
1037 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not register federation synchronization point: " << e._name << " " << e._reason);
1039 } catch (RTI::RTIinternalError& e) {
1040 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not register federation synchronization point: " << e._name << " " << e._reason);
1046 RTI13Federate::getFederationSynchronizationPointAnnounced(const std::string& label)
1048 return _federateAmbassador->getFederationSynchronizationPointAnnounced(label);
1052 RTI13Federate::synchronizationPointAchieved(const std::string& label)
1055 _ambassador->synchronizationPointAchieved(label);
1056 SG_LOG(SG_NETWORK, SG_INFO, "RTI: synchronizationPointAchieved(" << label << ")");
1058 } catch (RTI::SynchronizationPointLabelWasNotAnnounced& e) {
1059 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1061 } catch (RTI::FederateNotExecutionMember& e) {
1062 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1064 } catch (RTI::ConcurrentAccessAttempted& e) {
1065 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1067 } catch (RTI::SaveInProgress& e) {
1068 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1070 } catch (RTI::RestoreInProgress& e) {
1071 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1073 } catch (RTI::RTIinternalError& e) {
1074 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not signal synchronization point: " << e._name << " " << e._reason);
1080 RTI13Federate::getFederationSynchronized(const std::string& label)
1082 return _federateAmbassador->getFederationSynchronized(label);
1086 RTI13Federate::enableTimeConstrained()
1088 if (!_ambassador.valid()) {
1089 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained at unconnected federate.");
1093 if (_federateAmbassador->_timeConstrainedEnabled) {
1094 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Time constrained is already enabled.");
1099 _ambassador->enableTimeConstrained();
1100 } catch (RTI::TimeConstrainedAlreadyEnabled& e) {
1101 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1103 } catch (RTI::EnableTimeConstrainedPending& e) {
1104 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1106 } catch (RTI::TimeAdvanceAlreadyInProgress& e) {
1107 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1109 } catch (RTI::ConcurrentAccessAttempted& e) {
1110 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1112 } catch (RTI::FederateNotExecutionMember& e) {
1113 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1115 } catch (RTI::SaveInProgress& e) {
1116 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1118 } catch (RTI::RestoreInProgress& e) {
1119 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1121 } catch (RTI::RTIinternalError& e) {
1122 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time constrained: " << e._name << " " << e._reason);
1130 RTI13Federate::disableTimeConstrained()
1132 if (!_ambassador.valid()) {
1133 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained at unconnected federate.");
1137 if (!_federateAmbassador->_timeConstrainedEnabled) {
1138 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Time constrained is not enabled.");
1143 _ambassador->disableTimeConstrained();
1144 _federateAmbassador->_timeConstrainedEnabled = false;
1145 } catch (RTI::TimeConstrainedWasNotEnabled& e) {
1146 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1148 } catch (RTI::FederateNotExecutionMember& e) {
1149 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1151 } catch (RTI::ConcurrentAccessAttempted& e) {
1152 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1154 } catch (RTI::SaveInProgress& e) {
1155 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1157 } catch (RTI::RestoreInProgress& e) {
1158 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1160 } catch (RTI::RTIinternalError& e) {
1161 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time constrained: " << e._name << " " << e._reason);
1169 RTI13Federate::getTimeConstrainedEnabled()
1171 return _federateAmbassador->_timeConstrainedEnabled;
1175 RTI13Federate::enableTimeRegulation(const SGTimeStamp& lookahead)
1177 if (!_ambassador.valid()) {
1178 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation at unconnected federate.");
1182 if (_federateAmbassador->_timeRegulationEnabled) {
1183 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Time regulation already enabled.");
1188 _ambassador->enableTimeRegulation(lookahead);
1189 } catch (RTI::TimeRegulationAlreadyEnabled& e) {
1190 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1192 } catch (RTI::EnableTimeRegulationPending& e) {
1193 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1195 } catch (RTI::TimeAdvanceAlreadyInProgress& e) {
1196 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1198 } catch (RTI::InvalidFederationTime& e) {
1199 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1201 } catch (RTI::InvalidLookahead& e) {
1202 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1204 } catch (RTI::ConcurrentAccessAttempted& e) {
1205 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1207 } catch (RTI::FederateNotExecutionMember& e) {
1208 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1210 } catch (RTI::SaveInProgress& e) {
1211 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1213 } catch (RTI::RestoreInProgress& e) {
1214 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1216 } catch (RTI::RTIinternalError& e) {
1217 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not enable time regulation: " << e._name << " " << e._reason);
1225 RTI13Federate::disableTimeRegulation()
1227 if (!_ambassador.valid()) {
1228 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation at unconnected federate.");
1232 if (!_federateAmbassador->_timeRegulationEnabled) {
1233 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Time regulation is not enabled.");
1238 _ambassador->disableTimeRegulation();
1239 _federateAmbassador->_timeRegulationEnabled = false;
1240 } catch (RTI::TimeRegulationWasNotEnabled& e) {
1241 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1243 } catch (RTI::ConcurrentAccessAttempted& e) {
1244 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1246 } catch (RTI::FederateNotExecutionMember& e) {
1247 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1249 } catch (RTI::SaveInProgress& e) {
1250 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1252 } catch (RTI::RestoreInProgress& e) {
1253 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1255 } catch (RTI::RTIinternalError& e) {
1256 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not disable time regulation: " << e._name << " " << e._reason);
1264 RTI13Federate::modifyLookahead(const SGTimeStamp& timeStamp)
1266 if (!_ambassador.valid()) {
1267 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead.");
1271 _ambassador->modifyLookahead(timeStamp);
1272 } catch (RTI::InvalidLookahead& e) {
1273 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1275 } catch (RTI::FederateNotExecutionMember& e) {
1276 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1278 } catch (RTI::ConcurrentAccessAttempted& e) {
1279 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1281 } catch (RTI::SaveInProgress& e) {
1282 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1284 } catch (RTI::RestoreInProgress& e) {
1285 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1287 } catch (RTI::RTIinternalError& e) {
1288 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not modify lookahead: " << e._name << " " << e._reason);
1295 RTI13Federate::getTimeRegulationEnabled()
1297 return _federateAmbassador->_timeRegulationEnabled;
1301 RTI13Federate::timeAdvanceRequest(const SGTimeStamp& timeStamp)
1303 if (!_ambassador.valid()) {
1304 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time at unconnected federate.");
1309 _ambassador->timeAdvanceRequest(timeStamp);
1310 _federateAmbassador->_timeAdvancePending = true;
1311 } catch (RTI::InvalidFederationTime& e) {
1312 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1314 } catch (RTI::FederationTimeAlreadyPassed& e) {
1315 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1317 } catch (RTI::TimeAdvanceAlreadyInProgress& e) {
1318 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1320 } catch (RTI::EnableTimeRegulationPending& e) {
1321 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1323 } catch (RTI::EnableTimeConstrainedPending& e) {
1324 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1326 } catch (RTI::FederateNotExecutionMember& e) {
1327 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1329 } catch (RTI::ConcurrentAccessAttempted& e) {
1330 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1332 } catch (RTI::SaveInProgress& e) {
1333 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1335 } catch (RTI::RestoreInProgress& e) {
1336 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1338 } catch (RTI::RTIinternalError& e) {
1339 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1347 RTI13Federate::timeAdvanceRequestAvailable(const SGTimeStamp& timeStamp)
1349 if (!_ambassador.valid()) {
1350 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time at unconnected federate.");
1355 _ambassador->timeAdvanceRequestAvailable(timeStamp);
1356 _federateAmbassador->_timeAdvancePending = true;
1357 } catch (RTI::InvalidFederationTime& e) {
1358 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1360 } catch (RTI::FederationTimeAlreadyPassed& e) {
1361 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1363 } catch (RTI::TimeAdvanceAlreadyInProgress& e) {
1364 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1366 } catch (RTI::EnableTimeRegulationPending& e) {
1367 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1369 } catch (RTI::EnableTimeConstrainedPending& e) {
1370 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1372 } catch (RTI::FederateNotExecutionMember& e) {
1373 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1375 } catch (RTI::ConcurrentAccessAttempted& e) {
1376 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1378 } catch (RTI::SaveInProgress& e) {
1379 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1381 } catch (RTI::RestoreInProgress& e) {
1382 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1384 } catch (RTI::RTIinternalError& e) {
1385 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not advance time: " << e._name << " " << e._reason);
1393 RTI13Federate::flushQueueRequest(const SGTimeStamp& timeStamp)
1395 if (!_ambassador.valid()) {
1396 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue at unconnected federate.");
1401 _ambassador->flushQueueRequest(timeStamp);
1402 _federateAmbassador->_timeAdvancePending = true;
1403 } catch (RTI::InvalidFederationTime& e) {
1404 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1406 } catch (RTI::FederationTimeAlreadyPassed& e) {
1407 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1409 } catch (RTI::TimeAdvanceAlreadyInProgress& e) {
1410 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1412 } catch (RTI::EnableTimeRegulationPending& e) {
1413 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1415 } catch (RTI::EnableTimeConstrainedPending& e) {
1416 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1418 } catch (RTI::FederateNotExecutionMember& e) {
1419 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1421 } catch (RTI::ConcurrentAccessAttempted& e) {
1422 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1424 } catch (RTI::SaveInProgress& e) {
1425 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1427 } catch (RTI::RestoreInProgress& e) {
1428 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1430 } catch (RTI::RTIinternalError& e) {
1431 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not flush queue: " << e._name << " " << e._reason);
1439 RTI13Federate::getTimeAdvancePending()
1441 return _federateAmbassador->_timeAdvancePending;
1445 RTI13Federate::queryFederateTime(SGTimeStamp& timeStamp)
1447 if (!_ambassador.valid()) {
1448 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time.");
1453 _ambassador->queryFederateTime(timeStamp);
1454 } catch (RTI::FederateNotExecutionMember& e) {
1455 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
1457 } catch (RTI::ConcurrentAccessAttempted& e) {
1458 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
1460 } catch (RTI::SaveInProgress& e) {
1461 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
1463 } catch (RTI::RestoreInProgress& e) {
1464 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
1466 } catch (RTI::RTIinternalError& e) {
1467 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query federate time: " << e._name << " " << e._reason);
1474 RTI13Federate::queryLookahead(SGTimeStamp& timeStamp)
1476 if (!_ambassador.valid()) {
1477 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead.");
1482 _ambassador->queryLookahead(timeStamp);
1483 } catch (RTI::FederateNotExecutionMember& e) {
1484 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
1486 } catch (RTI::ConcurrentAccessAttempted& e) {
1487 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
1489 } catch (RTI::SaveInProgress& e) {
1490 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
1492 } catch (RTI::RestoreInProgress& e) {
1493 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
1495 } catch (RTI::RTIinternalError& e) {
1496 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query lookahead: " << e._name << " " << e._reason);
1503 RTI13Federate::queryGALT(SGTimeStamp& timeStamp)
1505 if (!_ambassador.valid()) {
1506 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT.");
1511 return _ambassador->queryGALT(timeStamp);
1512 } catch (RTI::FederateNotExecutionMember& e) {
1513 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT: " << e._name << " " << e._reason);
1515 } catch (RTI::ConcurrentAccessAttempted& e) {
1516 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT: " << e._name << " " << e._reason);
1518 } catch (RTI::SaveInProgress& e) {
1519 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT: " << e._name << " " << e._reason);
1521 } catch (RTI::RestoreInProgress& e) {
1522 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT: " << e._name << " " << e._reason);
1524 } catch (RTI::RTIinternalError& e) {
1525 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query GALT: " << e._name << " " << e._reason);
1532 RTI13Federate::queryLITS(SGTimeStamp& timeStamp)
1534 if (!_ambassador.valid()) {
1535 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS.");
1540 return _ambassador->queryLITS(timeStamp);
1541 } catch (RTI::FederateNotExecutionMember& e) {
1542 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS: " << e._name << " " << e._reason);
1544 } catch (RTI::ConcurrentAccessAttempted& e) {
1545 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS: " << e._name << " " << e._reason);
1547 } catch (RTI::SaveInProgress& e) {
1548 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS: " << e._name << " " << e._reason);
1550 } catch (RTI::RestoreInProgress& e) {
1551 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS: " << e._name << " " << e._reason);
1553 } catch (RTI::RTIinternalError& e) {
1554 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not query LITS: " << e._name << " " << e._reason);
1561 RTI13Federate::processMessage()
1563 bool result = _ambassador->tick();
1564 _federateAmbassador->processQueues();
1569 RTI13Federate::processMessages(const double& minimum, const double& maximum)
1571 bool result = _ambassador->tick(minimum, 0);
1572 _federateAmbassador->processQueues();
1575 SGTimeStamp timeStamp = SGTimeStamp::now() + SGTimeStamp::fromSec(maximum);
1577 result = _ambassador->tick(0, 0);
1578 _federateAmbassador->processQueues();
1579 } while (result && SGTimeStamp::now() <= timeStamp);
1584 RTI13Federate::createObjectClass(const std::string& objectClassName, HLAObjectClass* hlaObjectClass)
1587 RTI::ObjectClassHandle objectClassHandle;
1588 objectClassHandle = _ambassador->getObjectClassHandle(objectClassName);
1589 if (_federateAmbassador->_objectClassMap.find(objectClassHandle) != _federateAmbassador->_objectClassMap.end()) {
1590 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create object class, object class already exists!");
1593 RTI13ObjectClass* rtiObjectClass;
1594 rtiObjectClass = new RTI13ObjectClass(hlaObjectClass, objectClassHandle, _ambassador.get());
1595 _federateAmbassador->_objectClassMap[objectClassHandle] = rtiObjectClass;
1596 return rtiObjectClass;
1597 } catch (RTI::NameNotFound& e) {
1598 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: " << e._name << " " << e._reason);
1600 } catch (RTI::FederateNotExecutionMember& e) {
1601 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: " << e._name << " " << e._reason);
1603 } catch (RTI::ConcurrentAccessAttempted& e) {
1604 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: " << e._name << " " << e._reason);
1606 } catch (RTI::RTIinternalError& e) {
1607 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: " << e._name << " " << e._reason);
1612 RTI13InteractionClass*
1613 RTI13Federate::createInteractionClass(const std::string& interactionClassName, HLAInteractionClass* interactionClass)
1616 RTI::InteractionClassHandle interactionClassHandle;
1617 interactionClassHandle = _ambassador->getInteractionClassHandle(interactionClassName);
1618 if (_federateAmbassador->_interactionClassMap.find(interactionClassHandle) != _federateAmbassador->_interactionClassMap.end()) {
1619 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create interaction class, interaction class already exists!");
1622 RTI13InteractionClass* rtiInteractionClass;
1623 rtiInteractionClass = new RTI13InteractionClass(interactionClass, interactionClassHandle, _ambassador.get());
1624 _federateAmbassador->_interactionClassMap[interactionClassHandle] = rtiInteractionClass;
1625 return rtiInteractionClass;
1626 } catch (RTI::NameNotFound& e) {
1627 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get interaction class: " << e._name << " " << e._reason);
1629 } catch (RTI::FederateNotExecutionMember& e) {
1630 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get interaction class: " << e._name << " " << e._reason);
1632 } catch (RTI::ConcurrentAccessAttempted& e) {
1633 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get interaction class: " << e._name << " " << e._reason);
1635 } catch (RTI::RTIinternalError& e) {
1636 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get interaction class: " << e._name << " " << e._reason);
1641 RTI13ObjectInstance*
1642 RTI13Federate::getObjectInstance(const std::string& objectInstanceName)
1645 RTI::ObjectHandle objectHandle;
1646 objectHandle = _ambassador->getObjectInstanceHandle(objectInstanceName);
1647 FederateAmbassador::ObjectInstanceMap::iterator i = _federateAmbassador->_objectInstanceMap.find(objectHandle);
1648 if (i == _federateAmbassador->_objectInstanceMap.end()) {
1649 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object instance: ObjectInstance not found.");
1653 } catch (RTI::ObjectNotKnown& e) {
1654 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object instance: " << e._name << " " << e._reason);
1656 } catch (RTI::FederateNotExecutionMember& e) {
1657 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object instance: " << e._name << " " << e._reason);
1659 } catch (RTI::ConcurrentAccessAttempted& e) {
1660 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object instance: " << e._name << " " << e._reason);
1662 } catch (RTI::RTIinternalError& e) {
1663 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object instance: " << e._name << " " << e._reason);
1669 RTI13Federate::insertObjectInstance(RTI13ObjectInstance* objectInstance)
1671 _federateAmbassador->_objectInstanceMap[objectInstance->getHandle()] = objectInstance;