![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: simpleDDMFedAmb13dlc.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00009 // The Federate Ambassador discovers and remove objects and 00010 // processes object reflects and recieve interactions. It also notes 00011 // attribute scope advisories 00012 00013 #ifndef MyFederateAmbassador_H_ 00014 #define MyFederateAmbassador_H_ 00015 00016 #include "NullFederateAmbassador13.h" 00017 00018 #include <map> 00019 #include <string> 00020 00021 using namespace rti13; 00022 00023 // Data exchanged between federate and Federate Ambassador 00024 class DtTalkAmbData 00025 { 00026 public: 00027 std::map<ObjectClassHandle, std::string> objectClassMap; 00028 std::map<ObjectHandle, std::string> objectInstanceMap; 00029 std::map<InteractionClassHandle, std::string> interactionClassMap; 00030 AttributeHandle myPositionHandle; 00031 int position; 00032 int lowerListen; 00033 int upperListen; 00034 int lowerSend; 00035 int upperSend; 00036 bool enableScopeAdvisories; 00037 bool isPublisher; 00038 00039 }; 00040 00041 class MyFederateAmbassador : public NullFederateAmbassador 00042 { 00043 public: 00044 00045 MyFederateAmbassador(DtTalkAmbData & data); 00046 00047 virtual ~MyFederateAmbassador() 00048 throw (FederateInternalError); 00049 00050 00052 // Object Management Services // 00054 00055 virtual void discoverObjectInstance ( 00056 ObjectHandle theObject, // supplied C1 00057 ObjectClassHandle theObjectClass, // supplied C1 00058 const char* theObjectName) // supplied C4 00059 throw ( 00060 CouldNotDiscover, 00061 ObjectClassNotKnown, 00062 FederateInternalError); 00063 00064 virtual void reflectAttributeValues ( 00065 ObjectHandle theObject, // supplied C1 00066 const AttributeHandleValuePairSet& theAttributes, // supplied C4 00067 const FedTime& theTime, // supplied C1 00068 const char *theTag, // supplied C4 00069 EventRetractionHandle theHandle) // supplied C1 00070 throw ( 00071 ObjectNotKnown, 00072 AttributeNotKnown, 00073 FederateOwnsAttributes, 00074 InvalidFederationTime, 00075 FederateInternalError); 00076 00077 virtual void reflectAttributeValues ( 00078 ObjectHandle theObject, // supplied C1 00079 const AttributeHandleValuePairSet& theAttributes, // supplied C4 00080 const char *theTag) // supplied C4 00081 throw ( 00082 ObjectNotKnown, 00083 AttributeNotKnown, 00084 FederateOwnsAttributes, 00085 FederateInternalError); 00086 00087 // 4.6 00088 virtual void receiveInteraction ( 00089 InteractionClassHandle theInteraction, // supplied C1 00090 const ParameterHandleValuePairSet& theParameters, // supplied C4 00091 const FedTime& theTime, // supplied C4 00092 const char *theTag, // supplied C4 00093 EventRetractionHandle theHandle) // supplied C1 00094 throw ( 00095 InteractionClassNotKnown, 00096 InteractionParameterNotKnown, 00097 InvalidFederationTime, 00098 FederateInternalError); 00099 00100 virtual void receiveInteraction ( 00101 InteractionClassHandle theInteraction, // supplied C1 00102 const ParameterHandleValuePairSet& theParameters, // supplied C4 00103 const char *theTag) // supplied C4 00104 throw ( 00105 InteractionClassNotKnown, 00106 InteractionParameterNotKnown, 00107 FederateInternalError); 00108 00109 virtual void removeObjectInstance ( 00110 ObjectHandle theObject, // supplied C1 00111 const FedTime& theTime, // supplied C4 00112 const char *theTag, // supplied C4 00113 EventRetractionHandle theHandle) // supplied C1 00114 throw ( 00115 ObjectNotKnown, 00116 InvalidFederationTime, 00117 FederateInternalError); 00118 00119 virtual void removeObjectInstance ( 00120 ObjectHandle theObject, // supplied C1 00121 const char *theTag) // supplied C4 00122 throw ( 00123 ObjectNotKnown, 00124 FederateInternalError); 00125 00126 virtual void attributesInScope ( 00127 ObjectHandle theObject, // supplied C1 00128 const AttributeHandleSet& theAttributes) // supplied C4 00129 throw ( 00130 ObjectNotKnown, 00131 AttributeNotKnown, 00132 FederateInternalError) ; 00133 00134 virtual void attributesOutOfScope ( 00135 ObjectHandle theObject, // supplied C1 00136 const AttributeHandleSet& theAttributes) // supplied C4 00137 throw ( 00138 ObjectNotKnown, 00139 AttributeNotKnown, 00140 FederateInternalError) ; 00141 00142 00143 public: 00144 DtTalkAmbData & myData; 00145 }; 00146 00147 00148 00149 #endif