![]() |
VR-Link API Documentation for DIS
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 00009 00010 #ifndef federateSR_H_ 00011 #define federateSR_H_ 00012 00013 #if DtHLA 00014 00015 #include <vlutil/vlMachineTypes.h> 00016 #include <vlutil/vlString.h> 00017 #include "varDatumRec.h" 00018 #include <memory> 00019 #include "rtiCompatibility.h" 00020 #include "stateRep.h" 00021 #include "hExerciseConn.h" 00022 00023 00030 class DT_DLL_VL DtFederateStateRepository : public DtStateRepository 00031 { 00032 public: 00036 enum DtFederateState 00037 { 00038 DtFedStateActiveFederate = 1, 00039 DtFedStateFederateSaveInProgress = 3, 00040 DtFedStateFederateRestoreInProgress = 5 00041 }; 00042 00046 enum DtTimeState 00047 { 00048 DtTimeStateTimeGranted = 0, 00049 DtTimeStateTimeAdvancing = 1 00050 }; 00051 00052 public: 00054 DtFederateStateRepository(); 00055 00057 virtual ~DtFederateStateRepository(); 00058 00060 DtFederateStateRepository(const DtFederateStateRepository& orig); 00061 00063 DtFederateStateRepository& operator=(const DtFederateStateRepository& orig); 00064 00066 virtual DtStateRepository* clone(bool copy) const; 00067 00069 static DtFederateStateRepository* create(); 00070 00072 virtual void printData() const; 00073 00075 virtual void printDataToStream(std::ostream& stream) const; 00076 00078 00079 const RTI::FederateHandle& federateHandle() const; 00080 void setFederateHandle(const RTI::FederateHandle& val); 00082 00084 00085 const DtString& federateType() const; 00086 void setFederateType(const DtString& val); 00088 00089 #if DtHLA_1516 00090 00091 00092 bool conveyRegionDesignatorSets() const; 00093 void setConveyRegionDesignatorSets(bool val); 00095 #endif 00096 00097 #if DtHLA_1516_EVOLVED 00098 00099 00100 const DtString& federateName() const; 00101 void setFederateName(const DtString& val); 00103 00105 00106 bool conveyProducingFederate() const; 00107 void setConveyProducingFederate(bool val); 00109 00111 00112 const std::vector<DtString>& fomModuleDesignatorList() const; 00113 void setFomModuleDesignatorList(const std::vector<DtString>& modules); 00115 00116 00117 #endif 00118 00120 00121 const DtString& federateHost() const; 00122 void setFederateHost(const DtString& val); 00124 00126 00127 const DtString& rtiVersion() const; 00128 void setRtiVersion(const DtString& val); 00130 00132 00133 00134 const DtString& fedId() const; 00135 void setFedId(const DtString& val); 00137 00139 00140 bool timeConstrained() const; 00141 void setTimeConstrained(bool val); 00143 00145 00146 bool timeRegulating() const; 00147 void setTimeRegulating(bool val); 00149 00151 00152 bool asynchronousDelivery() const; 00153 void setAsynchronousDelivery(bool val); 00155 00156 #if DtHLA_1516 00157 00158 00159 DtFederateState federateState() const; 00160 void setFederateState(DtFederateState val); 00162 00164 00165 DtTimeState timeManagerState() const; 00166 void setTimeManagerState(DtTimeState val); 00168 #else 00169 00170 00171 const DtString& federateState() const; 00172 void setFederateState(const DtString& val); 00174 00176 00177 const DtString& timeManagerState() const; 00178 void setTimeManagerState(const DtString& val); 00180 #endif 00181 00183 00184 const DtString& federateTime() const; 00185 void setFederateTime(const DtString& val); 00187 00189 00190 const DtString& lookahead() const; 00191 void setLookahead(const DtString& val); 00193 00195 00196 00197 00198 const DtString& lbts() const; 00199 void setLbts(const DtString& val); 00201 00203 00204 00205 00206 const DtString& minNextEventTime() const; 00207 void setMinNextEventTime(const DtString& val); 00209 00211 00212 00213 00214 int roLength() const; 00215 void setRoLength(int val); 00217 00219 00220 00221 00222 int tsoLength() const; 00223 void setTsoLength(int val); 00225 00227 00228 int reflectionsReceived() const; 00229 void setReflectionsReceived(int val); 00231 00233 00234 int updatesSent() const; 00235 void setUpdatesSent(int val); 00237 00239 00240 int interactionsReceived() const; 00241 void setInteractionsReceived(int val); 00243 00245 00246 int interactionsSent() const; 00247 void setInteractionsSent(int val); 00249 00251 00252 int objectsOwned() const; 00253 void setObjectsOwned(int val); 00255 00257 00258 int objectsUpdated() const; 00259 void setObjectsUpdated(int val); 00261 00263 00264 int objectsReflected() const; 00265 void setObjectsReflected(int val); 00267 00268 #if DtHLA_1516 00269 00270 00271 int objectsDeleted() const; 00272 void setObjectsDeleted(int val); 00274 00276 00277 int objectsRemoved() const; 00278 void setObjectsRemoved(int val); 00280 00282 00283 int objectsRegistered() const; 00284 void setObjectsRegistered(int val); 00286 00288 00289 int objectsDiscovered() const; 00290 void setObjectsDiscovered(int val); 00292 00294 00295 00296 00297 00298 int timeGrantedTime() const; 00299 void setTimeGrantedTime(int val); 00301 00303 00304 00305 00306 00307 int timeAdvancingTime() const; 00308 void setTimeAdvancingTime(int val); 00310 #endif 00311 00312 protected: 00313 RTI::FederateHandle myFederateHandle; 00314 DtString myFederateType; 00315 DtString myFederateHost; 00316 #if DtHLA_1516 00317 bool myConveyRegionDesignatorSets; 00318 #endif 00319 #if DtHLA_1516_EVOLVED 00320 DtString myFederateName; 00321 bool myConveyProducingFederate; 00322 std::vector<DtString> myFomModules; 00323 #endif 00324 DtString myRtiVersion; 00325 DtString myFedId; 00326 bool myTimeConstrained; 00327 bool myTimeRegulating; 00328 bool myAsynchronousDelivery; 00329 #if DtHLA_1516 00330 DtFederateState myFederateState; 00331 DtTimeState myTimeManagerState; 00332 #else 00333 DtString myFederateState; 00334 DtString myTimeManagerState; 00335 #endif 00336 DtString myFederateTime; 00337 DtString myLookahead; 00338 DtString myLbts; 00339 DtString myMinNextEventTime; 00340 int myRoLength; 00341 int myTsoLength; 00342 int myReflectionsReceived; 00343 int myUpdatesSent; 00344 int myInteractionsReceived; 00345 int myInteractionsSent; 00346 int myObjectsOwned; 00347 int myObjectsUpdated; 00348 int myObjectsReflected; 00349 #if DtHLA_1516 00350 int myObjectsDeleted; 00351 int myObjectsRemoved; 00352 int myObjectsRegistered; 00353 int myObjectsDiscovered; 00354 int myTimeGrantedTime; 00355 int myTimeAdvancingTime; 00356 #endif 00357 }; 00358 00359 00360 00361 #endif 00362 #endif