![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 //File baseTypes.hh 00002 //Included in RTI.hh 00003 00004 #ifndef NULL 00005 #define NULL (0) 00006 #endif 00007 00008 typedef unsigned short UShort; 00009 typedef short Short; 00010 #if defined(__alpha) || (defined(__sgi) && _MIPS_SZLONG == 64) || (defined(__sparcv9)) || (defined(__x86_64)) 00011 typedef unsigned int ULong; 00012 typedef int Long; 00013 #else 00014 typedef unsigned long ULong; 00015 typedef long Long; 00016 #endif 00017 typedef double Double; 00018 typedef float Float; 00019 00020 enum Boolean { 00021 RTI_FALSE = 0, 00022 RTI_TRUE}; 00023 00024 class RTI_EXPORT Exception { 00025 public: 00026 ULong _serial; 00027 char *_reason; 00028 const char *_name; 00029 Exception (const char *reason); 00030 Exception (ULong serial, const char *reason=NULL); 00031 Exception (const Exception &toCopy); 00032 virtual ~Exception (); 00033 Exception & operator = (const Exception &); 00034 // 00035 // Added for RTI 1.3 NG to workaround a Sun 4.2 C++ compiler bug. 00036 // These are used internally to pass exceptions between threads. 00037 // 00038 virtual Exception * cloneSelf() const throw() = 0; 00039 virtual void throwSelf() const = 0; 00040 }; 00041 00042 #define RTI_EXCEPT(A) \ 00043 class A : public Exception { \ 00044 public: \ 00045 static RTI_EXPORT const char *_ex; \ 00046 A (const char *reason) : Exception (reason) { _name = _ex; } \ 00047 A (ULong serial, const char *reason=NULL) \ 00048 : Exception (serial, reason) { _name = _ex; } \ 00049 A (A const & toCopy) : Exception(toCopy) { _name = _ex; } \ 00050 Exception * cloneSelf() const throw() { return (new A(_reason)); } \ 00051 void throwSelf() const { throw *this; } \ 00052 }; 00053 00054 00055 00056