MAK RTIspy API Documentation for HLA 1.3
smConMgr.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: smConMgr.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *********************************************************************/
00008 
00011 
00012 #ifndef DtSmConnectionMgr_H_
00013 #define DtSmConnectionMgr_H_
00014 
00015 #include "connectMgr.h"
00016 #include "smConnection.h"
00017 #include <vlutil/vlFilename.h>
00018 
00019 #define DtSmDEFAULT_SHARED_MEM_NAME "DtRtiSharedMessages"
00020 
00023 class DtRtiShmQNetMgr;
00024 
00032 
00033 class DT_DLL_LRC DtSmConnectionMgr : public DtConnectionMgr
00034 {
00035 protected:
00036 
00037    DtSmConnectionMgr(DtRIDParameters* params, bool isFederate = false, 
00038       DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient = 
00039       DtBoost::shared_ptr<DtRtiAssistantLrcClient>());
00040 
00041 public:
00042 
00043    virtual ~DtSmConnectionMgr();
00044 
00048    virtual void initQMgr(DtU32 numBuckets, DtU32 payloadSize, bool reliable,
00049                          bool forceMgrSubscribe);
00050 
00052 
00055    virtual int send(const DtRtiMsg& msg, 
00056                     MAKRti::DtTransportType transport,
00057                     const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny());
00058 
00061    virtual bool flush();
00062 
00064 
00067    virtual bool processConnection( DtRtiConnection* conn,
00068                                    MAKRti::DtTransportType trans );
00069 
00073    virtual bool processConnections();
00074 
00077    virtual DtRtiMsg* getMessage();
00078 
00082    virtual DtRtiMsg* getMessageWithNetInfo(MAKRti::DtInetAddr *addr, MAKRti::DtTransportType *trans,
00083                                            DtU32 *priority = NULL);
00084    virtual MAKRti::DtInetAddr getLastDestAddr() const;
00085    virtual MAKRti::DtTransportType getLastTransportType() const;
00086 
00090 #ifdef DtIFSPEC1516
00091    virtual int readFileDescriptor(rti1516::TransportationType transport);
00092 #elif defined(DtIFSPEC1516E)
00093    virtual int readFileDescriptor(rti1516e::TransportationType transport);
00094 #else
00095    virtual int readFileDescriptor(RTI::TransportType transport);
00096 #endif
00097 
00098 #if defined(_WIN32)
00099 
00100 
00101 #ifdef DtIFSPEC1516
00102    virtual WSAEVENT readFileEvent(rti1516::TransportationType transport);
00103 #elif defined(DtIFSPEC1516E)
00104    virtual WSAEVENT readFileEvent(rti1516e::TransportationType transport);
00105 #else
00106    virtual WSAEVENT readFileEvent(RTI::TransportType transport);
00107 #endif
00108 #endif
00109 
00111    virtual DtSmRtiConnection* sharedMemConn() const;
00112 
00116    virtual void setNetConnMgr( DtRtiShmQNetMgr *smNetConnMgr );
00117 
00119    virtual bool sm_shutdown(bool ruthless = false);
00120 
00122    virtual bool setupSelectParams(DtSelectParam* params);
00123 
00125    virtual void setMsgFactory(DtRtiMsgFactory* fact);
00126 
00128    virtual void listenToMulticastGroup(const MAKRti::DtInetAddr& addr,
00129       const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
00130    virtual void dropMulticastGroup(const MAKRti::DtInetAddr& addr,
00131       const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
00132    virtual void forceDropMulticastGroup(const MAKRti::DtInetAddr& addr,
00133       const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
00134 
00138    virtual void connectFederation(
00139 #ifdef DtIFSPEC1516
00140       rti1516::FederateAmbassador* fedAmb,
00141 #elif defined(DtIFSPEC1516E)
00142        rti1516e::FederateAmbassador* fedAmb,
00143 #else
00144       RTI::FederateAmbassador* fedAmb,
00145 #endif
00146       DtLogicalTimeFactory* logicalTimeFactoryPtr,
00147       MAKRti::DtString fedExName, 
00148       DtFederateHandle fedHandle,
00149       int fedExHandle);
00150 
00153    virtual bool repairFederationConnection();
00154 
00158    virtual void disconnectFederation();
00159 
00162    virtual bool wait(MAKRti::DtTime period = 0.0, bool unlockWhileWaiting = false);
00163 
00166    virtual int subscriberCount() const;
00167 
00168 
00169 protected:
00170 
00176    virtual void startSharedMemMgr();
00177 
00181    virtual int initConnections();
00182 
00185    virtual bool createSharedMemConn();
00186 
00187 public:
00188  
00192    static DtConnectionMgr* create(DtRIDParameters* p,  bool isFederate = false, 
00193       DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient = 
00194       DtBoost::shared_ptr<DtRtiAssistantLrcClient>());
00195 
00202    static DtConnectionMgr* createQMgr(DtRIDParameters* params, DtU32 numBuckets,
00203                                       DtU32 payloadSize, bool queueReliable,
00204                                       bool forceMgrSubscribe, 
00205                                       bool isFederate = false, 
00206                                       DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient = 
00207                                          DtBoost::shared_ptr<DtRtiAssistantLrcClient>(),
00208                                       DtRtiShmQNetMgr *smNetConnMgr = 0);
00209 
00210 protected:
00211    DtSmRtiConnection * mySharedMemConn;
00212    MAKRti::DtString            mySharedMemName;
00213    DtRtiShmQNetMgr   * mySharedMemNetMgr;
00214 
00216    bool  myIsQueueManager;   
00217    DtU32 myNumBuckets;     
00218    DtU32 myPayloadSize;    
00219    bool  myQueueReliable;  
00220    bool  myForceSubscribe; 
00221    DtU32 myReadMask;       
00222 
00227    MAKRti::DtInetAddr        myLastDestAddr;
00228    MAKRti::DtTransportType   myLastTransportType; 
00229 };
00230 
00231 #endif
00232 

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)