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 
46 {
47 public:
49  typedef DtInteractionMgr* (*DtInteractionMgrCreator)(DtFederateMgr* fedMgr);
50 
51 protected:
52  typedef std::map< DtInteractionClassHandle, DtBitMask*> DtInteractionClassMaskMap;
53 
54 protected:
55 
58 
59 public:
60 
62  virtual ~DtInteractionMgr();
63 
64 private:
65 
67  DtInteractionMgr(DtInteractionMgr const& other);
68 
70  DtInteractionMgr& operator=(DtInteractionMgr const& other);
71 
72 public:
73 
75  virtual void postJoinInit();
76 
78  virtual bool isPostJoined() const;
79 
81  virtual void publish(
82  DtInteractionClassHandle theInteraction);
83 
85  virtual void unpublish(
86  DtInteractionClassHandle theInteraction);
87 
89  virtual void subscribe(
90  DtInteractionClassHandle theClass,
91  bool active);
92 
94  virtual void unsubscribe(
95  DtInteractionClassHandle theClass);
96 
98  virtual unsigned long send(
99  DtInteractionClassHandle theInteraction,
100  const DtPhvps& params,
101 #ifdef DtIFSPEC1516
102  rti1516::LogicalTime const * theTime,
103  rti1516::VariableLengthData const & theTag,
104 #elif defined(DtIFSPEC1516E)
105  rti1516e::LogicalTime const * theTime,
106  rti1516e::VariableLengthData const & theTag,
107 #else
108  RTI::FedTime const * theTime,
109  const char* theTag,
110 #endif
111  DtHandle channel,
112  bool anonymous=false);
113 
115  virtual MAKRti::DtTransportType getTransport(DtInteractionClassHandle theClass);
116 
118  virtual void setTransport( DtInteractionClassHandle theClass,
119  MAKRti::DtTransportType theType);
120 
121 #ifdef DtIFSPEC1516E
122  virtual void requestInteractionTransportationTypeChange( DtInteractionClassHandle theClass,
125  MAKRti::DtTransportType theType );
126 #endif
127 
129  virtual void setOrder(DtInteractionClassHandle theClass,
130  MAKRti::DtOrderType theType);
131 
132 #ifdef DDM
133 #ifdef DtIFSPEC1516
134 
136  virtual void subscribeInteractionClassWithRegions (
137  DtInteractionClassHandle theClass,
138  rti1516::RegionHandleSet const & theRegionHandleSet,
139  bool active) {}
140 
142  virtual void unsubscribeInteractionClassWithRegions (
143  DtInteractionClassHandle theClass,
144  rti1516::RegionHandleSet const & theRegionHandleSet) {}
145 
148  virtual unsigned long send(
149  DtInteractionClassHandle theInteraction,
150  const DtPhvps& params,
151  rti1516::RegionHandleSet const & theRegionHandleSet,
152  rti1516::LogicalTime const * theTime,
153  rti1516::VariableLengthData const & theTag,
154  bool anonymous=false) {return 0;}
155 
156 #elif defined(DtIFSPEC1516E)
157  virtual void subscribeInteractionClassWithRegions (
159  DtInteractionClassHandle theClass,
160  rti1516e::RegionHandleSet const & theRegionHandleSet,
161  bool active) {}
162 
164  virtual void unsubscribeInteractionClassWithRegions (
165  DtInteractionClassHandle theClass,
166  rti1516e::RegionHandleSet const & theRegionHandleSet) {}
167 
170  virtual unsigned long send(
171  DtInteractionClassHandle theInteraction,
172  const DtPhvps& params,
173  rti1516e::RegionHandleSet const & theRegionHandleSet,
174  rti1516e::LogicalTime const * theTime,
175  rti1516e::VariableLengthData const & theTag,
176  bool anonymous=false) {return 0;}
177 #else
178 
181  DtInteractionClassHandle theClass,
182  DtRegion &theRegion,
183  bool active) {}
184 
187  DtInteractionClassHandle theClass,
188  DtRegion &theRegion) {}
189 
192  virtual unsigned long send(
193  DtInteractionClassHandle theInteraction,
194  const DtPhvps& params,
195  RTI::FedTime const * theTime,
196  const char* theTag,
197  DtRegion& theRegion,
198  bool anonymous=false) {return 0;}
199 
200 #endif
201 #endif
202 
203  virtual int acceptInteraction(const DtInteractionMsg& msg);
205 
208  virtual int subscribed(DtInteractionClassHandle handle);
209 
212  virtual int published(DtInteractionClassHandle handle);
213 
216  virtual int subscribed(DtInteractionClassInfo* classDesc);
217 
221  virtual int evaluateSubscription(DtRtiMsg const& msg);
222 
224  virtual void sendSubscribeMsg(DtInteractionClassHandle theInter, bool isPassive,
225  DtFederateHandle fedHandle);
226  virtual void sendSubscribeMsg(DtInteractionClassHandle theInter,
227  bool isPassive, DtBitMask* sendMask = 0);
228 
230  virtual void sendPublishMsg(DtInteractionClassHandle theInter);
231 
233  virtual void sendUnsubscribeMsg(DtInteractionClassHandle theInter,
234  bool forSmartForwarding=false);
235 
237  virtual void sendUnpublishMsg(DtInteractionClassHandle theInter);
238 
240  virtual void sendInteractionMsg(
241  DtInteractionClassHandle theClass,
242  const DtPhvps& theParams,
243  MAKRti::DtTransportType transportType,
244  MAKRti::DtOrderType orderType,
245 #ifdef DtIFSPEC1516
246  rti1516::LogicalTime const * theTime,
247  rti1516::VariableLengthData const & theTag,
248 #elif defined(DtIFSPEC1516E)
249  rti1516e::LogicalTime const * theTime,
250  rti1516e::VariableLengthData const & theTag,
251 #else
252  RTI::FedTime const * theTime,
253  const char* theTag,
254 #endif
255  unsigned long serialNumber, DtHandle channel, bool anonymous=false);
256 
259  virtual void addPendingStartInters(
260  DtInteractionClassHandle theClass);
261  virtual void addPendingStopInters(
262  DtInteractionClassHandle theClass);
263 
265  virtual void sendPendingStartInters();
266  virtual void sendPendingStopInters();
267 
270  virtual void sendPendingSubscription();
271  virtual void addPendingSubscription(DtInteractionClassHandle theClass,
272  bool isPassive, DtFederateHandle fedHandle = 0);
273 
276  virtual void sendPendingUnsubscription();
277  virtual void addPendingUnsubscription(DtInteractionClassHandle theClass,
278  bool forSmartForwarding);
279 
281  virtual void preTick();
282 
284  virtual void postTick();
285 
287  virtual void processResign(const DtResignMsg& msg);
288 
290  virtual DtInteractionClassInfo* firstSubscribedClass(
291  DtInteractionClassInfo* classDesc);
292 
295  virtual void enableRelevanceAdvisorySwitch();
296  virtual void disableRelevanceAdvisorySwitch();
297 
299  virtual void setRelevanceAdvisorySwitch(bool enableSwitch);
300  virtual bool relevanceAdvisorySwitch();
301 
303  virtual MAKRti::DtInetAddr localAddrMap(
304  DtInteractionClassHandle theClass, DtHandle theChannel);
305 
306 #ifdef DDM
307 
312  virtual void checkForRegionalSubscribe(DtInteractionClassInfo& info) {}
313 
316  virtual void checkForRegionalPublish(DtInteractionClassInfo& info) {}
317 
318 #endif
319 
321  virtual bool save(DtRtiSaveFile& file);
322 
324  virtual void prepareToRestore();
325 
327  virtual bool restore( DtRtiSaveFile& file );
328 
330  virtual DtFederateMgr* federateMgr();
331  virtual DtFederateMgr* federateMgr() const;
332 
334  virtual DtConnectionMgr* connectMgr();
335  virtual DtConnectionMgr* connectMgr() const;
336 
338  virtual DtRIDParameters* params();
339  virtual DtRIDParameters* params() const;
340 
342  virtual DtFomClassMgr* fom();
343  virtual DtFomClassMgr* fom() const;
344 
345 #ifdef DtMOM
346  virtual DtMomMgr* momMgr();
348  virtual DtMomMgr* momMgr() const;
349 #endif
350 
351 #ifdef DtTIME
352  virtual DtTimeMgr* timeMgr();
354  virtual DtTimeMgr* timeMgr() const;
355 #endif
356 
357 
358 public:
359 
363  static DtInteractionMgr* create(DtFederateMgr* fedMgrPtr);
364 
367  static void setCreatorFunction(DtInteractionMgrCreator fn);
368 
373  static void setInternalCreatorFunction(DtInteractionMgrCreator fn);
374 
375 
376 protected:
377 
378  //Increment MOM tally
379  virtual void fastIncrementSentTally(DtInteractionClassHandle classHandle,
380  MAKRti::DtTransportType transport);
381  virtual void fastIncrementReceivedTally(DtInteractionClassHandle classHandle,
382  MAKRti::DtTransportType transport);
383 
384  virtual void insertBitMask(DtInteractionClassMaskMap& classMaskMap, DtObjectClassHandle classHandle,
385  DtFederateHandle fedHandle);
386 
388  virtual void processInteraction(const DtInteractionMsg& msg);
389  virtual void processPub(const DtPubInterMsg& msg);
390  virtual void processUnpub(const DtUnpubInterMsg& msg);
391  virtual void processSub(const DtSubInterMsg& msg);
392  virtual void processUnsub(const DtUnsubInterMsg& msg);
393 
396  virtual void addClassMulticast(DtInteractionClassInfo* classDesc);
397  virtual void removeClassMulticast(DtInteractionClassInfo* classDesc);
398 
399 #ifdef DtMOM
400  //Increment MOM tally
401  virtual void incrementSentTally(DtInteractionClassHandle classHandle,
402  MAKRti::DtTransportType transport);
403  virtual void incrementReceivedTally(DtInteractionClassHandle classHandle,
404  MAKRti::DtTransportType transport);
405 #endif
406 
407 #ifdef DDM
408 #ifdef DtIFSPEC1516
409  virtual void calculateRegionSet(
411  DtInteractionClassInfo const& sentClassInfo,
412  DtInteractionClassInfo const& receivedClassInfo,
413  unsigned long channel,
414  rti1516::RegionHandleSet & regionHandles) {}
415 #elif defined(DtIFSPEC1516E)
416  virtual void calculateRegionSet(
418  DtInteractionClassInfo const& sentClassInfo,
419  DtInteractionClassInfo const& receivedClassInfo,
420  unsigned long channel,
421  rti1516e::RegionHandleSet & regionHandles) {}
422 #else
423  virtual void calculateRegionSet(
424  DtInteractionClassInfo const& sentClassInfo,
425  unsigned long channel, DtPhvps& paramSet) {};
426 #endif
427 #endif
428 
429  virtual void destroyInteractionLists();
431 
432 protected:
433 
436  static void processInteraction(const DtInteractionMsg& msg, void* usr);
437  static void processPub(const DtPubInterMsg& msg, void* usr);
438  static void processUnpub(const DtUnpubInterMsg& msg, void* usr);
439  static void processSub(const DtSubInterMsg& msg, void* usr);
440  static void processUnsub(const DtUnsubInterMsg& msg, void* usr);
441 
442 protected:
443 
446 
449 
451  MAKRti::DtList myPendingStartIntersList;
452  MAKRti::DtList myPendingStopIntersList;
453 
454  std::set<DtRtiMsgKind> myConstrainedInteractionKinds;
455 
458 
460  std::set<DtInteractionClassHandle> myRetransmitSubClass;
462  std::set<DtInteractionClassHandle> myRetransmitPassiveSubClass;
463 
465  std::set<DtInteractionClassHandle> myRetransmitUnsubClass;
466  std::set<DtInteractionClassHandle> myRetransmitUnsubClassForSmartForwarding;
467 
468 protected:
469 
471  static DtInteractionMgrCreator theCreator;
472 
474  static DtInteractionMgrCreator theInternalCreator;
475 };
476 
477 #endif
478 
479 
480 
std::set< DtInteractionClassHandle > myRetransmitSubClass
Set of class subscriptions to retransmit.
Definition: interMgr.h:460
DtInteractionClassMaskMap myRetransmitSubClassMask
Definition: interMgr.h:461
virtual void unsubscribeInteractionClassWithRegion(InteractionClassHandle theClass, Region &theRegion)
static DtInteractionMgrCreator theInternalCreator
The internal creator.
Definition: interMgr.h:474
This class manages the RTI&#39;s start-up configuration using both MTL variables and functions.
Definition: RIDparams.h:87
This file contains the declaration of the Connection Manager.
std::map< DtInteractionClassHandle, DtBitMask * > DtInteractionClassMaskMap
Definition: interMgr.h:52
bool myIsJoined
Manager has performed join processing.
Definition: interMgr.h:448
Definition: resignMsg.h:36
DtHandle DtObjectClassHandle
Definition: internalTypes.h:31
DtHandle DtInteractionClassHandle
Definition: internalTypes.h:35
Definition: unpubIntMsg.h:23
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:84
std::set< DtInteractionClassHandle > myRetransmitPassiveSubClass
Definition: interMgr.h:462
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:60
Instances of DtInteractionMgr manage the sending and receiving of interactions.
Definition: interMgr.h:45
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:45
DtHandle DtFederateHandle
Definition: internalTypes.h:29
Definition: fomMgr.h:53
Definition: unsubIntMsg.h:23
virtual void subscribeInteractionClassWithRegion(InteractionClassHandle theClass, Region &theRegion, Boolean active=RTI_TRUE)
std::set< DtRtiMsgKind > myConstrainedInteractionKinds
Definition: interMgr.h:454
MAKRti::DtList myPendingStopIntersList
Definition: interMgr.h:452
Definition: pubInterMsg.h:22
Definition: intClassInfo.h:41
unsigned long DtHandle
The internal types.
Definition: internalTypes.h:25
static DtInteractionMgrCreator theCreator
The plugin creator.
Definition: interMgr.h:471
Definition: subInterMsg.h:22
MAKRti::DtList myPendingStartIntersList
Pending start/stop interactions.
Definition: interMgr.h:451
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:457
#define DT_DLL_LRC
Definition: rtiMsConfig.h:126
Definition: saveFile.h:21
std::set< DtInteractionClassHandle > myRetransmitUnsubClass
Set of class unsubscriptions to retransmit.
Definition: interMgr.h:465
DtFederateMgr * myFederateMgr
Access to the federate manager.
Definition: interMgr.h:445
std::set< DtInteractionClassHandle > myRetransmitUnsubClassForSmartForwarding
Definition: interMgr.h:466
DtInteractionMsg is a message type that represents an HLA Interaction.
Definition: interactMsg.h:27

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)