Panda3D
pandatool
src
xfile
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
*/
17
INLINE WindowsGuid::
18
WindowsGuid() {
19
memset(
this
, 0,
sizeof
(
WindowsGuid
));
20
}
21
22
/**
23
*
24
*/
25
INLINE WindowsGuid::
26
WindowsGuid(
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
*/
48
INLINE WindowsGuid::
49
WindowsGuid(
const
WindowsGuid
©) {
50
(*this) = copy;
51
}
52
53
/**
54
*
55
*/
56
INLINE
void
WindowsGuid::
57
operator = (
const
WindowsGuid
©) {
58
memcpy(
this
, ©,
sizeof
(
WindowsGuid
));
59
}
60
61
/**
62
*
63
*/
64
INLINE
bool
WindowsGuid::
65
operator == (
const
WindowsGuid
&other)
const
{
66
return
compare_to
(other) == 0;
67
}
68
69
/**
70
*
71
*/
72
INLINE
bool
WindowsGuid::
73
operator != (
const
WindowsGuid
&other)
const
{
74
return
compare_to
(other) != 0;
75
}
76
77
/**
78
*
79
*/
80
INLINE
bool
WindowsGuid::
81
operator < (
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
*/
89
INLINE
int
WindowsGuid::
90
compare_to
(
const
WindowsGuid
&other)
const
{
91
return
memcmp(
this
, &other,
sizeof
(
WindowsGuid
));
92
}
93
94
INLINE std::ostream &
95
operator << (std::ostream &out,
const
WindowsGuid
&guid) {
96
guid.
output
(out);
97
return
out;
98
}
WindowsGuid::output
void output(std::ostream &out) const
Outputs a hex representation of the GUID.
Definition:
windowsGuid.cxx:74
WindowsGuid::compare_to
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
WindowsGuid
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
Definition:
windowsGuid.h:26
Generated on Sun Dec 27 2020 13:23:22 for Panda3D by
1.8.20