MAK RTIspy API Documentation for HLA 1516
 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  std::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
39  std::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  virtual int readFileDescriptor(DtRtiApiTransportationType transport);
91 
92 #if defined(_WIN32)
93  virtual WSAEVENT readFileEvent(DtRtiApiTransportationType transport);
96 #endif
97 
99  virtual DtSmRtiConnection* sharedMemConn() const;
100 
104  virtual void setNetConnMgr( DtRtiShmQNetMgr *smNetConnMgr );
105 
107  virtual bool sm_shutdown(bool ruthless = false);
108 
110  virtual bool setupSelectParams(DtSelectParam* params);
111 
113  virtual void setMsgFactory(DtRtiMsgFactory* fact);
114 
116  virtual void listenToMulticastGroup(const MAKRti::DtInetAddr& addr,
117  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
118  virtual void dropMulticastGroup(const MAKRti::DtInetAddr& addr,
119  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
120  virtual void forceDropMulticastGroup(const MAKRti::DtInetAddr& addr,
121  const MAKRti::DtInetAddr& netInterface = MAKRti::DtInetAddr::inaddrAny());
122 
126  virtual void connectFederation(
127  RTI_API::FederateAmbassador* fedAmb,
128  DtLogicalTimeFactory* logicalTimeFactoryPtr,
129  MAKRti::DtString fedExName,
130  DtFederateHandle fedHandle,
131  int fedExHandle);
132 
136  virtual void disconnectFederation();
137 
140  virtual bool wait(MAKRti::DtTime period = 0.0, bool unlockWhileWaiting = false);
141 
144  virtual int subscriberCount() const;
145 
146 
147 protected:
148 
154  virtual void startSharedMemMgr();
155 
159  virtual int initConnections();
160 
163  virtual bool createSharedMemConn();
164 
167  virtual bool repairFederationConnection();
168 
169 public:
170 
174  static DtConnectionMgr* create(DtRIDParameters* p, bool isFederate = false,
175  std::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
176  std::shared_ptr<DtRtiAssistantLrcClient>());
177 
184  static DtConnectionMgr* createQMgr(DtRIDParameters* params, DtU32 numBuckets,
185  DtU32 payloadSize, bool queueReliable,
186  bool forceMgrSubscribe,
187  bool isFederate = false,
188  std::shared_ptr<DtRtiAssistantLrcClient> assistantClient =
189  std::shared_ptr<DtRtiAssistantLrcClient>(),
190  DtRtiShmQNetMgr *smNetConnMgr = 0);
191 
192 protected:
194  MAKRti::DtString mySharedMemName;
196 
199  DtU32 myNumBuckets;
203  DtU32 myReadMask;
204 
209  MAKRti::DtInetAddr myLastDestAddr;
210  MAKRti::DtTransportType myLastTransportType;
211 };
212 
213 #endif
214 
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:203
bool myQueueReliable
number of bytes available in each message slot
Definition: smConMgr.h:201
MAKRti::DtString mySharedMemName
Definition: smConMgr.h:194
This class manages the RTI&#39;s start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
Definition: fedTimeFactory.h:73
RTI_API::TransportationTypeHandle DtRtiApiTransportationType
Definition: rtiApiTypes.h:114
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.
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:202
DtRtiShmQNetMgr * mySharedMemNetMgr
Definition: smConMgr.h:195
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:67
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
DtHandle DtFederateHandle
Definition: internalTypes.h:46
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...
virtual int readFileDescriptor(DtRtiApiTransportationType transport)
Returns a file descriptor on which data will be present for the given transport type whenever there i...
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:210
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...
DtSmRtiConnection * mySharedMemConn
Definition: smConMgr.h:193
DtU32 myPayloadSize
number of message slots in shared memory queue
Definition: smConMgr.h:200
DtU32 myNumBuckets
indicates this is the queue manager
Definition: smConMgr.h:199
bool myIsQueueManager
These members are specific to the queue manager&#39;s connection manager.
Definition: smConMgr.h:198
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:209
virtual bool processConnection(DtRtiConnection *conn, MAKRti::DtTransportType trans)
Read from the given connection and process the message (if received) Return boolean: message was rece...
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:155
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 Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)