Panda3D
Loading...
Searching...
No Matches
windowsGuid.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file windowsGuid.I
10 * @author drose
11 * @date 2004-10-03
12 */
13
14/**
15 *
16 */
17INLINE WindowsGuid::
18WindowsGuid() {
19 memset(this, 0, sizeof(WindowsGuid));
20}
21
22/**
23 *
24 */
25INLINE WindowsGuid::
26WindowsGuid(unsigned long data1,
27 unsigned short data2, unsigned short data3,
28 unsigned char b1, unsigned char b2, unsigned char b3,
29 unsigned char b4, unsigned char b5, unsigned char b6,
30 unsigned char b7, unsigned char b8) :
31 _data1(data1),
32 _data2(data2),
33 _data3(data3),
34 _b1(b1),
35 _b2(b2),
36 _b3(b3),
37 _b4(b4),
38 _b5(b5),
39 _b6(b6),
40 _b7(b7),
41 _b8(b8)
42{
43}
44
45/**
46 *
47 */
48INLINE WindowsGuid::
49WindowsGuid(const WindowsGuid &copy) {
50 (*this) = copy;
51}
52
53/**
54 *
55 */
56INLINE void WindowsGuid::
57operator = (const WindowsGuid &copy) {
58 memcpy(this, &copy, sizeof(WindowsGuid));
59}
60
61/**
62 *
63 */
64INLINE bool WindowsGuid::
65operator == (const WindowsGuid &other) const {
66 return compare_to(other) == 0;
67}
68
69/**
70 *
71 */
72INLINE bool WindowsGuid::
73operator != (const WindowsGuid &other) const {
74 return compare_to(other) != 0;
75}
76
77/**
78 *
79 */
80INLINE bool WindowsGuid::
81operator < (const WindowsGuid &other) const {
82 return compare_to(other) < 0;
83}
84
85/**
86 * Returns a number less than zero if this WindowsGuid sorts before the other
87 * one, greater than zero if it sorts after, or zero if they are equivalent.
88 */
89INLINE int WindowsGuid::
90compare_to(const WindowsGuid &other) const {
91 return memcmp(this, &other, sizeof(WindowsGuid));
92}
93
94INLINE std::ostream &
95operator << (std::ostream &out, const WindowsGuid &guid) {
96 guid.output(out);
97 return out;
98}
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
Definition windowsGuid.h:26
void output(std::ostream &out) const
Outputs a hex representation of the GUID.
int compare_to(const WindowsGuid &other) const
Returns a number less than zero if this WindowsGuid sorts before the other one, greater than zero if ...
Definition windowsGuid.I:90