MAK RTIspy API Documentation for HLA Evolved
simpleDDMFedAmb1516.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2006 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: simpleDDMFedAmb1516.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 "simpleDDMStringUtil.h"
00017 
00018 #include <map>
00019 #include <RTI/RTI1516.h>
00020 #include <RTI/NullFederateAmbassador.h>
00021 #include <string>
00022 
00023 // Data exchanged between federate and Federate Ambassador
00024 class DtTalkAmbData
00025 {
00026 public:
00027    bool myNameReservationReturned;
00028    bool myNameReservationSucceeded;
00029    std::map<rti1516::ObjectClassHandle, std::wstring> objectClassMap;
00030    std::map<rti1516::ObjectInstanceHandle, std::wstring> objectInstanceMap;
00031    std::map<rti1516::InteractionClassHandle, std::wstring> interactionClassMap;
00032    rti1516::AttributeHandle myPositionHandle;
00033    int position;
00034    int lowerListen;
00035    int upperListen;
00036    int lowerSend;
00037    int upperSend;
00038    bool enableScopeAdvisories;
00039    bool isPublisher;
00040 };
00041 
00042 class MyFederateAmbassador : public rti1516::NullFederateAmbassador
00043 {
00044 public:
00045 
00046    MyFederateAmbassador(DtTalkAmbData & data);
00047 
00048    virtual ~MyFederateAmbassador()
00049      throw ();
00050 
00051     virtual
00052     void
00053     objectInstanceNameReservationSucceeded
00054     (std::wstring const & theObjectInstanceName)
00055      throw (rti1516::UnknownName,
00056             rti1516::FederateInternalError);
00057 
00058     virtual
00059     void
00060     objectInstanceNameReservationFailed
00061     (std::wstring const & theObjectInstanceName)
00062      throw (rti1516::UnknownName,
00063             rti1516::FederateInternalError);
00064 
00065     virtual
00066     void
00067     discoverObjectInstance
00068     (rti1516::ObjectInstanceHandle theObject,
00069      rti1516::ObjectClassHandle theObjectClass,
00070      std::wstring const & theObjectInstanceName)
00071      throw (rti1516::CouldNotDiscover,
00072             rti1516::ObjectClassNotKnown,
00073             rti1516::FederateInternalError);
00074 
00075 
00076     virtual
00077     void
00078     reflectAttributeValues
00079     (rti1516::ObjectInstanceHandle theObject,
00080      rti1516::AttributeHandleValueMap const & theAttributeValues,
00081      rti1516::VariableLengthData const & theUserSuppliedTag,
00082      rti1516::OrderType sentOrder,
00083      rti1516::TransportationType theType)
00084      throw (rti1516::ObjectInstanceNotKnown,
00085             rti1516::AttributeNotRecognized,
00086             rti1516::AttributeNotSubscribed,
00087             rti1516::FederateInternalError);
00088 
00089     virtual
00090     void
00091     reflectAttributeValues
00092     (rti1516::ObjectInstanceHandle theObject,
00093      rti1516::AttributeHandleValueMap const & theAttributeValues,
00094      rti1516::VariableLengthData const & theUserSuppliedTag,
00095      rti1516::OrderType sentOrder,
00096      rti1516::TransportationType theType,
00097      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00098      throw (rti1516::ObjectInstanceNotKnown,
00099             rti1516::AttributeNotRecognized,
00100             rti1516::AttributeNotSubscribed,
00101             rti1516::FederateInternalError);
00102 
00103     virtual
00104     void
00105     reflectAttributeValues
00106     (rti1516::ObjectInstanceHandle theObject,
00107      rti1516::AttributeHandleValueMap const & theAttributeValues,
00108      rti1516::VariableLengthData const & theUserSuppliedTag,
00109      rti1516::OrderType sentOrder,
00110      rti1516::TransportationType theType,
00111      rti1516::LogicalTime const & theTime,
00112      rti1516::OrderType receivedOrder)
00113      throw (rti1516::ObjectInstanceNotKnown,
00114             rti1516::AttributeNotRecognized,
00115             rti1516::AttributeNotSubscribed,
00116             rti1516::FederateInternalError);
00117   
00118     virtual
00119     void
00120     reflectAttributeValues
00121     (rti1516::ObjectInstanceHandle theObject,
00122      rti1516::AttributeHandleValueMap const & theAttributeValues,
00123      rti1516::VariableLengthData const & theUserSuppliedTag,
00124      rti1516::OrderType sentOrder,
00125      rti1516::TransportationType theType,
00126      rti1516::LogicalTime const & theTime,
00127      rti1516::OrderType receivedOrder,
00128      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00129      throw (rti1516::ObjectInstanceNotKnown,
00130              rti1516::AttributeNotRecognized,
00131              rti1516::AttributeNotSubscribed,
00132              rti1516::FederateInternalError);
00133   
00134     virtual
00135     void
00136     reflectAttributeValues
00137     (rti1516::ObjectInstanceHandle theObject,
00138      rti1516::AttributeHandleValueMap const & theAttributeValues,
00139      rti1516::VariableLengthData const & theUserSuppliedTag,
00140      rti1516::OrderType sentOrder,
00141      rti1516::TransportationType theType,
00142      rti1516::LogicalTime const & theTime,
00143      rti1516::OrderType receivedOrder,
00144      rti1516::MessageRetractionHandle theHandle)
00145       throw (rti1516::ObjectInstanceNotKnown,
00146              rti1516::AttributeNotRecognized,
00147              rti1516::AttributeNotSubscribed,
00148              rti1516::InvalidLogicalTime,
00149              rti1516::FederateInternalError);
00150 
00151     virtual
00152     void
00153     reflectAttributeValues
00154     (rti1516::ObjectInstanceHandle theObject,
00155      rti1516::AttributeHandleValueMap const & theAttributeValues,
00156      rti1516::VariableLengthData const & theUserSuppliedTag,
00157      rti1516::OrderType sentOrder,
00158      rti1516::TransportationType theType,
00159      rti1516::LogicalTime const & theTime,
00160      rti1516::OrderType receivedOrder,
00161      rti1516::MessageRetractionHandle theHandle,
00162      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00163       throw (rti1516::ObjectInstanceNotKnown,
00164              rti1516::AttributeNotRecognized,
00165              rti1516::AttributeNotSubscribed,
00166              rti1516::InvalidLogicalTime,
00167              rti1516::FederateInternalError);
00168 
00169     virtual
00170     void
00171     receiveInteraction
00172     (rti1516::InteractionClassHandle theInteraction,
00173      rti1516::ParameterHandleValueMap const & theParameterValues,
00174      rti1516::VariableLengthData const & theUserSuppliedTag,
00175      rti1516::OrderType sentOrder,
00176      rti1516::TransportationType theType)
00177       throw (rti1516::InteractionClassNotRecognized,
00178              rti1516::InteractionParameterNotRecognized,
00179              rti1516::InteractionClassNotSubscribed,
00180              rti1516::FederateInternalError);
00181 
00182     virtual
00183     void
00184     receiveInteraction
00185     (rti1516::InteractionClassHandle theInteraction,
00186      rti1516::ParameterHandleValueMap const & theParameterValues,
00187      rti1516::VariableLengthData const & theUserSuppliedTag,
00188      rti1516::OrderType sentOrder,
00189      rti1516::TransportationType theType,
00190      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00191       throw (rti1516::InteractionClassNotRecognized,
00192              rti1516::InteractionParameterNotRecognized,
00193              rti1516::InteractionClassNotSubscribed,
00194              rti1516::FederateInternalError);
00195 
00196     virtual
00197     void
00198     receiveInteraction
00199     (rti1516::InteractionClassHandle theInteraction,
00200      rti1516::ParameterHandleValueMap const & theParameterValues,
00201      rti1516::VariableLengthData const & theUserSuppliedTag,
00202      rti1516::OrderType sentOrder,
00203      rti1516::TransportationType theType,
00204      rti1516::LogicalTime const & theTime,
00205      rti1516::OrderType receivedOrder)
00206       throw (rti1516::InteractionClassNotRecognized,
00207              rti1516::InteractionParameterNotRecognized,
00208              rti1516::InteractionClassNotSubscribed,
00209              rti1516::FederateInternalError);
00210 
00211     virtual
00212     void
00213     receiveInteraction
00214     (rti1516::InteractionClassHandle theInteraction,
00215      rti1516::ParameterHandleValueMap const & theParameterValues,
00216      rti1516::VariableLengthData const & theUserSuppliedTag,
00217      rti1516::OrderType sentOrder,
00218      rti1516::TransportationType theType,
00219      rti1516::LogicalTime const & theTime,
00220      rti1516::OrderType receivedOrder,
00221      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00222       throw (rti1516::InteractionClassNotRecognized,
00223              rti1516::InteractionParameterNotRecognized,
00224              rti1516::InteractionClassNotSubscribed,
00225              rti1516::FederateInternalError);
00226 
00227     virtual
00228     void
00229     receiveInteraction
00230     (rti1516::InteractionClassHandle theInteraction,
00231      rti1516::ParameterHandleValueMap const & theParameterValues,
00232      rti1516::VariableLengthData const & theUserSuppliedTag,
00233      rti1516::OrderType sentOrder,
00234      rti1516::TransportationType theType,
00235      rti1516::LogicalTime const & theTime,
00236      rti1516::OrderType receivedOrder,
00237      rti1516::MessageRetractionHandle theHandle)
00238       throw (rti1516::InteractionClassNotRecognized,
00239              rti1516::InteractionParameterNotRecognized,
00240              rti1516::InteractionClassNotSubscribed,
00241              rti1516::InvalidLogicalTime,
00242              rti1516::FederateInternalError);
00243 
00244     virtual
00245     void
00246     receiveInteraction
00247     (rti1516::InteractionClassHandle theInteraction,
00248      rti1516::ParameterHandleValueMap const & theParameterValues,
00249      rti1516::VariableLengthData const & theUserSuppliedTag,
00250      rti1516::OrderType sentOrder,
00251      rti1516::TransportationType theType,
00252      rti1516::LogicalTime const & theTime,
00253      rti1516::OrderType receivedOrder,
00254      rti1516::MessageRetractionHandle theHandle,
00255      rti1516::RegionHandleSet const & theSentRegionHandleSet)
00256       throw (rti1516::InteractionClassNotRecognized,
00257              rti1516::InteractionParameterNotRecognized,
00258              rti1516::InteractionClassNotSubscribed,
00259              rti1516::InvalidLogicalTime,
00260              rti1516::FederateInternalError);
00261 
00262     virtual
00263     void
00264     removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
00265                          rti1516::VariableLengthData const & theUserSuppliedTag,
00266                          rti1516::OrderType sentOrder)
00267       throw (rti1516::ObjectInstanceNotKnown,
00268              rti1516::FederateInternalError);
00269 
00270     virtual
00271     void
00272     removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
00273                          rti1516::VariableLengthData const & theUserSuppliedTag,
00274                          rti1516::OrderType sentOrder,
00275                          rti1516::LogicalTime const & theTime,
00276                          rti1516::OrderType receivedOrder)
00277       throw (rti1516::ObjectInstanceNotKnown,
00278              rti1516::FederateInternalError);
00279 
00280     virtual
00281     void
00282     removeObjectInstance(rti1516::ObjectInstanceHandle theObject,
00283                          rti1516::VariableLengthData const & theUserSuppliedTag,
00284                          rti1516::OrderType sentOrder,
00285                          rti1516::LogicalTime const & theTime,
00286                          rti1516::OrderType receivedOrder,
00287                          rti1516::MessageRetractionHandle theHandle)
00288       throw (rti1516::ObjectInstanceNotKnown,
00289              rti1516::InvalidLogicalTime,
00290              rti1516::FederateInternalError);
00291 
00292     virtual
00293     void
00294     attributesInScope
00295     (rti1516::ObjectInstanceHandle theObject,
00296       rti1516::AttributeHandleSet const & theAttributes)
00297       throw (rti1516::ObjectInstanceNotKnown,
00298              rti1516::AttributeNotRecognized,
00299              rti1516::AttributeNotSubscribed,
00300              rti1516::FederateInternalError) ;
00301 
00302     virtual
00303     void
00304     attributesOutOfScope
00305     (rti1516::ObjectInstanceHandle theObject,
00306       rti1516::AttributeHandleSet const & theAttributes)
00307       throw (rti1516::ObjectInstanceNotKnown,
00308              rti1516::AttributeNotRecognized,
00309              rti1516::AttributeNotSubscribed,
00310              rti1516::FederateInternalError) ;
00311 
00312 public:
00313    DtTalkAmbData & myData;
00314 };
00315 
00316 #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)