Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6comdef.h
Go to the documentation of this file.
1 
9 #ifndef P6COMDEF_H__
10 #define P6COMDEF_H__ 1
11 
12 #include "p6err.h"
13 
14 #ifdef __cplusplus
15 namespace P6R {
16 
20  inline P6R::P6BOOL operator==(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
21  {
22  return (uuid1.timeLow==uuid2.timeLow && \
23  uuid1.timeMid==uuid2.timeMid && \
24  uuid1.timeHighVer==uuid2.timeHighVer && \
25  uuid1.clockNode[0]==uuid2.clockNode[0] && \
26  uuid1.clockNode[1]==uuid2.clockNode[1] && \
27  uuid1.clockNode[2]==uuid2.clockNode[2] && \
28  uuid1.clockNode[3]==uuid2.clockNode[3] && \
29  uuid1.clockNode[4]==uuid2.clockNode[4] && \
30  uuid1.clockNode[5]==uuid2.clockNode[5] && \
31  uuid1.clockNode[6]==uuid2.clockNode[6] && \
32  uuid1.clockNode[7]==uuid2.clockNode[7]);
33  }
34 
35  inline P6R::P6BOOL operator!=(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
36  {
37  return !(uuid1==uuid2);
38  }
39 
40  inline P6R::P6BOOL operator<(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
41  {
42  P6R::P6INT32 result = 0;
43  P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
44  P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
45  P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
46 
47  if(!p1 || !p2)
48  return P6FALSE;
49 
50  while(nBytes--) {
51  if(*p1 != *p2) {
52  if(*p1 > *p2) result = 1;
53  else result = -1;
54  break;
55  }
56  p1++;
57  p2++;
58  }
59  return (result < 0);
60  }
61 
62  inline P6R::P6BOOL operator>(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
63  {
64  P6R::P6INT32 result = 0;
65  P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
66  P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
67  P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
68 
69  if(!p1 || !p2)
70  return P6FALSE;
71 
72  while(nBytes--) {
73  if(*p1 != *p2) {
74  if(*p1 > *p2) result = 1;
75  else result = -1;
76  break;
77  }
78  p1++;
79  p2++;
80  }
81  return (result > 0);
82  }
83 
84 extern "C" {
85 #endif // __cplusplus
86 
95 #undef INTERFACE
96 #define INTERFACE p6ICom
98  {
121  P6DECLCOMMETHOD(queryInterface)(P6THIS_ const P6REFIID iid,P6VOID **ppIface) P6PURE;
122 
135 
147  };
148  // {00000000-0000-0000-c000-000000000046}
149  #define IF_p6ICom {0x00000000,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}
150 
151 #ifdef __cplusplus
152 } // extern "C"
153 } // namespace
154 #endif
155 
156 
157 
158 
159 
160 #endif
161 
162 
163 
size_t P6SIZE
Definition: p6types.h:90
P6R::P6BOOL operator<(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:40
#define P6DECLAREIF(iface)
Definition: p6defs.h:187
P6R::P6BOOL operator>(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:62
#define P6REFIID
Definition: p6defs.h:197
#define P6PURE
Definition: p6defs.h:192
Standard error codes.
P6UINT32 timeLow
(4*octet) time_low
Definition: p6types.h:163
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:133
P6UINT8 clockNode[8]
(1*octet) clock_seq_and_reserved, (1*octet) clock_seq_low, (6*octet) node
Definition: p6types.h:166
P6UINT16 timeMid
(2*octet) time_mid
Definition: p6types.h:164
#define P6DECLCOMMETHOD_(type, method)
Definition: p6defs.h:190
P6UINT16 timeHighVer
(2*octet) time_high_and_version
Definition: p6types.h:165
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
A universally unique indentifier (UUID).
Definition: p6types.h:162
P6R::P6BOOL operator!=(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:35
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
P6R::P6BOOL operator==(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Global comparison operator for UUIDs.
Definition: p6comdef.h:20
#define P6THIS_
Definition: p6defs.h:193
void P6VOID
Definition: p6types.h:109
int32_t P6INT32
Definition: p6types.h:76
#define P6THIS
Definition: p6defs.h:194
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6FALSE
Definition: p6types.h:135