Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

hyp.ker.guid.h

00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Hyperion Pattern.
00004  Hyperion Pattern is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
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
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: pierre_rebours@yahoo.com
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00025 */
00026 
00027 #if !defined(_hyp_guid_h_)
00028 #define _hyp_guid_h_
00029 
00030 #ifndef hyp_KERNEL_CORE_INSIDE
00031 #error Inclusion not allowed (include hyp.kernel.core.h instead)
00032 #endif
00033 
00034 
00035 #undef hyp_DEFINE_GUID
00036 
00042 #define hyp_DEFINE_GUID( Name , Data1 , Data2 , Data3 ,\
00043         Data4_0 , Data4_1 , Data4_2 , Data4_3 , Data4_4 , Data4_5 , Data4_6 , Data4_7) \
00044 extern "C" const hyp_ADD_NAMESPACE_HYPKERNEL(CGuid) Name
00045 
00046 #define hyp_DEFINE_IID hyp_DEFINE_GUID
00047 #define hyp_DEFINE_CLSID hyp_DEFINE_GUID
00048 
00049 
00050 class hyp_ker_DLL CGuid
00051 {
00053         struct _guid
00054         {
00055                 t_ulong Data1;
00056                 t_ushort Data2;
00057                 t_ushort Data3;
00058                 t_uchar Data4[8];
00059         } m_Guid;
00060         
00061 
00062 public:
00063         CGuid(t_ulong,
00064                 t_ushort,t_ushort,
00065                 t_uchar,t_uchar,t_uchar,t_uchar,t_uchar,t_uchar,t_uchar,t_uchar);
00066         CGuid();
00067         CGuid(const std::string&);
00068 
00069         inline CGuid& operator=(const CGuid& Guid) {
00070                 memcpy(&m_Guid,&Guid.m_Guid,sizeof(m_Guid));
00071                 return *this;
00072         }
00073 
00074         inline bool operator==(const CGuid& Guid) const {
00075                 return memcmp(&m_Guid,&Guid.m_Guid,sizeof(m_Guid))==0 ? true : false;
00076         }
00077 
00078         inline bool operator!=(const CGuid& Guid) const {
00079                 return !(*this==Guid);
00080         }       
00081         
00082         std::string ToString(void) const;
00083 };
00084 
00085 inline std::ostream& operator<<(std::ostream& Stream,const CGuid& GUID) {
00086         Stream<<GUID.ToString();
00087         return Stream;
00088 }
00089 
00095 typedef CGuid hypCLSID;
00096 typedef CGuid hypIID;
00097 typedef CGuid hypGUID;
00099 
00100 
00101 #endif

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.