1 // Copyright (C) 2009 - 2010 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 #ifndef RTIAmbassador_hxx
19 #define RTIAmbassador_hxx
28 #ifndef RTI_USES_STD_FSTREAM
29 #define RTI_USES_STD_FSTREAM
35 #include <simgear/debug/logstream.hxx>
36 #include <simgear/structure/SGWeakReferenced.hxx>
37 #include <simgear/structure/SGSharedPtr.hxx>
38 #include <simgear/structure/SGWeakPtr.hxx>
39 #include <simgear/timing/timestamp.hxx>
41 #include "RTIObjectClass.hxx"
42 #include "RTIData.hxx"
43 #include "RTI13Federate.hxx"
44 #include "RTI13ObjectInstance.hxx"
48 class RTI13Ambassador : public SGWeakReferenced {
51 _federateAmbassador(*this),
52 _timeRegulationEnabled(false),
53 _timeConstrainedEnabled(false),
54 _timeAdvancePending(false)
56 virtual ~RTI13Ambassador()
59 // processes the queues that filled up during the past
62 while (!_queueCallbackList.empty()) {
63 (*_queueCallbackList.front())();
64 _queueCallbackList.pop_front();
67 while (!_objectInstancePendingCallbackList.empty()) {
68 (*_objectInstancePendingCallbackList.begin())->flushPendingRequests();
69 _objectInstancePendingCallbackList.erase(_objectInstancePendingCallbackList.begin());
73 bool getTimeRegulationEnabled() const
74 { return _timeRegulationEnabled; }
75 bool getTimeConstrainedEnabled() const
76 { return _timeConstrainedEnabled; }
77 bool getTimeAdvancePending() const
78 { return _timeAdvancePending; }
79 const SGTimeStamp& getCurrentLogicalTime() const
80 { return _federateTime; }
82 bool getFederationSynchronizationPointAnnounced(const std::string& label)
83 { return _pendingSyncLabels.find(label) != _pendingSyncLabels.end(); }
84 bool getFederationSynchronized(const std::string& label)
86 std::set<std::string>::iterator i = _syncronizedSyncLabels.find(label);
87 if (i == _syncronizedSyncLabels.end())
89 _syncronizedSyncLabels.erase(i);
93 void createFederationExecution(const std::string& name, const std::string& objectModel)
94 { _rtiAmbassador.createFederationExecution(name.c_str(), objectModel.c_str()); }
95 void destroyFederationExecution(const std::string& name)
96 { _rtiAmbassador.destroyFederationExecution(name.c_str()); }
98 RTI::FederateHandle joinFederationExecution(const std::string& federate, const std::string& federation)
99 { return _rtiAmbassador.joinFederationExecution(federate.c_str(), federation.c_str(), &_federateAmbassador); }
100 void resignFederationExecution()
101 { _rtiAmbassador.resignFederationExecution(RTI::DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES); }
103 void registerFederationSynchronizationPoint(const std::string& label, const RTIData& tag)
104 { _rtiAmbassador.registerFederationSynchronizationPoint(label.c_str(), tag.data()); }
105 void synchronizationPointAchieved(const std::string& label)
106 { _rtiAmbassador.synchronizationPointAchieved(label.c_str()); }
108 void publishObjectClass(const RTI::ObjectClassHandle& handle, const RTI::AttributeHandleSet& attributeHandleSet)
109 { _rtiAmbassador.publishObjectClass(handle, attributeHandleSet); }
110 void unpublishObjectClass(const RTI::ObjectClassHandle& handle)
111 { _rtiAmbassador.unpublishObjectClass(handle); }
112 void subscribeObjectClassAttributes(const RTI::ObjectClassHandle& handle, const RTI::AttributeHandleSet& attributeHandleSet, bool active)
113 { _rtiAmbassador.subscribeObjectClassAttributes(handle, attributeHandleSet, active ? RTI::RTI_TRUE : RTI::RTI_FALSE); }
114 void unsubscribeObjectClass(const RTI::ObjectClassHandle& handle)
115 { _rtiAmbassador.unsubscribeObjectClass(handle); }
117 RTI13ObjectInstance* registerObjectInstance(const RTI13ObjectClass* objectClass, HLAObjectInstance* hlaObjectInstance)
119 RTI::ObjectHandle objectHandle = _rtiAmbassador.registerObjectInstance(objectClass->getHandle());
120 RTI13ObjectInstance* objectInstance = new RTI13ObjectInstance(objectHandle, hlaObjectInstance, objectClass, this, true);
121 _objectInstanceMap[objectHandle] = objectInstance;
122 return objectInstance;
124 void updateAttributeValues(const RTI::ObjectHandle& objectHandle, const RTI::AttributeHandleValuePairSet& attributeValues,
125 const SGTimeStamp& timeStamp, const RTIData& tag)
126 { _rtiAmbassador.updateAttributeValues(objectHandle, attributeValues, toFedTime(timeStamp), tag.data()); }
127 void updateAttributeValues(const RTI::ObjectHandle& objectHandle, const RTI::AttributeHandleValuePairSet& attributeValues, const RTIData& tag)
128 { _rtiAmbassador.updateAttributeValues(objectHandle, attributeValues, tag.data()); }
130 // RTI::EventRetractionHandle sendInteraction(RTI::InteractionClassHandle interactionClassHandle, const RTI::ParameterHandleValuePairSet& parameters, const RTI::FedTime& fedTime, const RTIData& tag)
131 // { return _rtiAmbassador.sendInteraction(interactionClassHandle, parameters, fedTime, tag.data()); }
132 // void sendInteraction(RTI::InteractionClassHandle interactionClassHandle, const RTI::ParameterHandleValuePairSet& parameters, const RTIData& tag)
133 // { _rtiAmbassador.sendInteraction(interactionClassHandle, parameters, tag.data()); }
135 void deleteObjectInstance(const RTI::ObjectHandle& objectHandle, const SGTimeStamp& timeStamp, const RTIData& tag)
137 RTI::EventRetractionHandle h = _rtiAmbassador.deleteObjectInstance(objectHandle, toFedTime(timeStamp), tag.data());
138 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
139 if (i == _objectInstanceMap.end()) {
140 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: ObjectInstance not found.");
143 _objectInstancePendingCallbackList.erase(i->second);
144 _objectInstanceMap.erase(i);
146 void deleteObjectInstance(const RTI::ObjectHandle& objectHandle, const RTIData& tag)
148 _rtiAmbassador.deleteObjectInstance(objectHandle, tag.data());
149 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
150 if (i == _objectInstanceMap.end()) {
151 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: ObjectInstance not found.");
154 _objectInstancePendingCallbackList.erase(i->second);
155 _objectInstanceMap.erase(i);
157 void localDeleteObjectInstance(const RTI::ObjectHandle& objectHandle)
159 _rtiAmbassador.localDeleteObjectInstance(objectHandle);
160 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
161 if (i == _objectInstanceMap.end()) {
162 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: ObjectInstance not found.");
165 _objectInstancePendingCallbackList.erase(i->second);
166 _objectInstanceMap.erase(i);
169 void requestObjectAttributeValueUpdate(const RTI::ObjectHandle& handle, const RTI::AttributeHandleSet& attributeHandleSet)
170 { _rtiAmbassador.requestObjectAttributeValueUpdate(handle, attributeHandleSet); }
171 void requestClassAttributeValueUpdate(const RTI::ObjectClassHandle& handle, const RTI::AttributeHandleSet& attributeHandleSet)
172 { _rtiAmbassador.requestClassAttributeValueUpdate(handle, attributeHandleSet); }
174 // Ownership Management -------------------
176 // bool unconditionalAttributeOwnershipDivestiture(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles)
179 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
180 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
181 // attributeHandleSet->add(*i);
182 // _rtiAmbassador.unconditionalAttributeOwnershipDivestiture(objectHandle, *attributeHandleSet);
184 // } catch (RTI::ObjectNotKnown& e) {
185 // } catch (RTI::AttributeNotDefined& e) {
186 // } catch (RTI::AttributeNotOwned& e) {
187 // } catch (RTI::FederateNotExecutionMember& e) {
188 // } catch (RTI::ConcurrentAccessAttempted& e) {
189 // } catch (RTI::SaveInProgress& e) {
190 // } catch (RTI::RestoreInProgress& e) {
191 // } catch (RTI::RTIinternalError& e) {
195 // bool negotiatedAttributeOwnershipDivestiture(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles, const RTIData& tag)
198 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
199 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
200 // attributeHandleSet->add(*i);
201 // _rtiAmbassador.negotiatedAttributeOwnershipDivestiture(objectHandle, *attributeHandleSet, tag.data());
203 // } catch (RTI::ObjectNotKnown& e) {
204 // } catch (RTI::AttributeNotDefined& e) {
205 // } catch (RTI::AttributeNotOwned& e) {
206 // } catch (RTI::AttributeAlreadyBeingDivested& e) {
207 // } catch (RTI::FederateNotExecutionMember& e) {
208 // } catch (RTI::ConcurrentAccessAttempted& e) {
209 // } catch (RTI::SaveInProgress& e) {
210 // } catch (RTI::RestoreInProgress& e) {
211 // } catch (RTI::RTIinternalError& e) {
215 // bool attributeOwnershipAcquisition(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles, const RTIData& tag)
218 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
219 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
220 // attributeHandleSet->add(*i);
221 // _rtiAmbassador.attributeOwnershipAcquisition(objectHandle, *attributeHandleSet, tag.data());
223 // } catch (RTI::ObjectNotKnown& e) {
224 // } catch (RTI::ObjectClassNotPublished& e) {
225 // } catch (RTI::AttributeNotDefined& e) {
226 // } catch (RTI::AttributeNotPublished& e) {
227 // } catch (RTI::FederateOwnsAttributes& e) {
228 // } catch (RTI::FederateNotExecutionMember& e) {
229 // } catch (RTI::ConcurrentAccessAttempted& e) {
230 // } catch (RTI::SaveInProgress& e) {
231 // } catch (RTI::RestoreInProgress& e) {
232 // } catch (RTI::RTIinternalError& e) {
236 // bool attributeOwnershipAcquisitionIfAvailable(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles)
239 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
240 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
241 // attributeHandleSet->add(*i);
242 // _rtiAmbassador.attributeOwnershipAcquisitionIfAvailable(objectHandle, *attributeHandleSet);
244 // } catch (RTI::ObjectNotKnown& e) {
245 // } catch (RTI::ObjectClassNotPublished& e) {
246 // } catch (RTI::AttributeNotDefined& e) {
247 // } catch (RTI::AttributeNotPublished& e) {
248 // } catch (RTI::FederateOwnsAttributes& e) {
249 // } catch (RTI::AttributeAlreadyBeingAcquired& e) {
250 // } catch (RTI::FederateNotExecutionMember& e) {
251 // } catch (RTI::ConcurrentAccessAttempted& e) {
252 // } catch (RTI::SaveInProgress& e) {
253 // } catch (RTI::RestoreInProgress& e) {
254 // } catch (RTI::RTIinternalError& e) {
258 // RTIHandleSet attributeOwnershipReleaseResponse(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles)
261 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
262 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
263 // attributeHandleSet->add(*i);
264 // attributeHandleSet.reset(_rtiAmbassador.attributeOwnershipReleaseResponse(objectHandle, *attributeHandleSet));
265 // RTIHandleSet handleSet;
266 // RTI::ULong numAttribs = attributeHandleSet->size();
267 // for (RTI::ULong i = 0; i < numAttribs; ++i)
268 // handleSet.insert(attributeHandleSet->getHandle(i));
270 // } catch (RTI::ObjectNotKnown& e) {
271 // } catch (RTI::AttributeNotDefined& e) {
272 // } catch (RTI::AttributeNotOwned& e) {
273 // } catch (RTI::FederateWasNotAskedToReleaseAttribute& e) {
274 // } catch (RTI::FederateNotExecutionMember& e) {
275 // } catch (RTI::ConcurrentAccessAttempted& e) {
276 // } catch (RTI::SaveInProgress& e) {
277 // } catch (RTI::RestoreInProgress& e) {
278 // } catch (RTI::RTIinternalError& e) {
280 // return RTIHandleSet();
282 // bool cancelNegotiatedAttributeOwnershipDivestiture(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles)
285 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
286 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
287 // attributeHandleSet->add(*i);
288 // _rtiAmbassador.cancelNegotiatedAttributeOwnershipDivestiture(objectHandle, *attributeHandleSet);
290 // } catch (RTI::ObjectNotKnown& e) {
291 // } catch (RTI::AttributeNotDefined& e) {
292 // } catch (RTI::AttributeNotOwned& e) {
293 // } catch (RTI::AttributeDivestitureWasNotRequested& e) {
294 // } catch (RTI::FederateNotExecutionMember& e) {
295 // } catch (RTI::ConcurrentAccessAttempted& e) {
296 // } catch (RTI::SaveInProgress& e) {
297 // } catch (RTI::RestoreInProgress& e) {
298 // } catch (RTI::RTIinternalError& e) {
302 // bool cancelAttributeOwnershipAcquisition(const RTIHandle& objectHandle, const RTIHandleSet& attributeHandles)
305 // std::auto_ptr<RTI::AttributeHandleSet> attributeHandleSet(RTI::AttributeHandleSetFactory::create(attributeHandles.size()));
306 // for (RTIHandleSet::const_iterator i = attributeHandles.begin(); i != attributeHandles.end(); ++i)
307 // attributeHandleSet->add(*i);
308 // _rtiAmbassador.cancelAttributeOwnershipAcquisition(objectHandle, *attributeHandleSet);
310 // } catch (RTI::ObjectNotKnown& e) {
311 // } catch (RTI::AttributeNotDefined& e) {
312 // } catch (RTI::AttributeAlreadyOwned& e) {
313 // } catch (RTI::AttributeAcquisitionWasNotRequested& e) {
314 // } catch (RTI::FederateNotExecutionMember& e) {
315 // } catch (RTI::ConcurrentAccessAttempted& e) {
316 // } catch (RTI::SaveInProgress& e) {
317 // } catch (RTI::RestoreInProgress& e) {
318 // } catch (RTI::RTIinternalError& e) {
322 // bool queryAttributeOwnership(const RTIHandle& objectHandle, const RTIHandle& attributeHandle)
325 // _rtiAmbassador.queryAttributeOwnership(objectHandle, attributeHandle);
327 // } catch (RTI::ObjectNotKnown& e) {
328 // } catch (RTI::AttributeNotDefined& e) {
329 // } catch (RTI::FederateNotExecutionMember& e) {
330 // } catch (RTI::ConcurrentAccessAttempted& e) {
331 // } catch (RTI::SaveInProgress& e) {
332 // } catch (RTI::RestoreInProgress& e) {
333 // } catch (RTI::RTIinternalError& e) {
337 // bool isAttributeOwnedByFederate(const RTIHandle& objectHandle, const RTIHandle& attributeHandle)
340 // return _rtiAmbassador.isAttributeOwnedByFederate(objectHandle, attributeHandle);
341 // } catch (RTI::ObjectNotKnown& e) {
342 // } catch (RTI::AttributeNotDefined& e) {
343 // } catch (RTI::FederateNotExecutionMember& e) {
344 // } catch (RTI::ConcurrentAccessAttempted& e) {
345 // } catch (RTI::SaveInProgress& e) {
346 // } catch (RTI::RestoreInProgress& e) {
347 // } catch (RTI::RTIinternalError& e) {
354 void enableTimeRegulation(const SGTimeStamp& federateTime, const SGTimeStamp& lookahead)
355 { _rtiAmbassador.enableTimeRegulation(toFedTime(federateTime), toFedTime(lookahead)); }
356 void disableTimeRegulation()
357 { _rtiAmbassador.disableTimeRegulation(); _timeRegulationEnabled = false; }
359 void enableTimeConstrained()
360 { _rtiAmbassador.enableTimeConstrained(); }
361 void disableTimeConstrained()
362 { _rtiAmbassador.disableTimeConstrained(); _timeConstrainedEnabled = false; }
364 void timeAdvanceRequest(const SGTimeStamp& time)
365 { _rtiAmbassador.timeAdvanceRequest(toFedTime(time)); _timeAdvancePending = true; }
366 void timeAdvanceRequestAvailable(const SGTimeStamp& time)
367 { _rtiAmbassador.timeAdvanceRequestAvailable(toFedTime(time)); _timeAdvancePending = true; }
369 // bool queryLBTS(double& time)
372 // RTIfedTime fedTime;
373 // _rtiAmbassador.queryLBTS(fedTime);
374 // time = fedTime.getTime();
376 // } catch (RTI::FederateNotExecutionMember& e) {
377 // } catch (RTI::ConcurrentAccessAttempted& e) {
378 // } catch (RTI::SaveInProgress& e) {
379 // } catch (RTI::RestoreInProgress& e) {
380 // } catch (RTI::RTIinternalError& e) {
384 // bool queryFederateTime(double& time)
387 // RTIfedTime fedTime;
388 // _rtiAmbassador.queryFederateTime(fedTime);
389 // time = fedTime.getTime();
391 // } catch (RTI::FederateNotExecutionMember& e) {
392 // } catch (RTI::ConcurrentAccessAttempted& e) {
393 // } catch (RTI::SaveInProgress& e) {
394 // } catch (RTI::RestoreInProgress& e) {
395 // } catch (RTI::RTIinternalError& e) {
400 // bool queryLookahead(double& time)
403 // RTIfedTime fedTime;
404 // _rtiAmbassador.queryLookahead(fedTime);
405 // time = fedTime.getTime();
407 // } catch (RTI::FederateNotExecutionMember& e) {
408 // } catch (RTI::ConcurrentAccessAttempted& e) {
409 // } catch (RTI::SaveInProgress& e) {
410 // } catch (RTI::RestoreInProgress& e) {
411 // } catch (RTI::RTIinternalError& e) {
416 RTI13ObjectClass* createObjectClass(const std::string& name, HLAObjectClass* hlaObjectClass)
418 RTI::ObjectClassHandle objectClassHandle;
419 objectClassHandle = getObjectClassHandle(name);
420 if (_objectClassMap.find(objectClassHandle) != _objectClassMap.end()) {
421 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not create object class, object class already exists!");
424 RTI13ObjectClass* rtiObjectClass;
425 rtiObjectClass = new RTI13ObjectClass(hlaObjectClass, objectClassHandle, this);
426 _objectClassMap[objectClassHandle] = rtiObjectClass;
427 return rtiObjectClass;
429 RTI::ObjectClassHandle getObjectClassHandle(const std::string& name)
430 { return _rtiAmbassador.getObjectClassHandle(name.c_str()); }
431 std::string getObjectClassName(const RTI::ObjectClassHandle& handle)
432 { return rtiToStdString(_rtiAmbassador.getObjectClassName(handle)); }
434 RTI::AttributeHandle getAttributeHandle(const std::string& attributeName, const RTI::ObjectClassHandle& objectClassHandle)
435 { return _rtiAmbassador.getAttributeHandle(attributeName.c_str(), objectClassHandle); }
436 std::string getAttributeName(const RTI::AttributeHandle& attributeHandle, const RTI::ObjectClassHandle& objectClassHandle)
437 { return rtiToStdString(_rtiAmbassador.getAttributeName(attributeHandle, objectClassHandle)); }
439 // RTIHandle getInteractionClassHandle(const std::string& name)
442 // return _rtiAmbassador.getInteractionClassHandle(name.c_str());
443 // } catch (RTI::NameNotFound& e) {
444 // } catch (RTI::FederateNotExecutionMember& e) {
445 // } catch (RTI::ConcurrentAccessAttempted& e) {
446 // } catch (RTI::RTIinternalError& e) {
448 // return RTIHandle(-1);
450 // std::string getInteractionClassName(const RTIHandle& handle)
454 // rtiToStdString(name, _rtiAmbassador.getInteractionClassName(handle));
455 // } catch (RTI::InteractionClassNotDefined& e) {
456 // } catch (RTI::FederateNotExecutionMember& e) {
457 // } catch (RTI::ConcurrentAccessAttempted& e) {
458 // } catch (RTI::RTIinternalError& e) {
463 // RTIHandle getParameterHandle(const std::string& parameterName, const RTIHandle& interactionClassHandle)
466 // return _rtiAmbassador.getParameterHandle(parameterName.c_str(), interactionClassHandle);
467 // } catch (RTI::InteractionClassNotDefined& e) {
468 // } catch (RTI::NameNotFound& e) {
469 // } catch (RTI::FederateNotExecutionMember& e) {
470 // } catch (RTI::ConcurrentAccessAttempted& e) {
471 // } catch (RTI::RTIinternalError& e) {
473 // return RTIHandle(-1);
475 // std::string getParameterName(const RTIHandle& parameterHandle, const RTIHandle& interactionClassHandle)
477 // std::string parameterName;
479 // rtiToStdString(parameterName, _rtiAmbassador.getParameterName(parameterHandle, interactionClassHandle));
480 // } catch (RTI::InteractionClassNotDefined& e) {
481 // } catch (RTI::InteractionParameterNotDefined& e) {
482 // } catch (RTI::FederateNotExecutionMember& e) {
483 // } catch (RTI::ConcurrentAccessAttempted& e) {
484 // } catch (RTI::RTIinternalError& e) {
486 // return parameterName;
489 RTI13ObjectInstance* getObjectInstance(const std::string& name)
491 RTI::ObjectHandle objectHandle;
492 objectHandle = getObjectInstanceHandle(name);
493 ObjectInstanceMap::iterator i = _objectInstanceMap.find(objectHandle);
494 if (i == _objectInstanceMap.end()) {
495 SG_LOG(SG_NETWORK, SG_WARN, "RTI: Could not get object class: ObjectInstance not found.");
500 RTI::ObjectHandle getObjectInstanceHandle(const std::string& name)
501 { return _rtiAmbassador.getObjectInstanceHandle(name.c_str()); }
502 std::string getObjectInstanceName(const RTI::ObjectHandle& objectHandle)
503 { return rtiToStdString(_rtiAmbassador.getObjectInstanceName(objectHandle)); }
505 // RTIHandle getRoutingSpaceHandle(const std::string& routingSpaceName)
508 // return _rtiAmbassador.getRoutingSpaceHandle(routingSpaceName.c_str());
509 // } catch (RTI::NameNotFound& e) {
510 // } catch (RTI::FederateNotExecutionMember& e) {
511 // } catch (RTI::ConcurrentAccessAttempted& e) {
512 // } catch (RTI::RTIinternalError& e) {
514 // return RTIHandle(-1);
516 // std::string getRoutingSpaceName(const RTIHandle& routingSpaceHandle)
518 // std::string routingSpaceName;
520 // rtiToStdString(routingSpaceName, _rtiAmbassador.wgetRoutingSpaceName(routingSpaceHandle));
521 // } catch (RTI::SpaceNotDefined& e) {
522 // } catch (RTI::FederateNotExecutionMember& e) {
523 // } catch (RTI::ConcurrentAccessAttempted& e) {
524 // } catch (RTI::RTIinternalError& e) {
526 // return routingSpaceName;
529 void enableClassRelevanceAdvisorySwitch()
530 { _rtiAmbassador.enableClassRelevanceAdvisorySwitch(); }
531 void disableClassRelevanceAdvisorySwitch()
532 { _rtiAmbassador.disableClassRelevanceAdvisorySwitch(); }
534 void enableAttributeRelevanceAdvisorySwitch()
535 { _rtiAmbassador.enableAttributeRelevanceAdvisorySwitch(); }
536 void disableAttributeRelevanceAdvisorySwitch()
537 { _rtiAmbassador.disableAttributeRelevanceAdvisorySwitch(); }
539 void enableAttributeScopeAdvisorySwitch()
540 { _rtiAmbassador.enableAttributeScopeAdvisorySwitch(); }
541 void disableAttributeScopeAdvisorySwitch()
542 { _rtiAmbassador.disableAttributeScopeAdvisorySwitch(); }
544 void enableInteractionRelevanceAdvisorySwitch()
545 { _rtiAmbassador.enableInteractionRelevanceAdvisorySwitch(); }
546 void disableInteractionRelevanceAdvisorySwitch()
547 { _rtiAmbassador.disableInteractionRelevanceAdvisorySwitch(); }
551 { return _rtiAmbassador.tick(); }
552 bool tick(double minimum, double maximum)
553 { return _rtiAmbassador.tick(minimum, maximum); }
555 void addObjectInstanceForCallback(RTIObjectInstance* objectIntance)
556 { _objectInstancePendingCallbackList.insert(objectIntance); }
559 /// Generic callback to execute some notification on objects in a way that they are not prone to
560 /// ConcurrentAccess exceptions.
561 class QueueCallback : public SGReferenced {
563 virtual ~QueueCallback() {}
564 virtual void operator()() = 0;
567 class RemoveObjectCallback : public QueueCallback {
569 RemoveObjectCallback(SGSharedPtr<RTIObjectInstance> objectInstance, const RTIData& tag) :
570 _objectInstance(objectInstance),
573 virtual void operator()()
575 _objectInstance->removeInstance(_tag);
578 SGSharedPtr<RTIObjectInstance> _objectInstance;
582 /// Just the interface class doing the callbacks into the parent class
583 struct FederateAmbassador : public RTI::FederateAmbassador {
584 FederateAmbassador(RTI13Ambassador& rtiAmbassador) :
585 _rtiAmbassador(rtiAmbassador)
588 virtual ~FederateAmbassador()
589 throw (RTI::FederateInternalError)
593 /// RTI federate ambassador callback functions.
594 virtual void synchronizationPointRegistrationSucceeded(const char* label)
595 throw (RTI::FederateInternalError)
599 virtual void synchronizationPointRegistrationFailed(const char* label)
600 throw (RTI::FederateInternalError)
604 virtual void announceSynchronizationPoint(const char* label, const char* tag)
605 throw (RTI::FederateInternalError)
607 _rtiAmbassador._pendingSyncLabels.insert(toStdString(label));
610 virtual void federationSynchronized(const char* label)
611 throw (RTI::FederateInternalError)
613 std::string s = toStdString(label);
614 _rtiAmbassador._pendingSyncLabels.erase(s);
615 _rtiAmbassador._syncronizedSyncLabels.insert(s);
618 virtual void initiateFederateSave(const char* label)
619 throw (RTI::UnableToPerformSave,
620 RTI::FederateInternalError)
624 virtual void federationSaved()
625 throw (RTI::FederateInternalError)
629 virtual void federationNotSaved()
630 throw (RTI::FederateInternalError)
634 virtual void requestFederationRestoreSucceeded(const char* label)
635 throw (RTI::FederateInternalError)
639 virtual void requestFederationRestoreFailed(const char* label, const char* reason)
640 throw (RTI::FederateInternalError)
644 virtual void federationRestoreBegun()
645 throw (RTI::FederateInternalError)
649 virtual void initiateFederateRestore(const char* label, RTI::FederateHandle federateHandle)
650 throw (RTI::SpecifiedSaveLabelDoesNotExist,
651 RTI::CouldNotRestore,
652 RTI::FederateInternalError)
656 virtual void federationRestored()
657 throw (RTI::FederateInternalError)
661 virtual void federationNotRestored()
662 throw (RTI::FederateInternalError)
666 // Declaration Management
667 virtual void startRegistrationForObjectClass(RTI::ObjectClassHandle objectClassHandle)
668 throw (RTI::ObjectClassNotPublished,
669 RTI::FederateInternalError)
671 ObjectClassMap::iterator i = _rtiAmbassador._objectClassMap.find(objectClassHandle);
672 if (i == _rtiAmbassador._objectClassMap.end())
674 if (!i->second.valid())
676 i->second->startRegistration();
679 virtual void stopRegistrationForObjectClass(RTI::ObjectClassHandle objectClassHandle)
680 throw (RTI::ObjectClassNotPublished,
681 RTI::FederateInternalError)
683 ObjectClassMap::iterator i = _rtiAmbassador._objectClassMap.find(objectClassHandle);
684 if (i == _rtiAmbassador._objectClassMap.end())
686 if (!i->second.valid())
688 i->second->stopRegistration();
691 virtual void turnInteractionsOn(RTI::InteractionClassHandle interactionClassHandle)
692 throw (RTI::InteractionClassNotPublished,
693 RTI::FederateInternalError)
697 virtual void turnInteractionsOff(RTI::InteractionClassHandle interactionClassHandle)
698 throw (RTI::InteractionClassNotPublished,
699 RTI::FederateInternalError)
705 virtual void discoverObjectInstance(RTI::ObjectHandle objectHandle, RTI::ObjectClassHandle objectClassHandle, const char* tag)
706 throw (RTI::CouldNotDiscover,
707 RTI::ObjectClassNotKnown,
708 RTI::FederateInternalError)
710 ObjectClassMap::iterator i = _rtiAmbassador._objectClassMap.find(objectClassHandle);
711 if (i == _rtiAmbassador._objectClassMap.end())
712 throw RTI::ObjectClassNotKnown("Federate: discoverObjectInstance()!");
713 if (!i->second.valid())
715 SGSharedPtr<RTI13ObjectInstance> objectInstance = new RTI13ObjectInstance(objectHandle, 0, i->second, &_rtiAmbassador, false);
716 _rtiAmbassador._objectInstanceMap[objectHandle] = objectInstance;
717 _rtiAmbassador._objectInstancePendingCallbackList.insert(objectInstance);
718 i->second->discoverInstance(objectInstance.get(), tagToData(tag));
721 virtual void reflectAttributeValues(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleValuePairSet& attributeValuePairSet,
722 const RTI::FedTime& fedTime, const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
723 throw (RTI::ObjectNotKnown,
724 RTI::AttributeNotKnown,
725 RTI::FederateOwnsAttributes,
726 RTI::InvalidFederationTime,
727 RTI::FederateInternalError)
729 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
730 if (i == _rtiAmbassador._objectInstanceMap.end())
731 throw RTI::ObjectNotKnown("Reflect attributes for unknown object!");
732 if (!i->second.valid())
734 i->second->reflectAttributeValues(attributeValuePairSet, toTimeStamp(fedTime), tagToData(tag));
737 virtual void reflectAttributeValues(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleValuePairSet& attributeValuePairSet,
739 throw (RTI::ObjectNotKnown,
740 RTI::AttributeNotKnown,
741 RTI::FederateOwnsAttributes,
742 RTI::FederateInternalError)
744 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
745 if (i == _rtiAmbassador._objectInstanceMap.end())
746 throw RTI::ObjectNotKnown("Reflect attributes for unknown object!");
747 if (!i->second.valid())
749 i->second->reflectAttributeValues(attributeValuePairSet, tagToData(tag));
752 virtual void receiveInteraction(RTI::InteractionClassHandle interactionClassHandle, const RTI::ParameterHandleValuePairSet& parameters,
753 const RTI::FedTime& fedTime, const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
754 throw (RTI::InteractionClassNotKnown,
755 RTI::InteractionParameterNotKnown,
756 RTI::InvalidFederationTime,
757 RTI::FederateInternalError)
761 virtual void receiveInteraction(RTI::InteractionClassHandle interactionClassHandle,
762 const RTI::ParameterHandleValuePairSet& parameters, const char* tag)
763 throw (RTI::InteractionClassNotKnown,
764 RTI::InteractionParameterNotKnown,
765 RTI::FederateInternalError)
769 virtual void removeObjectInstance(RTI::ObjectHandle objectHandle, const RTI::FedTime& fedTime,
770 const char* tag, RTI::EventRetractionHandle eventRetractionHandle)
771 throw (RTI::ObjectNotKnown,
772 RTI::InvalidFederationTime,
773 RTI::FederateInternalError)
775 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
776 if (i == _rtiAmbassador._objectInstanceMap.end())
777 throw RTI::ObjectNotKnown("Federate: removeObjectInstance()!");
778 if (i->second.valid())
779 _rtiAmbassador._queueCallbackList.push_back(new RemoveObjectCallback(i->second, tagToData(tag)));
780 _rtiAmbassador._objectInstancePendingCallbackList.erase(i->second);
781 _rtiAmbassador._objectInstanceMap.erase(i);
784 virtual void removeObjectInstance(RTI::ObjectHandle objectHandle, const char* tag)
785 throw (RTI::ObjectNotKnown,
786 RTI::FederateInternalError)
788 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
789 if (i == _rtiAmbassador._objectInstanceMap.end())
790 throw RTI::ObjectNotKnown("Federate: removeObjectInstance()!");
791 if (i->second.valid())
792 _rtiAmbassador._queueCallbackList.push_back(new RemoveObjectCallback(i->second, tagToData(tag)));
793 _rtiAmbassador._objectInstancePendingCallbackList.erase(i->second);
794 _rtiAmbassador._objectInstanceMap.erase(i);
797 virtual void attributesInScope(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
798 throw (RTI::ObjectNotKnown,
799 RTI::AttributeNotKnown,
800 RTI::FederateInternalError)
802 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
803 if (i == _rtiAmbassador._objectInstanceMap.end())
804 throw RTI::ObjectNotKnown("Attributes in scope for unknown object!");
805 if (!i->second.valid())
807 i->second->attributesInScope(attributes);
810 virtual void attributesOutOfScope(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
811 throw (RTI::ObjectNotKnown,
812 RTI::AttributeNotKnown,
813 RTI::FederateInternalError)
815 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
816 if (i == _rtiAmbassador._objectInstanceMap.end())
817 throw RTI::ObjectNotKnown("Attributes in scope for unknown object!");
818 if (!i->second.valid())
820 i->second->attributesOutOfScope(attributes);
823 virtual void provideAttributeValueUpdate(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
824 throw (RTI::ObjectNotKnown,
825 RTI::AttributeNotKnown,
826 RTI::AttributeNotOwned,
827 RTI::FederateInternalError)
829 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
830 if (i == _rtiAmbassador._objectInstanceMap.end())
831 throw RTI::ObjectNotKnown("Reflect attributes for unknown object!");
832 if (!i->second.valid())
834 i->second->provideAttributeValueUpdate(attributes);
837 virtual void turnUpdatesOnForObjectInstance(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
838 throw (RTI::ObjectNotKnown,
839 RTI::AttributeNotOwned,
840 RTI::FederateInternalError)
842 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
843 if (i == _rtiAmbassador._objectInstanceMap.end())
844 throw RTI::ObjectNotKnown("Turn on attributes for unknown object!");
845 if (!i->second.valid())
847 i->second->turnUpdatesOnForObjectInstance(attributes);
850 virtual void turnUpdatesOffForObjectInstance(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
851 throw (RTI::ObjectNotKnown,
852 RTI::AttributeNotOwned,
853 RTI::FederateInternalError)
855 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
856 if (i == _rtiAmbassador._objectInstanceMap.end())
857 throw RTI::ObjectNotKnown("Turn off attributes for unknown object!");
858 if (!i->second.valid())
860 i->second->turnUpdatesOffForObjectInstance(attributes);
863 // Ownership Management
864 virtual void requestAttributeOwnershipAssumption(RTI::ObjectHandle objectHandle,
865 const RTI::AttributeHandleSet& attributes, const char* tag)
866 throw (RTI::ObjectNotKnown,
867 RTI::AttributeNotKnown,
868 RTI::AttributeAlreadyOwned,
869 RTI::AttributeNotPublished,
870 RTI::FederateInternalError)
872 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
873 if (i == _rtiAmbassador._objectInstanceMap.end())
874 throw RTI::ObjectNotKnown("requestAttributeOwnershipAssumption for unknown object!");
875 if (!i->second.valid())
877 i->second->requestAttributeOwnershipAssumption(attributes, tagToData(tag));
880 virtual void attributeOwnershipDivestitureNotification(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
881 throw (RTI::ObjectNotKnown,
882 RTI::AttributeNotKnown,
883 RTI::AttributeNotOwned,
884 RTI::AttributeDivestitureWasNotRequested,
885 RTI::FederateInternalError)
887 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
888 if (i == _rtiAmbassador._objectInstanceMap.end())
889 throw RTI::ObjectNotKnown("attributeOwnershipDivestitureNotification for unknown object!");
890 if (!i->second.valid())
892 i->second->attributeOwnershipDivestitureNotification(attributes);
895 virtual void attributeOwnershipAcquisitionNotification(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
896 throw (RTI::ObjectNotKnown,
897 RTI::AttributeNotKnown,
898 RTI::AttributeAcquisitionWasNotRequested,
899 RTI::AttributeAlreadyOwned,
900 RTI::AttributeNotPublished,
901 RTI::FederateInternalError)
903 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
904 if (i == _rtiAmbassador._objectInstanceMap.end())
905 throw RTI::ObjectNotKnown("attributeOwnershipAcquisitionNotification for unknown object!");
906 if (!i->second.valid())
908 i->second->attributeOwnershipAcquisitionNotification(attributes);
911 virtual void attributeOwnershipUnavailable(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
912 throw (RTI::ObjectNotKnown,
913 RTI::AttributeNotKnown,
914 RTI::AttributeAlreadyOwned,
915 RTI::AttributeAcquisitionWasNotRequested,
916 RTI::FederateInternalError)
918 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
919 if (i == _rtiAmbassador._objectInstanceMap.end())
920 throw RTI::ObjectNotKnown("attributeOwnershipUnavailable for unknown object!");
921 if (!i->second.valid())
923 i->second->attributeOwnershipUnavailable(attributes);
926 virtual void requestAttributeOwnershipRelease(RTI::ObjectHandle objectHandle,
927 const RTI::AttributeHandleSet& attributes, const char* tag)
928 throw (RTI::ObjectNotKnown,
929 RTI::AttributeNotKnown,
930 RTI::AttributeNotOwned,
931 RTI::FederateInternalError)
933 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
934 if (i == _rtiAmbassador._objectInstanceMap.end())
935 throw RTI::ObjectNotKnown("requestAttributeOwnershipRelease for unknown object!");
936 if (!i->second.valid())
938 i->second->requestAttributeOwnershipRelease(attributes, tagToData(tag));
941 virtual void confirmAttributeOwnershipAcquisitionCancellation(RTI::ObjectHandle objectHandle, const RTI::AttributeHandleSet& attributes)
942 throw (RTI::ObjectNotKnown,
943 RTI::AttributeNotKnown,
944 RTI::AttributeAlreadyOwned,
945 RTI::AttributeAcquisitionWasNotCanceled,
946 RTI::FederateInternalError)
948 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
949 if (i == _rtiAmbassador._objectInstanceMap.end())
950 throw RTI::ObjectNotKnown("confirmAttributeOwnershipAcquisitionCancellation for unknown object!");
951 if (!i->second.valid())
953 i->second->confirmAttributeOwnershipAcquisitionCancellation(attributes);
956 virtual void informAttributeOwnership(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle,
957 RTI::FederateHandle federateHandle)
958 throw (RTI::ObjectNotKnown,
959 RTI::AttributeNotKnown,
960 RTI::FederateInternalError)
962 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
963 if (i == _rtiAmbassador._objectInstanceMap.end())
964 throw RTI::ObjectNotKnown("informAttributeOwnership for unknown object!");
965 if (!i->second.valid())
967 i->second->informAttributeOwnership(attributeHandle, federateHandle);
970 virtual void attributeIsNotOwned(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
971 throw (RTI::ObjectNotKnown,
972 RTI::AttributeNotKnown,
973 RTI::FederateInternalError)
975 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
976 if (i == _rtiAmbassador._objectInstanceMap.end())
977 throw RTI::ObjectNotKnown("attributeIsNotOwned for unknown object!");
978 if (!i->second.valid())
980 i->second->attributeIsNotOwned(attributeHandle);
983 virtual void attributeOwnedByRTI(RTI::ObjectHandle objectHandle, RTI::AttributeHandle attributeHandle)
984 throw (RTI::ObjectNotKnown,
985 RTI::AttributeNotKnown,
986 RTI::FederateInternalError)
988 ObjectInstanceMap::iterator i = _rtiAmbassador._objectInstanceMap.find(objectHandle);
989 if (i == _rtiAmbassador._objectInstanceMap.end())
990 throw RTI::ObjectNotKnown("attributeOwnedByRTI for unknown object!");
991 if (!i->second.valid())
993 i->second->attributeOwnedByRTI(attributeHandle);
997 virtual void timeRegulationEnabled(const RTI::FedTime& fedTime)
998 throw (RTI::InvalidFederationTime,
999 RTI::EnableTimeRegulationWasNotPending,
1000 RTI::FederateInternalError)
1002 _rtiAmbassador._timeRegulationEnabled = true;
1003 _rtiAmbassador._federateTime = toTimeStamp(fedTime);
1004 SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeRegulationEnabled: " << _rtiAmbassador._federateTime);
1007 virtual void timeConstrainedEnabled(const RTI::FedTime& fedTime)
1008 throw (RTI::InvalidFederationTime,
1009 RTI::EnableTimeConstrainedWasNotPending,
1010 RTI::FederateInternalError)
1012 _rtiAmbassador._timeConstrainedEnabled = true;
1013 _rtiAmbassador._federateTime = toTimeStamp(fedTime);
1014 SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeConstrainedEnabled: " << _rtiAmbassador._federateTime);
1017 virtual void timeAdvanceGrant(const RTI::FedTime& fedTime)
1018 throw (RTI::InvalidFederationTime,
1019 RTI::TimeAdvanceWasNotInProgress,
1020 RTI::FederateInternalError)
1022 _rtiAmbassador._federateTime = toTimeStamp(fedTime);
1023 _rtiAmbassador._timeAdvancePending = false;
1024 SG_LOG(SG_NETWORK, SG_INFO, "RTI: timeAdvanceGrant: " << _rtiAmbassador._federateTime);
1027 virtual void requestRetraction(RTI::EventRetractionHandle eventRetractionHandle)
1028 throw (RTI::EventNotKnown,
1029 RTI::FederateInternalError)
1031 // No retraction concept yet
1035 const RTIData& tagToData(const char* tag)
1038 _cachedTag.setData(tag, std::strlen(tag) + 1);
1040 _cachedTag.setData("", 1);
1045 RTI13Ambassador& _rtiAmbassador;
1048 static SGTimeStamp toTimeStamp(const RTI::FedTime& fedTime)
1050 RTIfedTime referenceTime(fedTime);
1051 return SGTimeStamp::fromSec(referenceTime.getTime() + 0.5e-9);
1054 static RTIfedTime toFedTime(const SGTimeStamp& timeStamp)
1056 RTIfedTime referenceTime;
1057 referenceTime.setZero();
1058 referenceTime += timeStamp.toSecs();
1059 return referenceTime;
1062 static std::string rtiToStdString(char* n)
1065 return std::string();
1072 static std::string toStdString(const char* n)
1075 return std::string();
1076 return std::string(n);
1079 // The connection class
1080 RTI::RTIambassador _rtiAmbassador;
1082 // The class with all the callbacks.
1083 FederateAmbassador _federateAmbassador;
1085 // All the sync labels we got an announcement for
1086 std::set<std::string> _pendingSyncLabels;
1087 std::set<std::string> _syncronizedSyncLabels;
1089 // All that calls back into user code is just queued.
1090 // That is to make sure we do not call recursively into the RTI
1091 typedef std::list<SGSharedPtr<QueueCallback> > QueueCallbackList;
1092 QueueCallbackList _queueCallbackList;
1093 // All object instances that need to be called due to some event are noted here
1094 // That is to make sure we do not call recursively into the RTI
1095 typedef std::set<SGSharedPtr<RTIObjectInstance> > ObjectInstanceSet;
1096 ObjectInstanceSet _objectInstancePendingCallbackList;
1098 // Top level information for dispatching federate object attribute updates
1099 typedef std::map<RTI::ObjectHandle, SGSharedPtr<RTI13ObjectInstance> > ObjectInstanceMap;
1100 // Map of all available objects
1101 ObjectInstanceMap _objectInstanceMap;
1103 // Top level information for dispatching creation of federate objects
1104 typedef std::map<RTI::ObjectClassHandle, SGSharedPtr<RTI13ObjectClass> > ObjectClassMap;
1105 ObjectClassMap _objectClassMap;
1107 bool _timeRegulationEnabled;
1108 bool _timeConstrainedEnabled;
1109 bool _timeAdvancePending;
1110 SGTimeStamp _federateTime;
1113 } // namespace simgear