MAK RTIspy API Documentation for HLA 1.3
rtiSimpleFedAmb1516.h
Go to the documentation of this file.
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 rti1516;
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    FederateHandleRestoreStatusPairVector 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    virtual  void initiateFederateSave(
00060       std::wstring const & label)
00061       throw (UnableToPerformSave,   FederateInternalError);
00062 
00063    virtual  void federationSaved()
00064       throw (FederateInternalError);
00065 
00066    virtual void federationNotSaved(SaveFailureReason theSaveFailureReason)
00067       throw (FederateInternalError);
00068 
00069    virtual void federationSaveStatusResponse(
00070       FederateHandleSaveStatusPairVector const & theFederateStatusVector)
00071       throw (FederateInternalError);
00072 
00073 
00074     // 4.19
00075     virtual void requestFederationRestoreSucceeded(std::wstring const & label)
00076       throw (FederateInternalError);
00077 
00078     virtual void requestFederationRestoreFailed(std::wstring const & label)
00079       throw (FederateInternalError);
00080 
00081     // 4.20
00082     virtual void federationRestoreBegun()
00083       throw (FederateInternalError);
00084 
00085     // 4.21
00086     virtual void initiateFederateRestore(
00087       std::wstring const & label,
00088       FederateHandle handle)
00089       throw (SpecifiedSaveLabelDoesNotExist,
00090              CouldNotInitiateRestore,
00091              FederateInternalError);
00092 
00093     // 4.23
00094     virtual void federationRestored()
00095       throw (FederateInternalError);
00096 
00097     virtual void federationNotRestored(RestoreFailureReason theRestoreFailureReason)
00098       throw (FederateInternalError);
00099 
00100     // 4.25
00101     virtual void federationRestoreStatusResponse(
00102       FederateHandleRestoreStatusPairVector  const & 
00103       theFederateStatusVector)
00104       throw (FederateInternalError);
00105 
00106     // 6.3
00107     virtual
00108     void
00109     objectInstanceNameReservationSucceeded(std::wstring const &
00110                                            theObjectInstanceName)
00111       throw (UnknownName,
00112              FederateInternalError);
00113 
00114     virtual
00115     void
00116     objectInstanceNameReservationFailed(std::wstring const &
00117                                         theObjectInstanceName)
00118       throw (UnknownName,
00119              FederateInternalError);
00120 
00121     // 6.5
00122    virtual void discoverObjectInstance (
00123       ObjectInstanceHandle theObject,
00124       ObjectClassHandle theObjectClass,
00125       std::wstring const & theObjectInstanceName)
00126       throw (
00127          CouldNotDiscover,
00128          ObjectClassNotKnown,
00129          FederateInternalError);
00130 
00131     // 6.7
00132     virtual
00133     void
00134     reflectAttributeValues
00135     (ObjectInstanceHandle theObject,
00136      AttributeHandleValueMap const & theAttributeValues,
00137      VariableLengthData const & theUserSuppliedTag,
00138      OrderType sentOrder,
00139      TransportationType theType)
00140       throw (ObjectInstanceNotKnown,
00141              AttributeNotRecognized,
00142              AttributeNotSubscribed,
00143              FederateInternalError);
00144 
00145     virtual
00146     void
00147     reflectAttributeValues
00148     (ObjectInstanceHandle theObject,
00149      AttributeHandleValueMap const & theAttributeValues,
00150      VariableLengthData const & theUserSuppliedTag,
00151      OrderType sentOrder,
00152      TransportationType theType,
00153      RegionHandleSet const & theSentRegionHandleSet)
00154       throw (ObjectInstanceNotKnown,
00155              AttributeNotRecognized,
00156              AttributeNotSubscribed,
00157              FederateInternalError);
00158 
00159     virtual
00160     void
00161     reflectAttributeValues
00162     (ObjectInstanceHandle theObject,
00163      AttributeHandleValueMap const & theAttributeValues,
00164      VariableLengthData const & theUserSuppliedTag,
00165      OrderType sentOrder,
00166      TransportationType theType,
00167      LogicalTime const & theTime,
00168      OrderType receivedOrder)
00169       throw (ObjectInstanceNotKnown,
00170              AttributeNotRecognized,
00171              AttributeNotSubscribed,
00172              FederateInternalError);
00173   
00174     virtual
00175     void
00176     reflectAttributeValues
00177     (ObjectInstanceHandle theObject,
00178      AttributeHandleValueMap const & theAttributeValues,
00179      VariableLengthData const & theUserSuppliedTag,
00180      OrderType sentOrder,
00181      TransportationType theType,
00182      LogicalTime const & theTime,
00183      OrderType receivedOrder,
00184      RegionHandleSet const & theSentRegionHandleSet)
00185       throw (ObjectInstanceNotKnown,
00186              AttributeNotRecognized,
00187              AttributeNotSubscribed,
00188              FederateInternalError);
00189   
00190     virtual
00191     void
00192     reflectAttributeValues
00193     (ObjectInstanceHandle theObject,
00194      AttributeHandleValueMap const & theAttributeValues,
00195      VariableLengthData const & theUserSuppliedTag,
00196      OrderType sentOrder,
00197      TransportationType theType,
00198      LogicalTime const & theTime,
00199      OrderType receivedOrder,
00200      MessageRetractionHandle theHandle)
00201       throw (ObjectInstanceNotKnown,
00202              AttributeNotRecognized,
00203              AttributeNotSubscribed,
00204              InvalidLogicalTime,
00205              FederateInternalError);
00206 
00207     virtual
00208     void
00209     reflectAttributeValues
00210     (ObjectInstanceHandle theObject,
00211      AttributeHandleValueMap const & theAttributeValues,
00212      VariableLengthData const & theUserSuppliedTag,
00213      OrderType sentOrder,
00214      TransportationType theType,
00215      LogicalTime const & theTime,
00216      OrderType receivedOrder,
00217      MessageRetractionHandle theHandle,
00218      RegionHandleSet const & theSentRegionHandleSet)
00219       throw (ObjectInstanceNotKnown,
00220              AttributeNotRecognized,
00221              AttributeNotSubscribed,
00222              InvalidLogicalTime,
00223              FederateInternalError);
00224 
00225 
00226     // 6.9
00227     virtual
00228     void
00229     receiveInteraction
00230     (InteractionClassHandle theInteraction,
00231      ParameterHandleValueMap const & theParameterValues,
00232      VariableLengthData const & theUserSuppliedTag,
00233      OrderType sentOrder,
00234      TransportationType theType)
00235       throw (InteractionClassNotRecognized,
00236              InteractionParameterNotRecognized,
00237              InteractionClassNotSubscribed,
00238              FederateInternalError);
00239 
00240     virtual
00241     void
00242     receiveInteraction
00243     (InteractionClassHandle theInteraction,
00244      ParameterHandleValueMap const & theParameterValues,
00245      VariableLengthData const & theUserSuppliedTag,
00246      OrderType sentOrder,
00247      TransportationType theType,
00248      RegionHandleSet const & theSentRegionHandleSet)
00249       throw (InteractionClassNotRecognized,
00250              InteractionParameterNotRecognized,
00251              InteractionClassNotSubscribed,
00252              FederateInternalError);
00253 
00254     virtual
00255     void
00256     receiveInteraction
00257     (InteractionClassHandle theInteraction,
00258      ParameterHandleValueMap const & theParameterValues,
00259      VariableLengthData const & theUserSuppliedTag,
00260      OrderType sentOrder,
00261      TransportationType theType,
00262      LogicalTime const & theTime,
00263      OrderType receivedOrder)
00264       throw (InteractionClassNotRecognized,
00265              InteractionParameterNotRecognized,
00266              InteractionClassNotSubscribed,
00267              FederateInternalError);
00268 
00269     virtual
00270     void
00271     receiveInteraction
00272     (InteractionClassHandle theInteraction,
00273      ParameterHandleValueMap const & theParameterValues,
00274      VariableLengthData const & theUserSuppliedTag,
00275      OrderType sentOrder,
00276      TransportationType theType,
00277      LogicalTime const & theTime,
00278      OrderType receivedOrder,
00279      RegionHandleSet const & theSentRegionHandleSet)
00280       throw (InteractionClassNotRecognized,
00281              InteractionParameterNotRecognized,
00282              InteractionClassNotSubscribed,
00283              FederateInternalError);
00284 
00285     virtual
00286     void
00287     receiveInteraction
00288     (InteractionClassHandle theInteraction,
00289      ParameterHandleValueMap const & theParameterValues,
00290      VariableLengthData const & theUserSuppliedTag,
00291      OrderType sentOrder,
00292      TransportationType theType,
00293      LogicalTime const & theTime,
00294      OrderType receivedOrder,
00295      MessageRetractionHandle theHandle)
00296       throw (InteractionClassNotRecognized,
00297              InteractionParameterNotRecognized,
00298              InteractionClassNotSubscribed,
00299              InvalidLogicalTime,
00300              FederateInternalError);
00301 
00302     virtual
00303     void
00304     receiveInteraction
00305     (InteractionClassHandle theInteraction,
00306      ParameterHandleValueMap const & theParameterValues,
00307      VariableLengthData const & theUserSuppliedTag,
00308      OrderType sentOrder,
00309      TransportationType theType,
00310      LogicalTime const & theTime,
00311      OrderType receivedOrder,
00312      MessageRetractionHandle theHandle,
00313      RegionHandleSet const & theSentRegionHandleSet)
00314       throw (InteractionClassNotRecognized,
00315              InteractionParameterNotRecognized,
00316              InteractionClassNotSubscribed,
00317              InvalidLogicalTime,
00318              FederateInternalError);
00319 
00320 
00321     // 6.11
00322     virtual
00323     void
00324     removeObjectInstance(ObjectInstanceHandle theObject,
00325                          VariableLengthData const & theUserSuppliedTag,
00326                          OrderType sentOrder)
00327       throw (ObjectInstanceNotKnown,
00328              FederateInternalError);
00329 
00330     virtual
00331     void
00332     removeObjectInstance(ObjectInstanceHandle theObject,
00333                          VariableLengthData const & theUserSuppliedTag,
00334                          OrderType sentOrder,
00335                          LogicalTime const & theTime,
00336                          OrderType receivedOrder)
00337       throw (ObjectInstanceNotKnown,
00338              FederateInternalError);
00339 
00340     virtual
00341     void
00342     removeObjectInstance(ObjectInstanceHandle theObject,
00343                          VariableLengthData const & theUserSuppliedTag,
00344                          OrderType sentOrder,
00345                          LogicalTime const & theTime,
00346                          OrderType receivedOrder,
00347                          MessageRetractionHandle theHandle)
00348       throw (ObjectInstanceNotKnown,
00349              InvalidLogicalTime,
00350              FederateInternalError);
00351 
00352 public:
00353    DtTalkAmbData & myData;
00354 };
00355 
00356 #endif

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)