STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

comstl_interface_traits.h

Go to the documentation of this file.
00001 /* 
00002  * File:        comstl_interface_traits.h
00003  *
00004  * Purpose:     Interface traits.
00005  *
00006  * Created:     25th May 2002
00007  * Updated:     11th September 2004
00008  *
00009  * Home:        http://stlsoft.org/
00010  *
00011  * Copyright (c) 2002-2004, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without
00015  * modification, are permitted provided that the following conditions are met:
00016  *
00017  * - Redistributions of source code must retain the above copyright notice, this
00018  *   list of conditions and the following disclaimer.
00019  * - Redistributions in binary form must reproduce the above copyright notice,
00020  *   this list of conditions and the following disclaimer in the documentation
00021  *   and/or other materials provided with the distribution.
00022  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
00023  *   any contributors may be used to endorse or promote products derived from
00024  *   this software without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00027  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00030  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00031  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00032  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00033  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00034  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00035  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00036  * POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  * 
00039 
00040 
00044 
00045 #ifndef COMSTL_INCL_H_COMSTL_INTERFACE_TRAITS
00046 #define COMSTL_INCL_H_COMSTL_INTERFACE_TRAITS
00047 
00048 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00049 # define COMSTL_VER_H_COMSTL_INTERFACE_TRAITS_MAJOR     2
00050 # define COMSTL_VER_H_COMSTL_INTERFACE_TRAITS_MINOR     0
00051 # define COMSTL_VER_H_COMSTL_INTERFACE_TRAITS_REVISION  1
00052 # define COMSTL_VER_H_COMSTL_INTERFACE_TRAITS_EDIT      35
00053 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00054 
00055 /* 
00056  * Includes
00057  */
00058 
00059 #ifndef COMSTL_INCL_H_COMSTL
00060 # include "comstl.h"    // Include the COMSTL root header
00061 #endif /* !COMSTL_INCL_H_COMSTL */
00062 
00063 /* 
00064  * Namespace
00065  *
00066  * The COMSTL components are contained within the comstl namespace. This is
00067  * actually an alias for stlsoft::comstl_project,
00068  *
00069  * The definition matrix is as follows:
00070  *
00071  * _STLSOFT_NO_NAMESPACE    _COMSTL_NO_NAMESPACE    comstl definition
00072  * ---------------------    --------------------    -----------------
00073  *  not defined              not defined             = stlsoft::comstl_project
00074  *  not defined              defined                 not defined
00075  *  defined                  not defined             comstl
00076  *  defined                  defined                 not defined
00077  *
00078  */
00079 
00080 #ifndef _COMSTL_NO_NAMESPACE
00081 # if defined(_STLSOFT_NO_NAMESPACE) || \
00082      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00083 /* There is no stlsoft namespace, so must define ::comstl */
00084 namespace comstl
00085 {
00086 # else
00087 /* Define stlsoft::comstl_project */
00088 
00089 namespace stlsoft
00090 {
00091 
00092 namespace comstl_project
00093 {
00094 
00095 # endif /* _STLSOFT_NO_NAMESPACE */
00096 #endif /* !_COMSTL_NO_NAMESPACE */
00097 
00098 /* 
00099 
00104 
00105 /* 
00106  * Macros
00107  */
00108 
00109 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00110 
00111 #define COMSTL_IID_TRAITS_DEFINE__(I, T) \
00112   STLSOFT_TEMPLATE_SPECIALISATION \
00113 struct IID_traits<T> \
00114 { \
00115 public: \
00116     static REFIID   iid() { return IID_##I; } \
00117 };
00118 
00119 #define _COMSTL_IID_TRAITS_DEFINE(I)        COMSTL_IID_TRAITS_DEFINE__(I, I)
00120 
00121 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00122 
00123 /* 
00124  * Classes
00125  */
00126 
00127 #ifdef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00128 
00149 template <class I>
00150 struct IID_traits
00151 {
00152 public:
00154     static REFIID   iid();
00155 };
00156 #else
00157 
00158 #if !defined(_COMSTL_NO_UUIDOF) && \
00159     (   defined(__STLSOFT_COMPILER_IS_BORLAND) ||  \
00160         defined(__STLSOFT_COMPILER_IS_INTEL) ||  \
00161         defined(__STLSOFT_COMPILER_IS_MWERKS) ||  \
00162         (   defined(__STLSOFT_COMPILER_IS_MSVC) && \
00163             _MSC_VER >= 1200))
00164 template <class I>
00165 struct IID_traits
00166 {
00167 public:
00168     static REFIID   iid() { return __uuidof(I); }
00169 };
00170 
00171 #define COMSTL_IID_TRAITS_DEFINE(I)
00172 
00173 #else
00174 template <class I>
00175 struct IID_traits;
00176 
00177 #define COMSTL_IID_TRAITS_DEFINE(I)     EXTERN_C const IID IID_##I; \
00178                                         _COMSTL_IID_TRAITS_DEFINE(I) \
00179                                         COMSTL_IID_TRAITS_DEFINE__(I, I*)
00180 
00181 /* For backwards compatibility */
00182 #define comstl_IID_traits_define(I)     COMSTL_IID_TRAITS_DEFINE(I)
00183 
00184 #endif /* __STLSOFT_DOCUMENTATION_SKIP_SECTION */
00185 
00186 #ifndef _COMSTL_NO_NAMESPACE
00187 # if defined(_STLSOFT_NO_NAMESPACE) || \
00188      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00189 } // namespace comstl
00190 # else
00191 } // namespace comstl_project
00192 } // namespace stlsoft
00193 # endif /* _STLSOFT_NO_NAMESPACE */
00194 #endif /* !_COMSTL_NO_NAMESPACE */
00195 
00196 #include "comstl_interface_traits_std.h"
00197 
00198 #ifndef _COMSTL_NO_NAMESPACE
00199 # if defined(_STLSOFT_NO_NAMESPACE) || \
00200      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00201 /* There is no stlsoft namespace, so must define ::comstl */
00202 namespace comstl
00203 {
00204 # else
00205 /* Define stlsoft::comstl_project */
00206 
00207 namespace stlsoft
00208 {
00209 
00210 namespace comstl_project
00211 {
00212 
00213 # endif /* _STLSOFT_NO_NAMESPACE */
00214 #endif /* !_COMSTL_NO_NAMESPACE */
00215 
00216 #endif /* __SYNSOFT_DVS_COMPILER_VER_MSVC <
00217 __SYNSOFT_GEN_COMPILER_VERSION(5, 0) */
00218 
00219 /* 
00220 
00222 
00223 /* 
00224 
00225 #ifndef _COMSTL_NO_NAMESPACE
00226 # if defined(_STLSOFT_NO_NAMESPACE) || \
00227      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00228 } // namespace comstl
00229 # else
00230 } // namespace comstl_project
00231 } // namespace stlsoft
00232 # endif /* _STLSOFT_NO_NAMESPACE */
00233 #endif /* !_COMSTL_NO_NAMESPACE */
00234 
00235 /* 
00236 
00237 #endif /* !COMSTL_INCL_H_COMSTL_INTERFACE_TRAITS */
00238 
00239 /* 

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004