MAK RTIspy API Documentation for HLA Evolved
interDdmMgr.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2001 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: interDdmMgr.h,v $ $Revision: 1.33 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef interDdmMgr_H_
00009 #define interDdmMgr_H_
00010 
00011 #ifdef DDM
00012 
00015 
00016 #include "interMgr.h"
00017 #include "distributedDdmMgr.h"
00018 #include <vlutil/vlHashlist.h>
00019 #include "regionSetList.h"
00020 #include "regMatchList.h"
00021 #include "interRegSet.h"
00022 #include "regSetPacket.h"
00023 #include "intRegSetMsg.h"
00024 
00025 class DtInteractionClassInfo;
00026 class DtRegionRealization;
00027 class DtFomClassMgr;
00028 
00035 class DT_DLL_LRC DtInterDataDistMgr : public DtInteractionMgr
00036 {
00037 protected:
00038 
00040    DtInterDataDistMgr(DtFederateMgr* fedMgr);
00041 
00042 public:
00043 
00045    virtual ~DtInterDataDistMgr();
00046 
00047 private:
00048 
00050    DtInterDataDistMgr(DtInterDataDistMgr const& other);
00051 
00053    DtInterDataDistMgr& operator=(DtInterDataDistMgr const& other);
00054 
00055 public:
00056 
00058    virtual DtDistributedDataDistMgr* ddmMgr();
00059    virtual DtDistributedDataDistMgr* ddmMgr() const;
00060 
00062    virtual void postJoinInit();
00063 
00065    virtual void resetDdm();
00066 
00068    virtual DtHandle uniquePubRegSetHandle();
00069 
00071    virtual DtHandle uniqueSubRegSetHandle();
00072 
00074    virtual int acceptInteraction(const DtInteractionMsg& msg);
00075 
00077    virtual bool acceptInteractionChannel(
00078       DtInteractionClassHandle classHandle, DtHandle channel);
00079 
00081    virtual void addLocalAddrMap(DtInteractionClassHandle classHandle,
00082       DtHandle regionSetHandle, const MAKRti::DtInetAddr& addr);
00083 
00085    virtual void removeLocalAddrMap(DtInteractionClassHandle classHandle,
00086       DtHandle regionSetHandle);
00087 
00089    virtual MAKRti::DtInetAddr localAddrMap(DtInteractionClassHandle classHandle,
00090       DtHandle regionSetHandle);
00091 
00093    virtual void addRemoteAddrMap(DtInteractionClassHandle classHandle,
00094       DtHandle regionSetHandle, const MAKRti::DtInetAddr& addr);
00095 
00097    virtual void removeRemoteAddrMap(DtInteractionClassHandle classHandle,
00098       DtHandle regionSetHandle);
00099 
00101    virtual MAKRti::DtInetAddr remoteAddrMap(DtInteractionClassHandle classHandle,
00102       DtHandle regionSetHandle);
00103 
00105    virtual DtInteractionRegionSet* createPubRegionSet(
00106       DtRegionRealization& region, DtInteractionClassInfo& classDesc,
00107       bool anonymous);
00108 
00110    virtual DtInteractionRegionSet* createPubRegionSet(
00111       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00112       bool anonymous);
00113 
00116    virtual DtInteractionRegionSet* getPubRegionSet(
00117       DtRegionRealization &region, DtInteractionClassInfo& classDesc,
00118       bool anonymous);
00119 
00122    virtual DtInteractionRegionSet* getPubRegionSet(
00123       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00124       bool anonymous);
00125 
00128    virtual DtInteractionRegionSet* createSubRegionSet(
00129       DtRegionRealization& region, DtInteractionClassInfo& classDesc,
00130       DtInteractionRegionSet* oldRegionSet, bool regionIsAdded);
00131 
00134    virtual DtInteractionRegionSet* createSubRegionSet(
00135       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00136       DtInteractionRegionSet* oldRegionSet, bool regionIsAdded);
00137 
00140    virtual DtInteractionRegionSet* addSubRegion(DtRegionRealization& region,
00141       DtInteractionClassInfo& classDesc, DtInteractionRegionSet* oldRegionSet);
00142 
00145    virtual DtInteractionRegionSet* addSubRegionList(
00146       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00147       DtInteractionRegionSet* oldRegionSet);
00148 
00152    virtual DtInteractionRegionSet* removeSubRegion(DtRegionRealization& region,
00153       DtInteractionClassInfo& classDesc, DtInteractionRegionSet* oldRegionSet);
00154 
00158    virtual DtInteractionRegionSet* removeSubRegionList(
00159       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00160       DtInteractionRegionSet* oldRegionSet);
00161 
00164    virtual DtInteractionRegionSet* createPasRegionSet(
00165       DtRegionRealization& region, DtInteractionClassInfo& classDesc,
00166       DtInteractionRegionSet* oldRegionSet, bool regionIsAdded);
00167 
00170    virtual DtInteractionRegionSet* createPasRegionSet(
00171       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00172       DtInteractionRegionSet* oldRegionSet, bool regionIsAdded);
00173 
00176    virtual DtInteractionRegionSet* addPasRegion(DtRegionRealization& region,
00177       DtInteractionClassInfo& classDesc, DtInteractionRegionSet* oldRegionSet);
00178 
00181    virtual DtInteractionRegionSet* addPasRegionList(
00182       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00183       DtInteractionRegionSet* oldRegionSet);
00184 
00188    virtual DtInteractionRegionSet* removePasRegion(DtRegionRealization& region,
00189       DtInteractionClassInfo& classDesc, DtInteractionRegionSet* oldRegionSet);
00190 
00194    virtual DtInteractionRegionSet* removePasRegionList(
00195       DtRegionEntryList const& regionList, DtInteractionClassInfo& classDesc,
00196       DtInteractionRegionSet* oldRegionSet);
00197 
00201    virtual DtInteractionRegionSet* defaultSubRegionSet(
00202       DtInteractionClassHandle classHandleValue);
00203 
00207    virtual DtInteractionRegionSet* defaultPasRegionSet(
00208       DtInteractionClassHandle classHandleValue);
00209 
00213    virtual DtInteractionRegionSet* defaultRemotePubRegionSet(
00214       DtInteractionClassHandle classHandleValue);
00215 
00217    virtual void deleteRegion(DtRegionRealization& region);
00218 
00220    virtual void processDeleteRegion(DtRegionRealization& region);
00221 
00223    virtual void notifyAboutRegionModification(DtRegionRealization &region);
00224 
00226    virtual void processNotifyRegion(DtRegionRealization &region, bool newRegion);
00227 
00229    virtual void sendRegionSetMsg(DtInterRegSetType type,
00230       const DtRegionSet &regionSet, 
00231       DtInteractionClassHandle classHandleValue,
00232       bool anonymous=false, bool forceDualTransmit=false);
00233 
00236    virtual void addPendingAssociateSubRegions(DtInteractionClassInfo& classDesc);
00237 
00240    virtual void addPendingAssociatePubRegions(DtInteractionClassInfo& classDesc);
00241 
00242    virtual void checkForRegionalSubscribe(DtInteractionClassInfo& info);
00243    virtual void checkForRegionalPublish(DtInteractionClassInfo& info);
00244 
00246    virtual void postTick();
00247 
00249    virtual bool save(DtRtiSaveFile& file);
00250 
00252    virtual void prepareToRestore();
00253 
00255    virtual bool restore( DtRtiSaveFile& file );
00256 
00257 public:
00258 
00260    static void processRegionSet(const DtInterRegSetMsg& msg, void* usr);
00261 
00262 protected:
00263 
00269 
00271    virtual void addAddrMapDelay(DtInteractionClassHandle classHandle,
00272       DtHandle regionSetHandle);
00273 
00275    virtual void removeAddrMapDelay(DtInteractionClassHandle classHandle,
00276       DtHandle regionSetHandle);
00277 
00279    virtual bool addrMapDelayExpired(DtInteractionClassHandle classHandle,
00280       DtHandle regionSetHandle);
00281 
00283    virtual void processPubRegionSet(const DtInterRegSetMsg& msg);
00284 
00286    virtual void processPubRegionSet(DtInteractionRegionSet* regionSet,
00287       DtInteractionClassInfo* classDesc);
00288 
00290    virtual void processSubRegionSet(const DtInterRegSetMsg& msg);
00291 
00293    virtual void processSubRegionSet(DtInteractionRegionSet* regionSet,
00294       DtInteractionClassInfo* classDesc);
00295    
00297    virtual void addLocalPubRegSet(
00298       DtInteractionClassHandle classHandleValue,
00299       DtInteractionRegionSet* regSet);
00300 
00303    virtual void deleteLocalPubRegSet(DtInteractionRegionSet* regSet);
00304    virtual DtInteractionRegionSet* localPubRegSet(
00305       DtInteractionClassHandle classHandleValue, DtHandle regSetHandle);
00306 
00308    virtual void addLocalSubRegSet(
00309       DtInteractionClassHandle classHandleValue,
00310       DtInteractionRegionSet* regSet);
00311 
00313    virtual void removeLocalSubRegSet(DtInteractionRegionSet* regSet);
00314    virtual DtInteractionRegionSet* localSubRegSet(
00315       DtInteractionClassHandle classHandleValue);
00316 
00318    virtual void addPassiveRegSet(
00319       DtInteractionClassHandle classHandleValue,
00320       DtInteractionRegionSet* regSet);
00321 
00323    virtual void removePassiveRegSet(DtInteractionRegionSet* regSet);
00324    virtual DtInteractionRegionSet* passiveRegSet(
00325       DtInteractionClassHandle classHandleValue);
00326 
00328    virtual void addRemotePubRegSet(
00329       DtInteractionClassHandle classHandleValue,
00330       DtInteractionRegionSet* regSet);
00331 
00333    virtual void removeRemotePubRegSet(
00334       DtInteractionClassHandle classHandleValue,
00335       DtHandle regSetHandle);
00336 
00338    virtual DtInteractionRegionSet* remotePubRegSet(
00339       DtInteractionClassHandle classHandleValue, DtHandle regSetHandle);
00340 
00342    virtual void addRemoteSubRegSet(DtInteractionRegionSet* regSet);
00343 
00345    virtual void removeRemoteSubRegSet(DtInteractionRegionSet* regSet,
00346       bool removeEmptyClassList=true);
00347    virtual DtInteractionRegionSet* remoteSubRegSet(
00348       DtFederateHandle federateHandle,
00349       DtInteractionClassHandle classHandle);
00350 
00352    virtual void evaluateOverlap(
00353       DtInteractionRegionSet& localRegionSet,
00354       DtInteractionRegionSet& remoteRegionSet);
00355 
00358    virtual void evaluateLocalOverlap(
00359       DtRegionSetList& remoteList,
00360       DtInteractionRegionSet& localRegionSet);
00361 
00365    virtual void evaluateLocalMatchOverlap(
00366       DtRegionSetList& remoteList,
00367       DtInteractionClassInfo* oldMatchClass,
00368       DtInteractionClassInfo& classDesc,
00369       DtInteractionRegionSet& localRegionSet);
00370 
00374    virtual void evaluateLocalOverlapSubClasses(
00375       DtInteractionClassInfo* oldMatchClass,
00376       DtInteractionClassInfo& classDesc,
00377       DtInteractionRegionSet& localRegionSet);
00378 
00381    virtual void evaluateRemoteOverlap(
00382       DtInteractionRegionSet& remoteRegionSet,
00383       DtInteractionClassInfo& classDesc);
00384 
00387    virtual void removeLocalOverlap(DtInteractionRegionSet& regionSet);
00388 
00391    virtual void removeRemoteOverlap(DtInteractionRegionSet& regionSet);
00392 
00395    virtual void addPendingPubRegionReference(
00396       DtHandle regionHandle, DtInteractionRegionSet *regionSet);
00397    virtual void addPendingSubRegionReference(
00398       DtHandle regionHandle, DtInteractionRegionSet *regionSet);
00399 
00401    virtual void addPendingPubRegSet(DtInteractionRegionSet* regionSet);
00402    virtual void addPendingSubRegSet(DtInteractionRegionSet* regionSet);
00403 
00404 #ifdef DtIFSPEC1516
00405 
00406    virtual void calculateRegionSet(
00407       DtInteractionClassInfo const& sentClassInfo,
00408       DtInteractionClassInfo const& receivedClassInfo,
00409       unsigned long channel,
00410       rti1516::RegionHandleSet & regionHandles);
00411 #elif defined(DtIFSPEC1516E)
00412 
00413    virtual void calculateRegionSet(
00414        DtInteractionClassInfo const& sentClassInfo,
00415        DtInteractionClassInfo const& receivedClassInfo,
00416        unsigned long channel,
00417        rti1516e::RegionHandleSet & regionHandles);
00418 #else
00419    void calculateRegionSet(
00420       DtInteractionClassInfo const& sentClassInfo,
00421       unsigned long channel, DtPhvps& paramSet);
00422 #endif
00423 
00425    virtual void writeRegionSetListByClass(DtRtiSaveFile& saveFile,
00426       DtRegionSetListByClass& regSetListByClass, DtRtiSaveRegionSetTypes type);
00427 
00429    virtual void writeRegionSet(DtRtiSaveFile& saveFile,
00430       DtInteractionRegionSet* regSet, DtRtiSaveRegionSetTypes type);
00431 
00433    virtual void restoreLocalRegSet(DtInterRegionSetPacket* packet);
00434 
00436    virtual void restoreRemoteRegSet(DtInterRegionSetPacket* packet);
00437 
00439    virtual void destroyRegionLists();
00440 
00441 protected:
00442    
00460 
00462    DtRegionSetListByClass myLocalPublish;
00463    DtRegionSetListByClass myRemotePublish;
00464 
00466    MAKRti::DtHashList myLocalSubscribe;
00467    MAKRti::DtHashList myPassiveSubscribe;
00468 
00470    MAKRti::DtHashList myRemoteSubscribe;
00471 
00475    DtRegionSetListByClass myOverlapPublish;
00476 
00480    DtRegionSetListByClass myMatchPublish;
00481 
00483    MAKRti::DtHashList myDefaultSubRegionSet;
00484    MAKRti::DtHashList myDefaultPasRegionSet;
00485 
00487    std::map< DtInteractionClassHandle, DtInteractionRegionSet*> myDefaultRemPubRegionSet;
00488 
00491    DtHandle myNextPubRegSetHandle;
00492    DtHandle myNextSubRegSetHandle;
00493    MAKRti::DtHashList myUsedPubHandles;
00494    MAKRti::DtHashList myUsedSubHandles;
00495 
00503    typedef std::map<DtHandle, DtInetAddr> DtRegSetHdlToAddrMap;
00504    typedef std::map<DtInteractionClassHandle, DtRegSetHdlToAddrMap> DtClassToRegSetAddrMap;
00505    DtClassToRegSetAddrMap myLocalRegionSetAddr;
00506    DtClassToRegSetAddrMap myRemoteRegionSetAddr;
00507 
00518    MAKRti::DtHashList myAddrMapDelay;
00519 
00523    MAKRti::DtHashList myPendingPubRegionReferences;
00524    MAKRti::DtHashList myPendingSubRegionReferences;
00525 
00529    MAKRti::DtList myPendingPubRegSets;
00530    MAKRti::DtList myPendingSubRegSets;
00531 };
00532 
00533 #endif
00534 #endif
00535 
00536 
00537 

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)