Panda3D
|
00001 // Filename: windowsGuid.I 00002 // Created by: drose (03Oct04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: WindowsGuid::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE WindowsGuid:: 00022 WindowsGuid() { 00023 memset(this, 0, sizeof(WindowsGuid)); 00024 } 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: WindowsGuid::Constructor 00028 // Access: Public 00029 // Description: 00030 //////////////////////////////////////////////////////////////////// 00031 INLINE WindowsGuid:: 00032 WindowsGuid(unsigned long data1, 00033 unsigned short data2, unsigned short data3, 00034 unsigned char b1, unsigned char b2, unsigned char b3, 00035 unsigned char b4, unsigned char b5, unsigned char b6, 00036 unsigned char b7, unsigned char b8) : 00037 _data1(data1), 00038 _data2(data2), 00039 _data3(data3), 00040 _b1(b1), 00041 _b2(b2), 00042 _b3(b3), 00043 _b4(b4), 00044 _b5(b5), 00045 _b6(b6), 00046 _b7(b7), 00047 _b8(b8) 00048 { 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function: WindowsGuid::Copy Constructor 00053 // Access: Public 00054 // Description: 00055 //////////////////////////////////////////////////////////////////// 00056 INLINE WindowsGuid:: 00057 WindowsGuid(const WindowsGuid ©) { 00058 (*this) = copy; 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: WindowsGuid::Copy Assignment Operator 00063 // Access: Public 00064 // Description: 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void WindowsGuid:: 00067 operator = (const WindowsGuid ©) { 00068 memcpy(this, ©, sizeof(WindowsGuid)); 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: WindowsGuid::operator == 00073 // Access: Published 00074 // Description: 00075 //////////////////////////////////////////////////////////////////// 00076 INLINE bool WindowsGuid:: 00077 operator == (const WindowsGuid &other) const { 00078 return compare_to(other) == 0; 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function: WindowsGuid::operator != 00083 // Access: Published 00084 // Description: 00085 //////////////////////////////////////////////////////////////////// 00086 INLINE bool WindowsGuid:: 00087 operator != (const WindowsGuid &other) const { 00088 return compare_to(other) != 0; 00089 } 00090 00091 //////////////////////////////////////////////////////////////////// 00092 // Function: WindowsGuid::operator < 00093 // Access: Published 00094 // Description: 00095 //////////////////////////////////////////////////////////////////// 00096 INLINE bool WindowsGuid:: 00097 operator < (const WindowsGuid &other) const { 00098 return compare_to(other) < 0; 00099 } 00100 00101 //////////////////////////////////////////////////////////////////// 00102 // Function: WindowsGuid::compare_to 00103 // Access: Published 00104 // Description: Returns a number less than zero if this WindowsGuid 00105 // sorts before the other one, greater than zero if it 00106 // sorts after, or zero if they are equivalent. 00107 //////////////////////////////////////////////////////////////////// 00108 INLINE int WindowsGuid:: 00109 compare_to(const WindowsGuid &other) const { 00110 return memcmp(this, &other, sizeof(WindowsGuid)); 00111 } 00112 00113 INLINE ostream & 00114 operator << (ostream &out, const WindowsGuid &guid) { 00115 guid.output(out); 00116 return out; 00117 } 00118