![]() |
VR-Link API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 #ifndef entityIdentifier_H_ 00007 #define entityIdentifier_H_ 00008 00009 #include <vlutil/vlMachineTypes.h> 00010 #include "NetStructs.h" 00011 #include "disEnums.h" 00012 #include "simulationAddress.h" 00013 #include <string> 00014 00021 00024 const DtU16 DtDeferedEntityId = ((1<<16)-1); 00025 00026 const DtU16 DtDeferredEntityId = ((1<<16)-1); 00027 00035 class DT_DLL_VLPROTIND DtEntityIdentifier 00036 { 00037 public: 00039 DtEntityIdentifier(const char* str); 00040 00042 DtEntityIdentifier(int site, int host, DtU16 entityNum); 00043 00045 DtEntityIdentifier(const DtSimulationAddress& simulationAddress, 00046 DtU16 entityNum); 00047 00049 DtEntityIdentifier(const DtEntityIdentifier& orig); 00050 00052 const DtEntityIdentifier& operator=(const DtEntityIdentifier& orig); 00053 00055 DtEntityIdentifier(const DtNetEntityIdentifier& netId); 00056 00058 DtEntityIdentifier(); 00059 00061 void init(int site, int host, DtU16 entityNum); 00062 00063 00067 inline int operator==(const DtEntityIdentifier &other) const; 00068 inline int operator!=(const DtEntityIdentifier &other) const; 00069 inline operator DtNetEntityIdentifier () const; 00070 00084 bool operator<( const DtEntityIdentifier &rightOperand ) const; 00085 00087 inline void setFromNet(const DtNetEntityIdentifier &netId); 00088 00090 inline void setSite(int site); 00091 00093 inline int site() const ; 00094 00096 inline void setHost(int host); 00097 00099 inline int host() const; 00100 00102 inline void setEntityNum(DtU16 entityNum); 00103 00105 inline DtU16 entityNum() const; 00106 00108 inline void setSimulationAddress( const DtSimulationAddress& simulationAddress); 00109 00111 inline const DtSimulationAddress& simulationAddress() const; 00112 00114 bool sameHost(const DtEntityIdentifier &other) const; 00115 00117 bool sameEntity(const DtEntityIdentifier &other) const; 00118 00120 bool matchPattern(const DtEntityIdentifier &pat) const; 00121 00122 00124 const char *string() const; 00125 00126 public: 00127 00129 static const DtEntityIdentifier& nullId(); 00130 00132 static const DtEntityIdentifier& defaultId(); 00133 00134 public: 00135 00138 DtSimulationAddress DtSimulator; 00139 00142 DtU16 DtEntity; 00143 00144 protected: 00150 mutable std::string myMutableStringRep; 00151 }; 00152 00153 DT_DLL_VLPROTIND std::ostream& operator<< (std::ostream& stream, const DtEntityIdentifier& object); 00154 00155 #define entityIdentifier_inl 00156 #include "entityIdentifier.inl" 00157 #undef entityIdentifier_inl 00158 00159 #endif 00160