MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
interMgr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: interMgr.h,v $ $Revision: 1.64 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef interMgr_H_
10 #define interMgr_H_
11 
14 
15 #include <vlutil/vlList.h>
16 #include <vlutil/vlHashlist.h>
17 #include <vlutil/vlFedTarget.h>
18 #include "fomMgr.h"
19 #include "connectMgr.h"
20 #include "RIDparams.h"
21 #include "pHandValSet.h"
22 #ifdef DtMOM
23 #include "tallySet.h"
24 #endif
25 
26 class DtRtiSaveFile;
28 class DtInteractionMgr;
29 class DtFomClassMgr;
30 class DtMomMgr;
31 class DtTimeMgr;
32 class DtInteractionMsg;
33 class DtPubInterMsg;
34 class DtUnpubInterMsg;
35 class DtSubInterMsg;
36 class DtUnsubInterMsg;
37 class DtResignMsg;
38 class DtRegion;
39 class DtPhvps;
40 class DtRtiObject;
41 
47 {
48 public:
50  typedef DtInteractionMgr* (*DtInteractionMgrCreator)(DtFederateMgr* fedMgr);
51 
52 protected:
53  typedef std::map< DtInteractionClassHandle, DtBitMask*> DtInteractionClassMaskMap;
54 
55 protected:
56 
59 
60 public:
61 
63  virtual ~DtInteractionMgr();
64 
65 private:
66 
68  DtInteractionMgr(DtInteractionMgr const& other);
69 
71  DtInteractionMgr& operator=(DtInteractionMgr const& other);
72 
73 public:
74 
76  virtual void postJoinInit();
77 
79  virtual bool isPostJoined() const;
80 
82  virtual void publish(
83  DtInteractionClassHandle theInteraction);
84 
86  virtual void unpublish(
87  DtInteractionClassHandle theInteraction);
88 
90  virtual void subscribe(
91  DtInteractionClassHandle theClass,
92  bool active);
93 
95  virtual void unsubscribe(
96  DtInteractionClassHandle theClass);
97 
99  virtual unsigned long send(DtInteractionClassHandle theInteraction, const DtPhvps& params, DtRtiApiTime const * theTime,
100  DtRtiApiTagConstRef theTag, DtHandle channel, bool anonymous=false);
101 
103  virtual unsigned long sendDirected(DtInteractionClassHandle theInteraction, DtObjectInstanceHandle objectInstance,
104  const DtPhvps& params, DtRtiApiTagConstRef theTag, DtRtiApiTime const* theTime = nullptr);
105 
107  virtual MAKRti::DtTransportType getTransport(DtInteractionClassHandle theClass);
108 
110  virtual void setTransport(
111  DtInteractionClassHandle theClass,
112  MAKRti::DtTransportType theType);
113 
114 #if !defined(DtIFSPEC13) && !defined(DtIFSPEC1516)
115  virtual void requestInteractionTransportationTypeChange(
118  DtInteractionClassHandle theClass,
119  MAKRti::DtTransportType theType );
120 #endif
121 
123  virtual void setOrder(DtInteractionClassHandle theClass,
124  MAKRti::DtOrderType theType);
125 
126 #if defined(DtIFSPEC13)
129  DtInteractionClassHandle theClass,
130  DtRegion &theRegion,
131  bool active) {}
132 
135  DtInteractionClassHandle theClass,
136  DtRegion &theRegion) {}
137 
140  virtual unsigned long send(
141  DtInteractionClassHandle theClass,
142  const DtPhvps& params,
143  RTI::FedTime const * theTime,
144  const char* theTag,
145  DtRegion& theRegion,
146  bool anonymous=false) {return 0;}
147 
148 #else
149 
152  DtInteractionClassHandle theClass,
153  RTI_API::RegionHandleSet const & theRegionHandleSet,
154  bool active) {}
155 
158  DtInteractionClassHandle theClass,
159  RTI_API::RegionHandleSet const & theRegionHandleSet) {}
160 
163  virtual unsigned long send(
164  DtInteractionClassHandle theClass,
165  const DtPhvps& params,
166  RTI_API::RegionHandleSet const & theRegionHandleSet,
167  RTI_API::LogicalTime const * theTime,
168  RTI_API::VariableLengthData const & theTag,
169  bool anonymous = false) {return 0;}
170 
171 #endif
172 
173  virtual int acceptInteraction(const DtInteractionMsg& msg);
175 
178  virtual int subscribed(DtInteractionClassHandle handle);
179 
182  virtual int published(DtInteractionClassHandle handle);
183 
186  virtual int subscribed(DtInteractionClassInfo const* classDesc);
187 
189  virtual bool subscribed(DtObjectClassInfo const* objectClassInfo, DtInteractionClassInfo const* interactionClassInfo);
190 
194  virtual int evaluateSubscription(DtRtiMsg const& msg);
195 
197  virtual void sendSubscribeMsg(DtInteractionClassHandle theInter, bool isPassive,
198  DtFederateHandle fedHandle);
199  virtual void sendSubscribeMsg(DtInteractionClassHandle theInter,
200  bool isPassive, DtBitMask* sendMask = 0);
201 
203  virtual void sendPublishMsg(DtInteractionClassHandle theInter);
204 
206  virtual void sendUnsubscribeMsg(DtInteractionClassHandle theInter,
207  bool forSmartForwarding=false);
208 
210  virtual void sendUnpublishMsg(DtInteractionClassHandle theInter);
211 
213  virtual void sendInteractionMsg(DtInteractionClassHandle theClass, const DtPhvps& theParams,
214  MAKRti::DtTransportType transportType, MAKRti::DtOrderType orderType, DtRtiApiTime const * theTime,
215  DtRtiApiTagConstRef theTag, unsigned long serialNumber, DtHandle channel, bool anonymous = false);
216 
218  virtual void sendDirectedInteractionMsg(DtInteractionClassHandle interactionClass, DtRtiObject const& objectHandle,
219  const DtPhvps& parameters, MAKRti::DtOrderType orderType, DtRtiApiTime const* time, DtRtiApiTagConstRef userTag,
220  unsigned long serialNumber);
221 
223  virtual void checkParameterHandles(DtInteractionClassInfo* classDesc, const DtPhvps& paramValues);
224 
227  virtual void addPendingStartInters(
228  DtInteractionClassHandle theClass);
229  virtual void addPendingStopInters(
230  DtInteractionClassHandle theClass);
231 
233  virtual void sendPendingStartInters();
234  virtual void sendPendingStopInters();
235 
238  virtual void sendPendingSubscription();
239  virtual void addPendingSubscription(DtInteractionClassHandle theClass,
240  bool isPassive, DtFederateHandle fedHandle = 0);
241 
244  virtual void sendPendingUnsubscription();
245  virtual void addPendingUnsubscription(DtInteractionClassHandle theClass,
246  bool forSmartForwarding);
247 
249  virtual void preTick();
250 
252  virtual void postTick();
253 
255  virtual void processResign(const DtResignMsg& msg);
256 
259  virtual DtInteractionClassInfo* firstSubscribedClass(DtInteractionClassInfo* classDesc);
260 
265  virtual DtInteractionClassInfo* firstSubscribedDirectedClass(DtObjectClassInfo const* knownObjectClass, bool attributesOwned,
266  DtInteractionClassInfo* classDesc);
267 
270  virtual void enableRelevanceAdvisorySwitch();
271  virtual void disableRelevanceAdvisorySwitch();
272 
274  virtual void setRelevanceAdvisorySwitch(bool enableSwitch);
275  virtual bool relevanceAdvisorySwitch() const;
276 
278  virtual MAKRti::DtInetAddr localAddrMap(
279  DtInteractionClassHandle theClass, DtHandle theChannel);
280 
283 
287 
291 
293  virtual bool save(DtRtiSaveFile& file);
294 
296  virtual void prepareToRestore();
297 
299  virtual bool restore( DtRtiSaveFile& file );
300 
302  virtual DtFederateMgr* federateMgr();
303  virtual DtFederateMgr* federateMgr() const;
304 
306  virtual DtConnectionMgr* connectMgr();
307  virtual DtConnectionMgr* connectMgr() const;
308 
310  virtual DtRIDParameters* params();
311  virtual DtRIDParameters* params() const;
312 
314  virtual DtFomClassMgr* fom();
315  virtual DtFomClassMgr* fom() const;
316 
317 #ifdef DtMOM
318  virtual DtMomMgr* momMgr();
320  virtual DtMomMgr* momMgr() const;
321 #endif
322 
324  virtual DtTimeMgr* timeMgr();
325  virtual DtTimeMgr* timeMgr() const;
326 
327 public:
328 
332  static DtInteractionMgr* create(DtFederateMgr* fedMgrPtr);
333 
336  static void setCreatorFunction(DtInteractionMgrCreator fn);
337 
342  static void setInternalCreatorFunction(DtInteractionMgrCreator fn);
343 
344 
345 protected:
346 
347  //Increment MOM tally
348  virtual void fastIncrementSentTally(DtInteractionClassHandle classHandle,
349  MAKRti::DtTransportType transport);
350  virtual void fastIncrementReceivedTally(DtInteractionClassHandle classHandle,
351  MAKRti::DtTransportType transport);
352 
353  virtual void insertBitMask(DtInteractionClassMaskMap& classMaskMap, DtObjectClassHandle classHandle,
354  DtFederateHandle fedHandle);
355 
356 #if defined(DtIFSPEC13)
357  virtual DtPhvps* getParameterValuesAndRegionHandles(const DtInteractionMsg& inter, DtObjectInstanceHandle objectHandle,
358  DtPhvps& msgParams, DtInteractionClassInfo const** receiveClassDesc);
359 #else
360  virtual DtPhvps* getParameterValuesAndRegionHandles(const DtInteractionMsg& inter, DtObjectInstanceHandle objectHandle,
361  DtPhvps& msgParams, DtInteractionClassInfo const** receiveClassDesc, RTI_API::RegionHandleSet& regionHandles);
362 #endif
363 
365  virtual void processInteraction(const DtInteractionMsg& msg);
366  virtual void processPub(const DtPubInterMsg& msg);
367  virtual void processUnpub(const DtUnpubInterMsg& msg);
368  virtual void processSub(const DtSubInterMsg& msg);
369  virtual void processUnsub(const DtUnsubInterMsg& msg);
370 
373  virtual void addClassMulticast(DtInteractionClassInfo* classDesc);
374  virtual void removeClassMulticast(DtInteractionClassInfo* classDesc);
375 
376 #ifdef DtMOM
377  //Increment MOM tally
378  virtual void incrementSentTally(DtInteractionClassHandle classHandle,
379  MAKRti::DtTransportType transport);
380  virtual void incrementReceivedTally(DtInteractionClassHandle classHandle,
381  MAKRti::DtTransportType transport);
382 #endif
383 
385 #if defined(DtIFSPEC13)
386  virtual void calculateRegionSet(
387  DtInteractionClassInfo const& sentClassInfo,
388  unsigned long channel, DtPhvps& paramSet) {};
389 #else
390  virtual void calculateRegionSet(
391  DtInteractionClassInfo const& sentClassInfo,
392  DtInteractionClassInfo const& receivedClassInfo,
393  unsigned long channel,
394  RTI_API::RegionHandleSet & regionHandles) {}
395 #endif
396 
398  virtual void destroyInteractionLists();
399 
400 protected:
401 
404  static void processInteraction(const DtInteractionMsg& msg, void* usr);
405  static void processPub(const DtPubInterMsg& msg, void* usr);
406  static void processUnpub(const DtUnpubInterMsg& msg, void* usr);
407  static void processSub(const DtSubInterMsg& msg, void* usr);
408  static void processUnsub(const DtUnsubInterMsg& msg, void* usr);
409 
410 protected:
411 
414 
417 
419  MAKRti::DtList myPendingStartIntersList;
420  MAKRti::DtList myPendingStopIntersList;
421 
422  std::set<DtRtiMsgKind> myConstrainedInteractionKinds;
423 
426 
431 
435 
436 protected:
437 
439  static DtInteractionMgrCreator theCreator;
440 
442  static DtInteractionMgrCreator theInternalCreator;
443 };
444 
445 #endif
446 
447 
448 
DtInteractionClassMaskMap myRetransmitSubClassMask
Definition: interMgr.h:429
virtual void unsubscribeInteractionClassWithRegion(InteractionClassHandle theClass, Region &theRegion)
static DtInteractionMgrCreator theInternalCreator
The internal creator.
Definition: interMgr.h:442
virtual void checkForRegionalSubscribe(DtInteractionClassInfo &info)
The empty methods below are overridden in the DtInterDataDistMgr and help implement DDM...
Definition: interMgr.h:286
virtual void checkForRegionalPublish(DtInteractionClassInfo &info)
When subscribing, check whether region publication info needs to get sent to other LRCs/rtiexec along...
Definition: interMgr.h:290
This class manages the RTI&#39;s start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
DtInteractionClassHandleStdSet myRetransmitUnsubClass
Set of class unsubscriptions to retransmit.
Definition: interMgr.h:433
This file contains the declaration of the Connection Manager.
std::map< DtInteractionClassHandle, DtBitMask * > DtInteractionClassMaskMap
Definition: interMgr.h:53
virtual void calculateRegionSet(DtInteractionClassInfo const &sentClassInfo, DtInteractionClassInfo const &receivedClassInfo, unsigned long channel, RTI_API::RegionHandleSet &regionHandles)
Calculate region set for processUpdate.
Definition: interMgr.h:390
bool myIsJoined
Manager has performed join processing.
Definition: interMgr.h:416
Definition: resignMsg.h:36
RTI_API::LogicalTime DtRtiApiTime
Typedefs for RTI API types that frequently require conditional precompile directives.
Definition: rtiApiTypes.h:91
DtHandle DtObjectClassHandle
Definition: internalTypes.h:48
virtual void unsubscribeInteractionClassWithRegions(DtInteractionClassHandle theClass, RTI_API::RegionHandleSet const &theRegionHandleSet)
Process unsubscribe with region.
Definition: interMgr.h:157
DtHandle DtInteractionClassHandle
Definition: internalTypes.h:52
Definition: unpubIntMsg.h:23
DtRtiApiVariableLengthData const & DtRtiApiTagConstRef
Definition: rtiApiTypes.h:98
Instances of DtFederateMgr process federation-level messages (such as create, destroy, join, resign, and sync points) and manages the objects responsible for handling general communication, objects, interactions, the FOM, MOM, and data distribution mmg.
Definition: fedMgr.h:93
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:67
Instances of DtInteractionMgr manage the sending and receiving of interactions.
Definition: interMgr.h:46
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
DtHandle DtFederateHandle
Definition: internalTypes.h:46
DtHandle DtObjectInstanceHandle
Definition: internalTypes.h:50
The RTI object maintains the internal RTI object state.
Definition: rtiObject.h:123
Definition: fomMgr.h:49
Definition: unsubIntMsg.h:23
virtual void subscribeInteractionClassWithRegions(DtInteractionClassHandle theClass, RTI_API::RegionHandleSet const &theRegionHandleSet, bool active)
Process subscribe with region.
Definition: interMgr.h:151
DtInteractionClassHandleStdSet myRetransmitUnsubClassForSmartForwarding
Definition: interMgr.h:434
virtual void subscribeInteractionClassWithRegion(InteractionClassHandle theClass, Region &theRegion, Boolean active=RTI_TRUE)
std::set< DtRtiMsgKind > myConstrainedInteractionKinds
Definition: interMgr.h:422
MAKRti::DtList myPendingStopIntersList
Definition: interMgr.h:420
Definition: pubInterMsg.h:22
DtInteractionClassHandleStdSet myRetransmitSubClass
Set of class subscriptions to retransmit.
Definition: interMgr.h:428
Definition: intClassInfo.h:40
unsigned long DtHandle
The internal types.
Definition: internalTypes.h:41
static DtInteractionMgrCreator theCreator
The plugin creator.
Definition: interMgr.h:439
Definition: subInterMsg.h:22
std::set< DtInteractionClassHandle > DtInteractionClassHandleStdSet
Definition: internalTypes.h:53
MAKRti::DtList myPendingStartIntersList
Pending start/stop interactions.
Definition: interMgr.h:419
DtBitMask represents a variable length bit-field which may be used to represent an array of boolean d...
Definition: bitMask.h:24
bool myRelevanceSwitch
Indicates whether relevance advisory is enabled.
Definition: interMgr.h:425
#define DT_DLL_LRC
Definition: rtiMsConfig.h:155
Definition: pHandValSet.h:38
Definition: saveFile.h:21
Definition: objClassInfo.h:36
virtual unsigned long send(DtInteractionClassHandle theClass, const DtPhvps &params, RTI_API::RegionHandleSet const &theRegionHandleSet, RTI_API::LogicalTime const *theTime, RTI_API::VariableLengthData const &theTag, bool anonymous=false)
Process send interaction with region Internal RTI interactions (i.e., MOM) are sent anonymously...
Definition: interMgr.h:163
DtFederateMgr * myFederateMgr
Access to the federate manager.
Definition: interMgr.h:413
DtInteractionMsg is a message type that represents an HLA Interaction.
Definition: interactMsg.h:26
DtInteractionClassHandleStdSet myRetransmitPassiveSubClass
Definition: interMgr.h:430

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)