![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2010 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 00006 #ifndef MyFederateAmbassador_H_ 00007 #define MyFederateAmbassador_H_ 00008 00009 #pragma warning(disable: 4251) 00010 #pragma warning(disable: 4786) 00011 #pragma warning(disable: 4290) 00012 00013 #include <RTI/RTI1516.h> 00014 #include <RTI/NullFederateAmbassador.h> 00015 #include <string> 00016 #include <map> 00017 00018 using namespace rti1516e; 00019 00020 class DtTalkAmbData 00021 { 00022 public: 00023 bool myNameReservationReturned; 00024 bool myNameReservationSucceeded; 00025 bool myReceivedInitiateFederateSave; 00026 bool myReceivedFederationSaved; 00027 bool myReceivedFederationNotSaved; 00028 bool myReceivedFederationSaveStatusResponse; 00029 std::wstring mySaveLabel; 00030 SaveFailureReason mySaveFailureReason; 00031 FederateHandleSaveStatusPairVector myFederateHandleSaveStatus; 00032 00033 bool myReceivedRequestFederationRestoreSucceeded; 00034 bool myReceivedRequestFederationRestoreFailed; 00035 bool myReceivedFederationRestoreBegun; 00036 bool myReceivedInitiateFederateRestore; 00037 bool myReceivedFederationRestored; 00038 bool myReceivedFederationNotRestored; 00039 bool myReceivedFederationRestoreStatusResponse; 00040 std::wstring myRestoreLabel; 00041 FederateHandle myRestoreFederateHandle; 00042 RestoreFailureReason myRestoreFailureReason; 00043 FederateRestoreStatusVector myFederateHandleRestoreStatus; 00044 00045 std::map<ObjectClassHandle, std::wstring> objectClassMap; 00046 std::map<ObjectInstanceHandle, std::wstring> objectInstanceMap; 00047 std::map<InteractionClassHandle, std::wstring> interactionClassMap; 00048 }; 00049 00050 class MyFederateAmbassador : public NullFederateAmbassador 00051 { 00052 public: 00053 00054 MyFederateAmbassador(DtTalkAmbData & data); 00055 00056 virtual ~MyFederateAmbassador() 00057 throw (); 00058 00059 // 4.17 00060 virtual void initiateFederateSave( 00061 std::wstring const & label) 00062 throw (FederateInternalError); 00063 00064 // 4.20 00065 virtual void federationSaved() 00066 throw (FederateInternalError); 00067 00068 virtual void federationNotSaved(SaveFailureReason theSaveFailureReason) 00069 throw (FederateInternalError); 00070 00071 // 4.23 00072 virtual void federationSaveStatusResponse( 00073 FederateHandleSaveStatusPairVector const & theFederateStatusVector) 00074 throw (FederateInternalError); 00075 00076 // 4.25 00077 virtual void requestFederationRestoreSucceeded(std::wstring const & label) 00078 throw (FederateInternalError); 00079 00080 virtual void requestFederationRestoreFailed(std::wstring const & label) 00081 throw (FederateInternalError); 00082 00083 // 4.26 00084 virtual void federationRestoreBegun() 00085 throw (FederateInternalError); 00086 00087 // 4.27 00088 virtual void initiateFederateRestore( 00089 std::wstring const & label, 00090 std::wstring const & federateName, 00091 FederateHandle handle) 00092 throw (FederateInternalError); 00093 00094 // 4.29 00095 virtual void federationRestored() 00096 throw (FederateInternalError); 00097 00098 virtual void federationNotRestored(RestoreFailureReason theRestoreFailureReason) 00099 throw (FederateInternalError); 00100 00101 // 4.32 00102 virtual void federationRestoreStatusResponse( 00103 FederateRestoreStatusVector const & 00104 theFederateRestoreStatusVector) 00105 throw (FederateInternalError); 00106 00107 00108 // 6.3 00109 virtual void objectInstanceNameReservationSucceeded( 00110 std::wstring const & theObjectInstanceName) 00111 throw (FederateInternalError); 00112 00113 virtual void objectInstanceNameReservationFailed( 00114 std::wstring const & theObjectInstanceName) 00115 throw (FederateInternalError); 00116 00117 // 6.9 00118 virtual void discoverObjectInstance ( 00119 ObjectInstanceHandle theObject, 00120 ObjectClassHandle theObjectClass, 00121 std::wstring const & theObjectInstanceName) 00122 throw (FederateInternalError); 00123 00124 virtual void discoverObjectInstance ( 00125 ObjectInstanceHandle theObject, 00126 ObjectClassHandle theObjectClass, 00127 std::wstring const & theObjectInstanceName, 00128 FederateHandle producingFederate) 00129 throw (FederateInternalError); 00130 00131 00132 // 6.11 00133 virtual void reflectAttributeValues( 00134 ObjectInstanceHandle theObject, 00135 AttributeHandleValueMap const & theAttributeValues, 00136 VariableLengthData const & theUserSuppliedTag, 00137 OrderType sentOrder, 00138 TransportationType theType, 00139 SupplementalReflectInfo theReflectInfo) 00140 throw (FederateInternalError); 00141 00142 virtual void reflectAttributeValues( 00143 ObjectInstanceHandle theObject, 00144 AttributeHandleValueMap const & theAttributeValues, 00145 VariableLengthData const & theUserSuppliedTag, 00146 OrderType sentOrder, 00147 TransportationType theType, 00148 LogicalTime const & theTime, 00149 OrderType receivedOrder, 00150 SupplementalReflectInfo theReflectInfo) 00151 throw (FederateInternalError); 00152 00153 virtual void reflectAttributeValues( 00154 ObjectInstanceHandle theObject, 00155 AttributeHandleValueMap const & theAttributeValues, 00156 VariableLengthData const & theUserSuppliedTag, 00157 OrderType sentOrder, 00158 TransportationType theType, 00159 LogicalTime const & theTime, 00160 OrderType receivedOrder, 00161 MessageRetractionHandle theHandle, 00162 SupplementalReflectInfo theReflectInfo) 00163 throw (FederateInternalError); 00164 00165 00166 // 6.13 00167 virtual void receiveInteraction ( 00168 InteractionClassHandle theInteraction, 00169 ParameterHandleValueMap const & theParameterValues, 00170 VariableLengthData const & theUserSuppliedTag, 00171 OrderType sentOrder, 00172 TransportationType theType, 00173 SupplementalReceiveInfo theReceiveInfo) 00174 throw (FederateInternalError); 00175 00176 virtual void receiveInteraction ( 00177 InteractionClassHandle theInteraction, 00178 ParameterHandleValueMap const & theParameterValues, 00179 VariableLengthData const & theUserSuppliedTag, 00180 OrderType sentOrder, 00181 TransportationType theType, 00182 LogicalTime const & theTime, 00183 OrderType receivedOrder, 00184 SupplementalReceiveInfo theReceiveInfo) 00185 throw (FederateInternalError); 00186 00187 virtual void receiveInteraction ( 00188 InteractionClassHandle theInteraction, 00189 ParameterHandleValueMap const & theParameterValues, 00190 VariableLengthData const & theUserSuppliedTag, 00191 OrderType sentOrder, 00192 TransportationType theType, 00193 LogicalTime const & theTime, 00194 OrderType receivedOrder, 00195 MessageRetractionHandle theHandle, 00196 SupplementalReceiveInfo theReceiveInfo) 00197 throw (FederateInternalError); 00198 00199 00200 // 6.15 00201 virtual void removeObjectInstance ( 00202 ObjectInstanceHandle theObject, 00203 VariableLengthData const & theUserSuppliedTag, 00204 OrderType sentOrder, 00205 SupplementalRemoveInfo theRemoveInfo) 00206 throw (FederateInternalError); 00207 00208 virtual void removeObjectInstance ( 00209 ObjectInstanceHandle theObject, 00210 VariableLengthData const & theUserSuppliedTag, 00211 OrderType sentOrder, 00212 LogicalTime const & theTime, 00213 OrderType receivedOrder, 00214 SupplementalRemoveInfo theRemoveInfo) 00215 throw (FederateInternalError); 00216 00217 virtual void removeObjectInstance ( 00218 ObjectInstanceHandle theObject, 00219 VariableLengthData const & theUserSuppliedTag, 00220 OrderType sentOrder, 00221 LogicalTime const & theTime, 00222 OrderType receivedOrder, 00223 MessageRetractionHandle theHandle, 00224 SupplementalRemoveInfo theRemoveInfo) 00225 throw (FederateInternalError); 00226 00227 virtual void reportAttributeTransportationType ( 00228 ObjectInstanceHandle theObject, 00229 AttributeHandle theAttribute, 00230 TransportationType theTransportation) 00231 throw (FederateInternalError); 00232 00233 virtual void confirmAttributeTransportationTypeChange ( 00234 ObjectInstanceHandle theObject, 00235 AttributeHandleSet theAttributes, 00236 TransportationType theTransportation) 00237 throw ( 00238 FederateInternalError); 00239 00240 virtual void confirmInteractionTransportationTypeChange ( 00241 InteractionClassHandle theInteraction, 00242 TransportationType theTransportation) 00243 throw ( 00244 FederateInternalError); 00245 00246 // 6.30 00247 virtual void reportInteractionTransportationType ( 00248 FederateHandle federateHandle, 00249 InteractionClassHandle theInteraction, 00250 TransportationType theTransportation) 00251 throw ( 00252 FederateInternalError); 00253 00254 virtual void multipleObjectInstanceNameReservationSucceeded ( 00255 std::set<std::wstring> const & theObjectInstanceNames) 00256 throw ( 00257 FederateInternalError); 00258 00259 virtual void multipleObjectInstanceNameReservationFailed ( 00260 std::set<std::wstring> const & theObjectInstanceNames) 00261 throw ( 00262 FederateInternalError); 00263 00264 public: 00265 DtTalkAmbData & myData; 00266 }; 00267 00268 #endif