MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
smConMgr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2005 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: smConMgr.h,v $ $Revision: 1.13 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtSmConnectionMgr_H_
13 #define DtSmConnectionMgr_H_
14 
15 #include "connectMgr.h"
16 #include "smConnection.h"
17 #include <vlutil/vlFilename.h>
18 
19 #define DtSmDEFAULT_SHARED_MEM_NAME "DtRtiSharedMessages"
20 
23 class DtRtiShmQNetMgr;
24 
32 
34 {
35 protected:
36 
37  DtSmConnectionMgr(DtRIDParameters* params, bool isFederate = false,
38  DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
39  DtBoost::shared_ptr<DtRtiAssistantLrcClient>());
40 
41 public:
42 
43  virtual ~DtSmConnectionMgr();
44 
48  virtual void initQMgr(DtU32 numBuckets, DtU32 payloadSize, bool reliable,
49  bool forceMgrSubscribe);
50 
52 
55  virtual int send(const DtRtiMsg& msg,
56  MAKRti::DtTransportType transport,
57  const MAKRti::DtInetAddr& addr = MAKRti::DtInetAddr::inaddrAny());
58 
61  virtual bool flush();
62 
64 
67  virtual bool processConnection( DtRtiConnection* conn,
68  MAKRti::DtTransportType trans );
69 
73  virtual bool processConnections();
74 
77  virtual DtRtiMsg* getMessage();
78 
82  virtual DtRtiMsg* getMessageWithNetInfo(MAKRti::DtInetAddr *addr, MAKRti::DtTransportType *trans,
83  DtU32 *priority = NULL);
84  virtual MAKRti::DtInetAddr getLastDestAddr() const;
85  virtual MAKRti::DtTransportType getLastTransportType() const;
86 
90 #ifdef DtIFSPEC1516
91  virtual int readFileDescriptor(rti1516::TransportationType transport);
92 #elif defined(DtIFSPEC1516E)
93  virtual int readFileDescriptor(rti1516e::TransportationType transport);
94 #else
95  virtual int readFileDescriptor(RTI::TransportType transport);
96 #endif
97 
98 #if defined(_WIN32)
99 #ifdef DtIFSPEC1516
102  virtual WSAEVENT readFileEvent(rti1516::TransportationType transport);
103 #elif defined(DtIFSPEC1516E)
104  virtual WSAEVENT readFileEvent(rti1516e::TransportationType transport);
105 #else
106  virtual WSAEVENT readFileEvent(RTI::TransportType transport);
107 #endif
108 #endif
109 
111  virtual DtSmRtiConnection* sharedMemConn() const;
112 
116  virtual void setNetConnMgr( DtRtiShmQNetMgr *smNetConnMgr );
117 
119  virtual bool sm_shutdown(bool ruthless = false);
120 
122  virtual bool setupSelectParams(DtSelectParam* params);
123 
125  virtual void setMsgFactory(DtRtiMsgFactory* fact);
126 
128  virtual void listenToMulticastGroup(const MAKRti::DtInetAddr& addr,
129  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
130  virtual void dropMulticastGroup(const MAKRti::DtInetAddr& addr,
131  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
132  virtual void forceDropMulticastGroup(const MAKRti::DtInetAddr& addr,
133  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
134 
138  virtual void connectFederation(
139 #ifdef DtIFSPEC1516
140  rti1516::FederateAmbassador* fedAmb,
141 #elif defined(DtIFSPEC1516E)
143 #else
144  RTI::FederateAmbassador* fedAmb,
145 #endif
146  DtLogicalTimeFactory* logicalTimeFactoryPtr,
147  MAKRti::DtString fedExName,
148  DtFederateHandle fedHandle,
149  int fedExHandle);
150 
153  virtual bool repairFederationConnection();
154 
158  virtual void disconnectFederation();
159 
162  virtual bool wait(MAKRti::DtTime period = 0.0, bool unlockWhileWaiting = false);
163 
166  virtual int subscriberCount() const;
167 
168 
169 protected:
170 
176  virtual void startSharedMemMgr();
177 
181  virtual int initConnections();
182 
185  virtual bool createSharedMemConn();
186 
187 public:
188 
192  static DtConnectionMgr* create(DtRIDParameters* p, bool isFederate = false,
193  DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
194  DtBoost::shared_ptr<DtRtiAssistantLrcClient>());
195 
202  static DtConnectionMgr* createQMgr(DtRIDParameters* params, DtU32 numBuckets,
203  DtU32 payloadSize, bool queueReliable,
204  bool forceMgrSubscribe,
205  bool isFederate = false,
206  DtBoost::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
207  DtBoost::shared_ptr<DtRtiAssistantLrcClient>(),
208  DtRtiShmQNetMgr *smNetConnMgr = 0);
209 
210 protected:
212  MAKRti::DtString mySharedMemName;
214 
217  DtU32 myNumBuckets;
221  DtU32 myReadMask;
222 
227  MAKRti::DtInetAddr myLastDestAddr;
228  MAKRti::DtTransportType myLastTransportType;
229 };
230 
231 #endif
232 
virtual void setMsgFactory(DtRtiMsgFactory *fact)
Get/Set the message factory.
virtual bool processConnections()
Check all the connections and process any incomming messages Return boolean: message was received...
virtual DtRtiMsg * getMessage()
Get a message if one exists Message must be destroyed by caller.
DtU32 myReadMask
should only be used by queue manager
Definition: smConMgr.h:221
bool myQueueReliable
number of bytes available in each message slot
Definition: smConMgr.h:219
MAKRti::DtString mySharedMemName
Definition: smConMgr.h:212
This class manages the RTI&#39;s start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
!DtIFSPEC1516
Definition: fedTimeFactory.h:190
This class represents a network connection with another RTI component.
Definition: connection.h:38
This file contains the declaration of the Connection Manager.
virtual int send(const DtRtiMsg &msg, MAKRti::DtTransportType transport, const MAKRti::DtInetAddr &addr=MAKRti::DtInetAddr::inaddrAny())
Sending.
TransportationHandle TransportType
Definition: RTItypes13.h:124
virtual void disconnectFederation()
The LRC disassociates its connections from the federation.
virtual bool flush()
Send buffered messages.
virtual void dropMulticastGroup(const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement...
bool myForceSubscribe
indicates shared mem queue in reliable mode
Definition: smConMgr.h:220
#define NULL
Definition: baseTypes13.h:8
DtRtiShmQNetMgr * mySharedMemNetMgr
Definition: smConMgr.h:213
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:60
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:45
DtHandle DtFederateHandle
Definition: internalTypes.h:29
virtual bool repairFederationConnection()
Attempt to re-establish a broken connection to the federation Returns true if successful.
virtual void listenToMulticastGroup(const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
Add/Drop multicast groups from the best effort connection Listens are accumulated and drops decrement...
The DtRtiShmQNetMgr class implements a network I/O socket manager to filter and exchange messages bet...
Definition: rtiShmQNetMgr.h:40
MAKRti::DtTransportType myLastTransportType
Definition: smConMgr.h:228
Definition: smConnection.h:23
The DtMessageFactory template can be instantiated to declare a message factory for a given message cl...
Definition: messageFactory.h:33
virtual bool setupSelectParams(DtSelectParam *params)
adds Read File descriptors to a DtSelectParams Return boolean: file descriptor was added...
virtual int readFileDescriptor(RTI::TransportType transport)
Returns a file descriptor on which data will be present for the given transport type whenever there i...
DtSmRtiConnection * mySharedMemConn
Definition: smConMgr.h:211
DtU32 myPayloadSize
number of message slots in shared memory queue
Definition: smConMgr.h:218
DtU32 myNumBuckets
indicates this is the queue manager
Definition: smConMgr.h:217
bool myIsQueueManager
These members are specific to the queue manager&#39;s connection manager.
Definition: smConMgr.h:216
virtual int initConnections()
Initialize the RTI&#39;s exercise connections Users who wish to override the MAK RTI&#39;s network connection...
virtual void forceDropMulticastGroup(const MAKRti::DtInetAddr &addr, const MAKRti::DtInetAddr &netInterface=MAKRti::DtInetAddr::inaddrAny())
Override listen count and force drop multicast address.
MAKRti::DtInetAddr myLastDestAddr
controls what type of messages are read/skipped
Definition: smConMgr.h:227
virtual bool processConnection(DtRtiConnection *conn, MAKRti::DtTransportType trans)
Read from the given connection and process the message (if received) Return boolean: message was rece...
An abstract base class which must be implemented, and used by a federate.
virtual void connectFederation(DtLogicalTimeFactory *logicalTimeFactoryPtr, MAKRti::DtString fedExName, DtFederateHandle federateHandle, int fedExHandle)
The LRC associates its federation information with its network connections.
#define DT_DLL_LRC
Definition: rtiMsConfig.h:126
virtual DtRtiMsg * create(DtRtiMsgKind kind)
Request the RTI message factory for a msg.
virtual bool wait(MAKRti::DtTime periodInSeconds, bool unlockWhileWaiting=false)
Wait for data to be ready or the given period of time to expire Return boolean: data is ready for rea...
Instances of DtSmConnectionMgr manage the communication objects that the RTI will use to communicate ...
Definition: smConMgr.h:33

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)