WvStreams
uuid.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  *
3  * XPLC - Cross-Platform Lightweight Components
4  * Copyright (C) 2000-2003, Pierre Phaneuf
5  * Copyright (C) 2002, Net Integration Technologies, Inc.
6  * Copyright (C) 2004, Stéphane Lajoie
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21  * USA
22  */
23 
24 #ifndef __XPLC_UUID_H__
25 #define __XPLC_UUID_H__
26 
27 #if defined(__GNUC__) && __GNUC__ > 3
28 # pragma GCC system_header
29 #endif
30 
79 #if defined WIN32 || defined SOLARIS
80 typedef unsigned long u_int32_t;
81 typedef unsigned short u_int16_t;
82 typedef unsigned char u_int8_t;
83 #else
84 #include <sys/types.h>
85 #endif
86 
88 #ifndef GUID_DEFINED
89 #define GUID_DEFINED
90 
94 typedef struct _GUID {
96  u_int32_t Data1;
97  u_int16_t Data2;
98  u_int16_t Data3;
99  u_int8_t Data4[8];
101 } GUID;
102 #endif
103 
104 #ifndef UUID_DEFINED
105 #define UUID_DEFINED
106 typedef GUID UUID;
107 #ifndef uuid_t
108 #define uuid_t UUID
109 #endif
110 #endif
111 
112 
114 static const UUID UUID_null = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
115 
127 template<class T>
128 struct XPLC_IID {
129 };
130 
134 #define DEFINE_IID(iface, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11) \
135 static const UUID iface##_IID = u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11; \
136 template <> \
137 struct XPLC_IID<iface> { \
138  static const UUID& get() { \
139  return iface##_IID; \
140  } \
141 }
142 
143 #endif /* __XPLC_UUID_H__ */
XPLC_IID
Definition: uuid.h:128
_GUID
The structure underlying UUIDs.
Definition: uuid.h:94
GUID
struct _GUID GUID
The structure underlying UUIDs.