WvStreams
uuid.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * XPLC - Cross-Platform Lightweight Components
00004  * Copyright (C) 2000-2003, Pierre Phaneuf
00005  * Copyright (C) 2002, Net Integration Technologies, Inc.
00006  * Copyright (C) 2004, Stéphane Lajoie
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  */
00023 
00024 #ifndef __XPLC_UUID_H__
00025 #define __XPLC_UUID_H__
00026 
00027 #if defined(__GNUC__) && __GNUC__ > 3
00028 # pragma GCC system_header
00029 #endif
00030 
00079 #ifdef WIN32
00080 typedef unsigned long u_int32_t;
00081 typedef unsigned short u_int16_t;
00082 typedef unsigned char u_int8_t;
00083 #else
00084 #include <sys/types.h>
00085 #endif
00086 
00088 #ifndef GUID_DEFINED
00089 #define GUID_DEFINED
00090 
00094 typedef struct _GUID {
00096   u_int32_t Data1;
00097   u_int16_t Data2;
00098   u_int16_t Data3;
00099   u_int8_t Data4[8];
00101 } GUID;
00102 #endif
00103 
00104 #ifndef UUID_DEFINED
00105 #define UUID_DEFINED
00106 typedef GUID UUID;
00107 #ifndef uuid_t
00108 #define uuid_t UUID
00109 #endif
00110 #endif
00111 
00112 
00114 static const UUID UUID_null = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
00115 
00127 template<class T>
00128 struct XPLC_IID {
00129 };
00130 
00134 #define DEFINE_IID(iface, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11) \
00135 static const UUID iface##_IID = u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11; \
00136 template <> \
00137 struct XPLC_IID<iface> { \
00138   static const UUID& get() { \
00139     return iface##_IID; \
00140   } \
00141 }
00142 
00143 #endif /* __XPLC_UUID_H__ */