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 namespace P6R {
15 
19  inline P6R::P6BOOL operator==(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
20  {
21  return (uuid1.timeLow==uuid2.timeLow && \
22  uuid1.timeMid==uuid2.timeMid && \
23  uuid1.timeHighVer==uuid2.timeHighVer && \
24  uuid1.clockNode[0]==uuid2.clockNode[0] && \
25  uuid1.clockNode[1]==uuid2.clockNode[1] && \
26  uuid1.clockNode[2]==uuid2.clockNode[2] && \
27  uuid1.clockNode[3]==uuid2.clockNode[3] && \
28  uuid1.clockNode[4]==uuid2.clockNode[4] && \
29  uuid1.clockNode[5]==uuid2.clockNode[5] && \
30  uuid1.clockNode[6]==uuid2.clockNode[6] && \
31  uuid1.clockNode[7]==uuid2.clockNode[7]);
32  }
33 
34  inline P6R::P6BOOL operator!=(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
35  {
36  return !(uuid1==uuid2);
37  }
38 
39  inline P6R::P6BOOL operator<(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
40  {
41  P6R::P6INT32 result = 0;
42  P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
43  P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
44  P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
45 
46  if(!p1 || !p2)
47  return P6FALSE;
48 
49  while(nBytes--) {
50  if(*p1 != *p2) {
51  if(*p1 > *p2) result = 1;
52  else result = -1;
53  break;
54  }
55  p1++;
56  p2++;
57  }
58  return (result < 0);
59  }
60 
61  inline P6R::P6BOOL operator>(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
62  {
63  P6R::P6INT32 result = 0;
64  P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
65  P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
66  P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
67 
68  if(!p1 || !p2)
69  return P6FALSE;
70 
71  while(nBytes--) {
72  if(*p1 != *p2) {
73  if(*p1 > *p2) result = 1;
74  else result = -1;
75  break;
76  }
77  p1++;
78  p2++;
79  }
80  return (result > 0);
81  }
82 
83 
84 #ifdef __cplusplus
85 extern "C" {
86 #endif
87 
96  interface p6ICom
97  {
120  P6COMMETHOD queryInterface(const P6R::IID &iid,P6R::P6VOID **ppIface) = 0;
121 
134 
146  };
147  // {00000000-0000-0000-c000-000000000046}
148  #define IF_p6ICom {0x00000000,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 
155 
156 } // namespace
157 
158 
159 #endif
160 
161 
162 
size_t P6SIZE
Definition: p6types.h:62
P6R::P6BOOL operator<(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:39
P6R::P6UINT8 clockNode[8]
(1*octet) clock_seq_and_reserved, (1*octet) clock_seq_low, (6*octet) node
Definition: p6types.h:135
P6R::P6BOOL operator>(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:61
virtual P6R::P6INT32 release()=0
This method decrements a components reference count.
Standard error codes.
bool P6BOOL
Boolean type.
Definition: p6types.h:101
virtual P6R::P6ERR queryInterface(const P6R::IID &iid, P6R::P6VOID **ppIface)=0
This method queries the component for a specific interface.
P6R::P6UINT16 timeHighVer
(2*octet) time_high_and_version
Definition: p6types.h:134
int P6INT32
Definition: p6types.h:41
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
A universally unique indentifier (UUID).
Definition: p6types.h:131
virtual P6R::P6INT32 addref()=0
This method increases the reference count of the component instance by one.
#define P6COMMETHOD_(type)
Definition: p6types.h:873
P6R::P6UINT16 timeMid
(2*octet) time_mid
Definition: p6types.h:133
P6R::P6UINT32 timeLow
(4*octet) time_low
Definition: p6types.h:132
#define P6COMMETHOD
Definition: p6types.h:872
P6R::P6BOOL operator!=(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Definition: p6comdef.h:34
P6R::P6BOOL operator==(const P6R::P6UUID &uuid1, const P6R::P6UUID &uuid2)
Global comparison operator for UUIDs.
Definition: p6comdef.h:19
void P6VOID
Definition: p6types.h:75
char P6CHAR
Narrow character type.
Definition: p6types.h:71
#define P6FALSE
Definition: p6types.h:103