MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeFedAmb1516e.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simpleTimeFedAmb1516.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef MyFederateAmbassador_H_
10 #define MyFederateAmbassador_H_
11 
12 #ifdef WIN32
13 #pragma warning(disable: 4251)
14 #pragma warning(disable: 4786)
15 #pragma warning(disable: 4290)
16 #endif
17 
18 #include <RTI/Enums.h>
19 #include <RTI/Typedefs.h>
20 #include <RTI/RTI1516.h>
21 #include <RTI/NullFederateAmbassador.h>
22 #include "simpleTimeStringUtil.h"
24 #include <string>
25 #include <map>
26 
27 typedef std::map<std::wstring, rti1516e::AttributeHandle> DtAttrNameHandleMap;
28 typedef std::map<std::wstring, rti1516e::ParameterHandle> DtParamNameHandleMap;
29 
30 class DtTalkAmbData
31 {
32 
33 public:
34  DtTalkAmbData();
36 
37 public:
40  std::map<rti1516e::ObjectClassHandle, std::wstring> objectClassMap;
41  std::map<rti1516e::ObjectInstanceHandle, std::wstring> objectInstanceMap;
42  std::map<rti1516e::InteractionClassHandle,std::wstring> interactionClassMap;
43  std::map<rti1516e::ObjectInstanceHandle, rti1516e::AttributeHandleSet*> updateRequestMap;
44 
45  // Map between strings and attribute handles
47 
48  // Map between strings and paramterHandles
50 
51  // The set of Attributes that this federate's published objects will contain.
52  std::set<std::string> ourAttrs;
53 
54  // the Set of Parameters that this federate's published interactions will contain.
55  std::set<std::string> ourParms;
56 
57  // This federation of simple objects has a single master object, (determined by command line arguments)
58  // The master federate will keep the other federates from entering their main loop of execution until
59  // all of numFederates have joined.
60  bool isMaster;
61 
62  // numFederates is the number of federates (including the master) that the master should wait to join the
63  // federation before it allows any federate to enter its main loop.
64  // This variable is only used by the master federate.
65  int numFederates;
66 
67  rti1516e::AttributeHandleValueMap* attrValues;
68  rti1516e::ParameterHandleValueMap* paramValues;
69  bool isConstrained;
70  bool isRegulating;
71  bool timeAdvanced;
72  rti1516e::LogicalTime* time;
74  bool registerFailed;
75  bool registerSucceeded;
79 };
80 
81 class MyFederateAmbassador : public rti1516e::NullFederateAmbassador
82 {
83 public:
85 
86  virtual ~MyFederateAmbassador()
87  throw();
88 
89  // 6.3
90  virtual void objectInstanceNameReservationSucceeded(std::wstring const & theObjectInstanceName)
91  throw(rti1516e::FederateInternalError);
92 
93  virtual void objectInstanceNameReservationFailed(std::wstring const & theObjectInstanceName)
94  throw(rti1516e::FederateInternalError);
95 
96  // 6.5
97  virtual void discoverObjectInstance(rti1516e::ObjectInstanceHandle theObject, rti1516e::ObjectClassHandle theObjectClass,
98  std::wstring const & theObjectInstanceName)
99  throw(rti1516e::FederateInternalError);
100 
101  virtual void discoverObjectInstance(rti1516e::ObjectInstanceHandle theObject, rti1516e::ObjectClassHandle theObjectClass,
102  std::wstring const & theObjectInstanceName, rti1516e::FederateHandle producingFederate)
103  throw(rti1516e::FederateInternalError);
104 
105  // 6.11
106  virtual void reflectAttributeValues(rti1516e::ObjectInstanceHandle theObject,
107  rti1516e::AttributeHandleValueMap const & theAttributeValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
108  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::SupplementalReflectInfo theReflectInfo)
109  throw(rti1516e::FederateInternalError);
110 
111  virtual void reflectAttributeValues(rti1516e::ObjectInstanceHandle theObject,
112  rti1516e::AttributeHandleValueMap const & theAttributeValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
113  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::LogicalTime const & theTime,
114  rti1516e::OrderType receivedOrder, rti1516e::SupplementalReflectInfo theReflectInfo)
115  throw(rti1516e::FederateInternalError);
116 
117  virtual void reflectAttributeValues(rti1516e::ObjectInstanceHandle theObject,
118  rti1516e::AttributeHandleValueMap const & theAttributeValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
119  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::LogicalTime const & theTime,
120  rti1516e::OrderType receivedOrder, rti1516e::MessageRetractionHandle theHandle,
121  rti1516e::SupplementalReflectInfo theReflectInfo)
122  throw(rti1516e::FederateInternalError);
123 
124  // 6.13
125  virtual void receiveInteraction(rti1516e::InteractionClassHandle theInteraction,
126  rti1516e::ParameterHandleValueMap const & theParameterValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
127  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::SupplementalReceiveInfo theReceiveInfo)
128  throw(rti1516e::FederateInternalError);
129 
130  virtual void receiveInteraction(rti1516e::InteractionClassHandle theInteraction,
131  rti1516e::ParameterHandleValueMap const & theParameterValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
132  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::LogicalTime const & theTime,
133  rti1516e::OrderType receivedOrder, rti1516e::SupplementalReceiveInfo theReceiveInfo)
134  throw(rti1516e::FederateInternalError);
135 
136  virtual void receiveInteraction(rti1516e::InteractionClassHandle theInteraction,
137  rti1516e::ParameterHandleValueMap const & theParameterValues, rti1516e::VariableLengthData const & theUserSuppliedTag,
138  rti1516e::OrderType sentOrder, rti1516e::TransportationType theType, rti1516e::LogicalTime const & theTime,
139  rti1516e::OrderType receivedOrder, rti1516e::MessageRetractionHandle theHandle, rti1516e::SupplementalReceiveInfo theReceiveInfo)
140  throw(rti1516e::FederateInternalError);
141 
142  // 6.15
143  virtual void removeObjectInstance(rti1516e::ObjectInstanceHandle theObject,
144  rti1516e::VariableLengthData const & theUserSuppliedTag, rti1516e::OrderType sentOrder,
145  rti1516e::SupplementalRemoveInfo theRemoveInfo)
146  throw(rti1516e::FederateInternalError);
147 
148  virtual void removeObjectInstance(rti1516e::ObjectInstanceHandle theObject,
149  rti1516e::VariableLengthData const & theUserSuppliedTag, rti1516e::OrderType sentOrder,
150  rti1516e::LogicalTime const & theTime, rti1516e::OrderType receivedOrder, rti1516e::SupplementalRemoveInfo theRemoveInfo)
151  throw(rti1516e::FederateInternalError);
152 
153  virtual void removeObjectInstance(rti1516e::ObjectInstanceHandle theObject,
154  rti1516e::VariableLengthData const & theUserSuppliedTag, rti1516e::OrderType sentOrder,
155  rti1516e::LogicalTime const & theTime, rti1516e::OrderType receivedOrder, rti1516e::MessageRetractionHandle theHandle,
156  rti1516e::SupplementalRemoveInfo theRemoveInfo)
157  throw(rti1516e::FederateInternalError);
158 
159  virtual void provideAttributeValueUpdate(rti1516e::ObjectInstanceHandle theObject,
160  rti1516e::AttributeHandleSet const & theAttributes, rti1516e::VariableLengthData const & theUserSuppliedTag)
161  throw(rti1516e::FederateInternalError);
162 
163  virtual void timeRegulationEnabled(rti1516e::LogicalTime const & theFederateTime)
164  throw(rti1516e::FederateInternalError);
165 
166  virtual void timeConstrainedEnabled(rti1516e::LogicalTime const & theFederateTime)
167  throw(rti1516e::FederateInternalError);
168 
169  virtual void timeAdvanceGrant(rti1516e::LogicalTime const & theTime)
170  throw(rti1516e::FederateInternalError);
171 
172  virtual void requestRetraction(rti1516e::MessageRetractionHandle theHandle)
173  throw(rti1516e::FederateInternalError);
174 
175  virtual void synchronizationPointRegistrationSucceeded(std::wstring const & label )
176  throw(rti1516e::FederateInternalError);
177 
178  virtual void synchronizationPointRegistrationFailed(std::wstring const & label,
180  throw(rti1516e::FederateInternalError);
181 
182  virtual void announceSynchronizationPoint(std::wstring const & label,
183  rti1516e::VariableLengthData const & theUserSuppliedTag)
184  throw(rti1516e::FederateInternalError);
185 
186  virtual void federationSynchronized(std::wstring const & label, rti1516e::FederateHandleSet const& failedToSyncSet)
187  throw(rti1516e::FederateInternalError);
188 
189 public:
191 };
192 
193 #endif
194 
195 
virtual void objectInstanceNameReservationFailed(std::wstring const &theObjectInstanceName)
std::map< std::string, RTI::AttributeHandle > DtAttrNameHandleMap
Definition: simpleDDMSimple13.h:25
OrderType
Definition: datatypes.pb.h:472
std::set< std::string > ourAttrs
Definition: simpleTimeFedAmb13.h:45
rti1516e::ParameterHandleValueMap * paramValues
Definition: simpleTimeFedAmb1516e.h:68
Basic federate ambassador service callback implementation.
Definition: rtiSimpleFedAmb13.h:35
bool isRegulating
Definition: simpleTimeFedAmb13.h:64
DtParamNameHandleMap theParamNameHandleMap
Definition: simpleTimeFedAmb13.h:42
DtAttrNameHandleMap theAttrNameHandleMap
Definition: simpleTimeFedAmb13.h:39
std::map< rti1516e::ObjectInstanceHandle, rti1516e::AttributeHandleSet * > updateRequestMap
Definition: simpleTimeFedAmb1516e.h:43
virtual void provideAttributeValueUpdate(RTI::ObjectHandle theObject, const RTI::AttributeHandleSet &theAttributes)
virtual void receiveInteraction(RTI::InteractionClassHandle theInteraction, const RTI::ParameterHandleValuePairSet &theParameters, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void objectInstanceNameReservationSucceeded(std::wstring const &theObjectInstanceName)
bool registerSucceeded
Definition: simpleTimeFedAmb13.h:69
virtual void synchronizationPointRegistrationSucceeded(const char *label)
virtual void synchronizationPointRegistrationFailed(const char *label)
ULong InteractionClassHandle
Definition: RTItypes13.h:106
TransportationType
Definition: rtiAmbassadorFedProBase.h:43
virtual void removeObjectInstance(RTI::ObjectHandle theObject, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
bool timeAdvanced
Definition: simpleTimeFedAmb13.h:65
Definition: simpleTimeTimeManagedEntity.h:32
virtual void reflectAttributeValues(RTI::ObjectHandle theObject, const RTI::AttributeHandleValuePairSet &theAttributes, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void requestRetraction(rti1516_2025::MessageRetractionHandle const &theHandle)
rti1516e::AttributeHandleValueMap * attrValues
Definition: simpleTimeFedAmb1516e.h:67
bool isConstrained
Definition: simpleTimeFedAmb13.h:63
DtSimpleData & myData
Definition: rtiSimpleFedAmb13.h:98
std::map< rti1516e::ObjectClassHandle, std::wstring > objectClassMap
Definition: simpleTimeFedAmb1516e.h:40
virtual void discoverObjectInstance(RTI::ObjectHandle theObject, RTI::ObjectClassHandle theObjectClass, const char *theObjectName)
virtual void timeAdvanceGrant(const RTI::FedTime &theTime)
timeManagedEntity timeManagedObject
Definition: simpleTimeFedAmb13.h:72
bool isMaster
Definition: simpleTimeFedAmb13.h:53
bool announceSyncReceived
Definition: simpleTimeFedAmb13.h:70
int numFederates
Definition: simpleTimeFedAmb13.h:58
rti1516e::LogicalTime * time
Definition: simpleTimeFedAmb1516e.h:72
Definition: rtiSimpleFedAmb13dlc.h:15
ULong FederateHandle
Definition: RTItypes13.h:120
int otherFederatesReady
Definition: simpleTimeFedAmb13.h:67
bool registerFailed
Definition: simpleTimeFedAmb13.h:68
virtual ~MyFederateAmbassador()
bool myNameReservationSucceeded
Definition: simpleDDMFedAmb1516.h:28
std::map< std::string, RTI::ParameterHandle > DtParamNameHandleMap
Definition: simpleDDMSimple13.h:27
virtual void timeConstrainedEnabled(const RTI::FedTime &theFederateTime)
ULong ObjectClassHandle
Definition: RTItypes13.h:104
std::map< rti1516e::InteractionClassHandle, std::wstring > interactionClassMap
Definition: simpleTimeFedAmb1516e.h:42
MyFederateAmbassador(DtSimpleData &data)
virtual void announceSynchronizationPoint(const char *label, const char *tag)
bool myNameReservationReturned
Definition: simpleDDMFedAmb1516.h:27
bool federationIsSynchronized
Definition: simpleTimeFedAmb13.h:71
virtual void federationSynchronized(const char *label)
std::set< std::string > ourParms
Definition: simpleTimeFedAmb13.h:48
std::map< rti1516e::ObjectInstanceHandle, std::wstring > objectInstanceMap
Definition: simpleTimeFedAmb1516e.h:41
SynchronizationPointFailureReason
Definition: datatypes.pb.h:334
virtual void timeRegulationEnabled(const RTI::FedTime &theFederateTime)

Document ID: Generated on Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)