![]() |
VR-Link API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00009 00010 #ifndef _objectId_h_ 00011 #define _objectId_h_ 00012 00013 00014 00015 #include <vlpi/NetStructs.h> 00016 #include "rtiNamespace.h" 00017 00018 00019 #if (DtDIS || DtTENA) 00020 00021 #include "hostStructs.h" 00022 typedef DtEntityIdentifier DtObjectId; 00023 typedef DtNetEntityIdentifier DtNetObjectId; 00024 00025 #elif DtHLA 00026 00027 typedef DtNetU32 DtNetObjectId; 00028 00029 00040 class DT_DLL_VL DtObjectId 00041 { 00042 public: 00043 00047 DtObjectId(); 00048 00049 #if DtHLA_1516 00050 DtObjectId(RTI::ObjectInstanceHandle id); 00051 #else 00052 DtObjectId(RTI::ObjectHandle id); 00053 00056 DtObjectId(const char* str); 00057 00059 DtObjectId(const DtNetObjectId &netId); 00060 00061 #endif 00062 DtObjectId(const DtObjectId& orig); 00063 DtObjectId& operator=(const DtObjectId& orig); 00064 00066 int operator==(const DtObjectId& orig) const; 00067 int operator!=(const DtObjectId& orig) const; 00068 bool operator<(const DtObjectId& orig) const; 00069 00070 #if DtHLA_1516 00071 operator RTI::ObjectInstanceHandle() const; 00072 #else 00073 operator RTI::ObjectHandle() const; 00074 #endif 00075 00076 #if DtHLA_1516 00077 00080 virtual void makePlaceholder(); 00081 00083 virtual bool valid() const; 00084 00088 virtual int invalidId() const; 00089 #endif 00090 00091 const char *string() const; 00092 00093 static const DtObjectId& nullId(); 00094 static const DtObjectId& defaultId(); 00095 00096 00097 protected: 00098 00099 #if DtHLA_1516 00100 RTI::ObjectInstanceHandle myId; 00101 int myValidityFlag; 00102 #else 00103 RTI::ObjectHandle myId; 00104 #endif 00105 00106 00107 protected: 00108 #if DtHLA_1516 00109 static int nextPlaceholderNumber; 00110 #endif 00111 00112 private: 00113 00115 mutable DtString myMutableStringRep; 00116 00117 }; 00118 #endif 00119 00120 #endif 00121