MAK RTIspy API Documentation for HLA 1.3
rtiSimpleFedAmb13.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2010 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 #pragma warning(disable: 4786)
00007 #pragma warning(disable: 4290)
00008 
00009 #include "NullFederateAmbassador.hh"
00010 #include <map>
00011 #include <string>
00012 
00013 class DtTalkAmbData
00014 {
00015 public:
00016    bool myReceivedInitiateFederateSave;
00017    bool myReceivedFederationSaved;
00018    bool myReceivedFederationNotSaved;
00019    std::string mySaveLabel;
00020 
00021    bool myReceivedRequestFederationRestoreSucceeded;
00022    bool myReceivedRequestFederationRestoreFailed;
00023    bool myReceivedFederationRestoreBegun;
00024    bool myReceivedInitiateFederateRestore;
00025    bool myReceivedFederationRestored;
00026    bool myReceivedFederationNotRestored;
00027    std::string myRestoreLabel;
00028    RTI::FederateHandle myRestoreFederateHandle;
00029    std::string myRestoreFailureReason;
00030 
00031    std::map<RTI::ObjectClassHandle, std::string> objectClassMap;
00032    std::map<RTI::ObjectHandle, std::string> objectInstanceMap;
00033    std::map<RTI::InteractionClassHandle, std::string> interactionClassMap;
00034 };
00035 
00036 
00037 class MyFederateAmbassador : public NullFederateAmbassador
00038 {
00039 public:
00040 
00041    MyFederateAmbassador(DtTalkAmbData & data);
00042 
00043    virtual ~MyFederateAmbassador() 
00044      throw (RTI::FederateInternalError);
00045 
00046 
00048    // Federation Management Services //
00050 
00051    virtual void initiateFederateSave (
00052       const char *label) // supplied C4
00053    throw (
00054       RTI::UnableToPerformSave,
00055       RTI::FederateInternalError);
00056 
00057    virtual void federationSaved ()
00058    throw (
00059       RTI::FederateInternalError);
00060 
00061    virtual void federationNotSaved ()
00062    throw (
00063       RTI::FederateInternalError);
00064 
00065    virtual void requestFederationRestoreSucceeded (
00066       const char *label) // supplied C4
00067    throw (
00068       RTI::FederateInternalError);
00069 
00070    virtual void requestFederationRestoreFailed (
00071       const char *label,
00072       const char *reason) // supplied C4
00073    throw (
00074       RTI::FederateInternalError);
00075 
00076    virtual void federationRestoreBegun ()
00077    throw (
00078       RTI::FederateInternalError);
00079 
00080    virtual void initiateFederateRestore (
00081       const char               *label,   // supplied C4
00082             RTI::FederateHandle handle)  // supplied C1
00083    throw (
00084       RTI::SpecifiedSaveLabelDoesNotExist,
00085       RTI::CouldNotRestore,
00086       RTI::FederateInternalError);
00087 
00088    virtual void federationRestored ()
00089    throw (
00090       RTI::FederateInternalError);
00091 
00092    virtual void federationNotRestored ()
00093    throw (
00094       RTI::FederateInternalError);
00095 
00096 
00098    // Object Management Services //
00100 
00101    virtual void discoverObjectInstance (
00102            RTI::ObjectHandle          theObject,      // supplied C1
00103            RTI::ObjectClassHandle     theObjectClass, // supplied C1
00104      const char*                      theObjectName)  // supplied C4  
00105    throw (
00106      RTI::CouldNotDiscover,
00107      RTI::ObjectClassNotKnown,
00108      RTI::FederateInternalError);
00109 
00110    virtual void reflectAttributeValues (
00111            RTI::ObjectHandle                 theObject,     // supplied C1
00112      const RTI::AttributeHandleValuePairSet& theAttributes, // supplied C4
00113      const RTI::FedTime&                     theTime,       // supplied C1
00114      const char                             *theTag,        // supplied C4
00115            RTI::EventRetractionHandle        theHandle)     // supplied C1
00116    throw (
00117      RTI::ObjectNotKnown,
00118      RTI::AttributeNotKnown,
00119      RTI::FederateOwnsAttributes,
00120      RTI::InvalidFederationTime,
00121      RTI::FederateInternalError);
00122 
00123    virtual void reflectAttributeValues (
00124            RTI::ObjectHandle                 theObject,     // supplied C1
00125      const RTI::AttributeHandleValuePairSet& theAttributes, // supplied C4
00126      const char                             *theTag)        // supplied C4
00127    throw (
00128      RTI::ObjectNotKnown,
00129      RTI::AttributeNotKnown,
00130      RTI::FederateOwnsAttributes,
00131      RTI::FederateInternalError);
00132 
00133    // 4.6
00134    virtual void receiveInteraction (
00135            RTI::InteractionClassHandle       theInteraction, // supplied C1
00136      const RTI::ParameterHandleValuePairSet& theParameters,  // supplied C4
00137      const RTI::FedTime&                     theTime,        // supplied C4
00138      const char                             *theTag,         // supplied C4
00139            RTI::EventRetractionHandle        theHandle)      // supplied C1
00140    throw (
00141      RTI::InteractionClassNotKnown,
00142      RTI::InteractionParameterNotKnown,
00143      RTI::InvalidFederationTime,
00144      RTI::FederateInternalError);
00145 
00146    virtual void receiveInteraction (
00147            RTI::InteractionClassHandle       theInteraction, // supplied C1
00148      const RTI::ParameterHandleValuePairSet& theParameters,  // supplied C4
00149      const char                             *theTag)         // supplied C4
00150    throw (
00151      RTI::InteractionClassNotKnown,
00152      RTI::InteractionParameterNotKnown,
00153      RTI::FederateInternalError);
00154 
00155    virtual void removeObjectInstance (
00156            RTI::ObjectHandle          theObject, // supplied C1
00157      const RTI::FedTime&              theTime,   // supplied C4
00158      const char                      *theTag,    // supplied C4
00159            RTI::EventRetractionHandle theHandle) // supplied C1
00160    throw (
00161      RTI::ObjectNotKnown,
00162      RTI::InvalidFederationTime,
00163      RTI::FederateInternalError);
00164 
00165    virtual void removeObjectInstance (
00166            RTI::ObjectHandle          theObject, // supplied C1
00167      const char                      *theTag)    // supplied C4
00168    throw (
00169      RTI::ObjectNotKnown,
00170      RTI::FederateInternalError);
00171 
00172 
00173 public:
00174    DtTalkAmbData & myData;
00175 };
00176 

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)