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

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)