MAK RTIspy API Documentation for HLA 1.3
federationInfo.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: federationInfo.h,v $ $Revision: 1.8 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef federationInfo_H_
10 #define federationInfo_H_
11 
15 
16 #include <rtiVersion.h>
17 #include <vlutil/vlString.h>
18 #include <vlutil/vlInetAddr.h>
19 #include <rtiMsConfig.h>
20 #include "federateInfo.h"
21 #include <map>
22 #include <set>
23 #include <list>
24 
25 // Related typedefs
26 
28 typedef std::map< int, DtAssistantFederateInfo > DtFederateInfoByHandleMap;
29 
32 typedef std::pair< std::set< int >, std::set< int > > DtPendingAchievedPair;
33 
35 typedef std::map< MAKRti::DtString, DtPendingAchievedPair > DtSyncPtToAchievedFederatesMap;
36 
38 typedef std::map< int, MAKRti::DtString > DtFederationNameByHandleMap;
39 
43 {
44 public:
45 
47  const MAKRti::DtString& name = MAKRti::DtString::nullString(),
48  int handle = -1,
49  const std::list<MAKRti::DtString>& files = std::list<MAKRti::DtString>(),
50  bool testEn = true );
51 
52  void setFederationName(const MAKRti::DtString& val) { myFederationName = val; }
53  const MAKRti::DtString& federationName() const { return myFederationName; }
54 
55  void setFederationHandle(int val) { myFederationHandle = val; }
56  int federationHandle() const { return myFederationHandle; }
57 
58  void addFomModule(const MAKRti::DtString& module) { myFomModuleNames.push_back(module); }
59  void setFomModules(const std::list<MAKRti::DtString>& modules) { myFomModuleNames = modules; }
60  const std::list<MAKRti::DtString>* fomModules() const { return &myFomModuleNames; }
61 
62  void enableTesting(bool enabled) { myTestEnabled = enabled; }
63  bool testingEnabled() const { return myTestEnabled; }
64 
67  bool updateFederates(const DtFederateInfoByHandleMap& federates);
68 
70  bool updateFederate(const DtAssistantFederateInfo& federate);
71 
74  void replaceFederateList(const DtFederateInfoByHandleMap& federates);
75 
77  bool removeFederate(int handle);
78 
80  void clearFederates();
81 
83  const DtAssistantFederateInfo* federateInfo(unsigned handle) const;
84  DtAssistantFederateInfo* federateInfo(unsigned handle);
85 
87  const DtFederateInfoByHandleMap* federates() const { return &myFederates; }
88  DtFederateInfoByHandleMap* federates() { return &myFederates; }
89 
91  unsigned numFederates() const { return myFederates.size(); }
92 
94  unsigned numLocalFederates() const { return myLocalFederatesByHandle.size(); }
95 
97  int localFederateCompId(int federateHandle) const;
98 
101  int localFederateHandle(int compId) const;
102 
104  void updateSyncPoint(const MAKRti::DtString& name,
105  const DtPendingAchievedPair& pendAchv);
106 
108  void removeSyncPoint(const MAKRti::DtString& name) { mySyncPts.erase(name); }
109 
112  DtPendingAchievedPair *syncPoint(const MAKRti::DtString& name) { return &mySyncPts.find(name)->second; }
113 
115  const DtSyncPtToAchievedFederatesMap* syncPoints() const { return &mySyncPts; }
116 
118  void setHeartbeated(bool hb) { myHeartbeated = hb; }
119  bool heartbeated() const { return myHeartbeated; }
120 
121 protected:
122  MAKRti::DtString myFederationName;
124  std::list<MAKRti::DtString> myFomModuleNames;
126 
130 
132  std::map< int, int > myLocalFederatesByHandle;
133 
135  std::map< int, int > myLocalFederatesByCompId;
136 };
137 
138 typedef std::map< MAKRti::DtString, DtAssistantFederationInfo > DtFederationStateByNameMap;
139 
140 
141 #endif

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)