00001
00009 #ifndef P6COMDEF_H__
00010 #define P6COMDEF_H__ 1
00011
00012 #include "p6err.h"
00013
00014 namespace P6R {
00015
00019 inline P6R::P6BOOL operator==(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
00020 {
00021 return (uuid1.timeLow==uuid2.timeLow && \
00022 uuid1.timeMid==uuid2.timeMid && \
00023 uuid1.timeHighVer==uuid2.timeHighVer && \
00024 uuid1.clockNode[0]==uuid2.clockNode[0] && \
00025 uuid1.clockNode[1]==uuid2.clockNode[1] && \
00026 uuid1.clockNode[2]==uuid2.clockNode[2] && \
00027 uuid1.clockNode[3]==uuid2.clockNode[3] && \
00028 uuid1.clockNode[4]==uuid2.clockNode[4] && \
00029 uuid1.clockNode[5]==uuid2.clockNode[5] && \
00030 uuid1.clockNode[6]==uuid2.clockNode[6] && \
00031 uuid1.clockNode[7]==uuid2.clockNode[7]);
00032 }
00033
00034 inline P6R::P6BOOL operator!=(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
00035 {
00036 return !(uuid1==uuid2);
00037 }
00038
00039 inline P6R::P6BOOL operator<(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
00040 {
00041 P6R::P6INT32 result = 0;
00042 P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
00043 P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
00044 P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
00045
00046 if(!p1 || !p2)
00047 return P6FALSE;
00048
00049 while(nBytes--) {
00050 if(*p1 != *p2) {
00051 if(*p1 > *p2) result = 1;
00052 else result = -1;
00053 break;
00054 }
00055 p1++;
00056 p2++;
00057 }
00058 return (result < 0);
00059 }
00060
00061 inline P6R::P6BOOL operator>(const P6R::P6UUID &uuid1,const P6R::P6UUID &uuid2)
00062 {
00063 P6R::P6INT32 result = 0;
00064 P6R::P6SIZE nBytes = sizeof(P6R::P6UUID);
00065 P6R::P6CHAR *p1 = (P6CHAR*) &uuid1;
00066 P6R::P6CHAR *p2 = (P6CHAR*) &uuid2;
00067
00068 if(!p1 || !p2)
00069 return P6FALSE;
00070
00071 while(nBytes--) {
00072 if(*p1 != *p2) {
00073 if(*p1 > *p2) result = 1;
00074 else result = -1;
00075 break;
00076 }
00077 p1++;
00078 p2++;
00079 }
00080 return (result > 0);
00081 }
00082
00083
00084 #ifdef __cplusplus
00085 extern "C" {
00086 #endif
00087
00096 interface p6ICom
00097 {
00120 P6COMMETHOD queryInterface(const P6R::IID &iid,P6R::P6VOID **ppIface) = 0;
00121
00133 P6COMMETHOD_(P6R::P6INT32) addref() = 0;
00134
00145 P6COMMETHOD_(P6R::P6INT32) release() = 0;
00146 };
00147
00148 #define IF_p6ICom {0x00000000,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}
00149
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153
00154
00155
00156 }
00157
00158
00159 #endif
00160
00161
00162