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  

mfcstl.h

Go to the documentation of this file.
00001 /* 
00002  * File:        mfcstl.h
00003  *
00004  * Purpose:     Root header for the MFCSTL libraries. Performs various compiler
00005  *              and platform discriminations, and definitions of types.
00006  *
00007  * Created:     15th January 2002
00008  * Updated:     11th September 2004
00009  *
00010  * Home:        http://stlsoft.org/
00011  *
00012  * Copyright (c) 2002-2004, Matthew Wilson and Synesis Software
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions are met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice, this
00019  *   list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright notice,
00021  *   this list of conditions and the following disclaimer in the documentation
00022  *   and/or other materials provided with the distribution.
00023  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
00024  *   any contributors may be used to endorse or promote products derived from
00025  *   this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00028  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00031  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00032  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00033  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00035  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00036  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00037  * POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * 
00040 
00041 
00042 #ifndef MFCSTL_INCL_H_MFCSTL
00043 #define MFCSTL_INCL_H_MFCSTL
00044 
00045 /* File version */
00046 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00047 # define MFCSTL_VER_H_MFCSTL_MAJOR      2
00048 # define MFCSTL_VER_H_MFCSTL_MINOR      0
00049 # define MFCSTL_VER_H_MFCSTL_REVISION   1
00050 # define MFCSTL_VER_H_MFCSTL_EDIT       60
00051 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00052 
00096 /* 
00097  * MFCSTL version
00098  *
00099  * The libraries version information is comprised of major, minor and revision
00100  * components.
00101  *
00102  * The major version is denoted by the _MFCSTL_VER_MAJOR preprocessor symbol.
00103  * A changes to the major version component implies that a dramatic change has
00104  * occurred in the libraries, such that considerable changes to source dependent
00105  * on previous versions would need to be effected.
00106  *
00107  * The minor version is denoted by the _MFCSTL_VER_MINOR preprocessor symbol.
00108  * Changes to the minor version component imply that a significant change has
00109  * occurred to the libraries, either in the addition of new functionality or in
00110  * the destructive change to one or more components such that recomplilation and
00111  * code change may be necessitated.
00112  *
00113  * The revision version is denoted by the _MFCSTL_VER_REVISIO preprocessor
00114  * symbol. Changes to the revision version component imply that a bug has been
00115  * fixed. Dependent code should be recompiled in order to pick up the changes.
00116  *
00117  * In addition to the individual version symbols - _MFCSTL_VER_MAJOR,
00118  * _MFCSTL_VER_MINOR and _MFCSTL_VER_REVISION - a composite symbol _MFCSTL_VER
00119  * is defined, where the upper 8 bits are 0, bits 16-23 represent the major
00120  * component,  bits 8-15 represent the minor component, and bits 0-7 represent
00121  * the revision component.
00122  *
00123  * Each release of the libraries will bear a different version, and that version
00124  * will also have its own symbol: Version 1.0.1 specifies _MFCSTL_VER_1_0_1.
00125  *
00126  * Thus the symbol _MFCSTL_VER may be compared meaningfully with a specific
00127  * version symbol, e.g. #if _MFCSTL_VER >= _MFCSTL_VER_1_0_1
00128  */
00129 
00132 
00135 
00138 
00141 
00142 #define _MFCSTL_VER_MAJOR       1
00143 #define _MFCSTL_VER_MINOR       3
00144 #define _MFCSTL_VER_REVISION    5
00145 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00146 # define _MFCSTL_VER_1_0_1      0x00010001  
00147 # define _MFCSTL_VER_1_1_1      0x00010101  
00148 # define _MFCSTL_VER_1_2_1      0x00010201  
00149 # define _MFCSTL_VER_1_2_2      0x00010202  
00150 # define _MFCSTL_VER_1_2_3      0x00010203  
00151 # define _MFCSTL_VER_1_3_1      0x00010301  
00152 # define _MFCSTL_VER_1_3_2      0x00010302  
00153 # define _MFCSTL_VER_1_3_3      0x00010303  
00154 # define _MFCSTL_VER_1_3_4      0x00010304  
00155 # define _MFCSTL_VER_1_3_5      0x00010305  
00156 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00157 
00158 #define _MFCSTL_VER             _MFCSTL_VER_1_3_5
00159 
00160 /* 
00161  * Includes
00162  */
00163 
00164 #ifndef STLSOFT_INCL_H_STLSOFT
00165 # include "stlsoft.h"   // STLSoft root header
00166 #endif /* !STLSOFT_INCL_H_STLSOFT */
00167 
00168 #if defined(__STLSOFT_COMPILER_IS_BORLAND)
00169 # pragma warn -8022 /* Suppresses "'f()' hides virtual function 'g()'" */
00170 # pragma warn -8084 /* Suppresses "Suggest parentheses to clarify precedence in function 'f()'" */
00171 #endif /* compiler */
00172 
00173 #include <afx.h>        // MFC base header
00174 
00175 #if defined(__STLSOFT_COMPILER_IS_BORLAND)
00176 # pragma warn .8022 /* Suppresses "'f()' hides virtual function 'g()'" */
00177 # pragma warn .8084 /* Suppresses "Suggest parentheses to clarify precedence in function 'f()'" */
00178 #endif /* compiler */
00179 
00180 /* 
00181  * STLSoft version compatibility
00182  */
00183 
00184 #if !defined(_STLSOFT_VER_1_5_1) || \
00185     _STLSOFT_VER < _STLSOFT_VER_1_5_1
00186 # error This version of the MFCSTL libraries requires STLSoft version 1.5.1 or later
00187 #endif /* _STLSOFT_VER < _STLSOFT_VER_1_5_1 */
00188 
00189 /* 
00190  * Compiler compatibility
00191  *
00192  * Currently the only compilers supported by the MFCSTL libraries are
00193  *
00194  * Borland C++ 5.5, 5.51, 5.6
00195  * Digital Mars C/C++ 8.26 - 8.32
00196  * Metrowerks 2.4 & 3.0 (CodeWarrior 7.0 & 8.0)
00197  * Intel C/C++ 6.0
00198  * Visual C++ 4.2, 5.0, 6.0, 7.0
00199  */
00200 
00201 #if defined(__STLSOFT_COMPILER_IS_BORLAND)
00202 /* Borland C++ */
00203 # if __BORLANDC__ < 0x0550
00204 #  error Versions of Borland C++ prior to 5.5 are not supported by the MFCSTL libraries
00205 # endif /* __BORLANDC__ */
00206 
00207 #elif defined(__STLSOFT_COMPILER_IS_DMC)
00208 /* Digital Mars C/C++ */
00209 # if __DMC__ < 0x0826
00210 #  error Versions of Digital Mars C/C++ prior to 8.26 are not supported by the MFCSTL libraries
00211 # endif /* __DMC__ */
00212 
00213 #elif defined(__STLSOFT_COMPILER_IS_INTEL)
00214 /* Intel C++ */
00215 # if (__INTEL_COMPILER < 600)
00216 #  error Versions of Intel C++ prior to 6.0 are not supported by the MFCSTL libraries
00217 # endif /* __INTEL_COMPILER */
00218 
00219 #elif defined(__STLSOFT_COMPILER_IS_MWERKS)
00220 /* Metrowerks C++ */
00221 # if (__MWERKS__ & 0xFF00) < 0x2400
00222 #  error Versions of Metrowerks CodeWarrior C++ prior to 7.0 are not supported by the MFCSTL libraries
00223 # endif /* __MWERKS__ */
00224 
00225 #elif defined(__STLSOFT_COMPILER_IS_MSVC)
00226 /* Visual C++ */
00227 # if _MSC_VER < 1020
00228 #  error Versions of Visual C++ prior to 4.2 are not supported by the MFCSTL libraries
00229 # endif /* _MSC_VER */
00230 
00231 #else
00232 /* No recognised compiler */
00233 # ifdef _STLSOFT_FORCE_ANY_COMPILER
00234 #  define _MFCSTL_COMPILER_IS_UNKNOWN
00235 #  ifdef _STLSOFT_COMPILE_VERBOSE
00236 #   pragma message("Compiler is unknown to MFCSTL")
00237 #  endif /* _STLSOFT_COMPILE_VERBOSE */
00238 # else
00239 #  error Currently only Borland C++, Digital Mars C/C++, Intel C/C++, Metrowerks CodeWarrior and Visual C++ compilers are supported by the MFCSTL libraries
00240 # endif /* _STLSOFT_FORCE_ANY_COMPILER */
00241 #endif /* compiler */
00242 
00243 /* 
00244  * Debugging
00245  *
00246  * The macro mfcstl_assert provides standard debug-mode assert functionality.
00247  */
00248 
00252 #define mfcstl_assert(expr)                 stlsoft_assert(expr)
00253 
00258 #define mfcstl_message_assert(msg, expr)    stlsoft_message_assert(msg, expr)
00259 
00263 #define mfcstl_static_assert(expr)          stlsoft_static_assert(expr)
00264 
00265 /* 
00266  * Namespace
00267  *
00268  * The MFCSTL components are contained within the mfcstl namespace. This is
00269  * usually an alias for stlsoft::mfcstl_project,
00270  *
00271  * When compilers support namespaces they are defined by default. They can be
00272  * undefined using a cascasing system, as follows:
00273  *
00274  * If _STLSOFT_NO_NAMESPACES is defined, then _MFCSTL_NO_NAMESPACES is defined.
00275  *
00276  * If _MFCSTL_NO_NAMESPACES is defined, then _MFCSTL_NO_NAMESPACE is defined.
00277  *
00278  * If _MFCSTL_NO_NAMESPACE is defined, then the MFCSTL constructs are defined
00279  * in the global scope.
00280  *
00281  * If _STLSOFT_NO_NAMESPACES, _MFCSTL_NO_NAMESPACES and _MFCSTL_NO_NAMESPACE are
00282  * all undefined but the symbol _STLSOFT_NO_NAMESPACE is defined (whence the
00283  * namespace stlsoft does not exist), then the MFCSTL constructs are defined
00284  * within the mfcstl namespace. The definition matrix is as follows:
00285  *
00286  * _STLSOFT_NO_NAMESPACE    _MFCSTL_NO_NAMESPACE    mfcstl definition
00287  * ---------------------    --------------------    -----------------
00288  *  not defined              not defined             = stlsoft::mfcstl_project
00289  *  not defined              defined                 not defined
00290  *  defined                  not defined             mfcstl
00291  *  defined                  defined                 not defined
00292  *
00293  *
00294  *
00295  * The macro mfcstl_ns_qual() macro can be used to refer to elements in the
00296  * MFCSTL libraries irrespective of whether they are in the
00297  * stlsoft::mfcstl_project (or mfcstl) namespace or in the global namespace.
00298  *
00299  * Furthermore, some compilers do not support the standard library in the std
00300  * namespace, so the mfcstl_ns_qual_std() macro can be used to refer to elements
00301  * in the MFCSTL libraries irrespective of whether they are in the std namespace
00302  * or in the global namespace.
00303  *
00304  *
00305  * The MFC libraries themselves may or may not be defined within the MFC
00306  * namespace, so the mfcstl_ns_qual_stl() macro can be used to refer to
00307  * elements in the MFCSTL libraries irrespective of whether they are in the std
00308  * namespace or in the global namespace.
00309  */
00310 
00311 /* No STLSoft namespaces means no MFCSTL namespaces */
00312 #ifdef _STLSOFT_NO_NAMESPACES
00313 # define _MFCSTL_NO_NAMESPACES
00314 #endif /* _STLSOFT_NO_NAMESPACES */
00315 
00316 /* No MFCSTL namespaces means no mfcstl namespace */
00317 #ifdef _MFCSTL_NO_NAMESPACES
00318 # define _MFCSTL_NO_NAMESPACE
00319 #endif /* _MFCSTL_NO_NAMESPACES */
00320 
00321 #ifndef _MFCSTL_NO_NAMESPACE
00322 # if defined(_STLSOFT_NO_NAMESPACE) || \
00323      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00324 /* There is no stlsoft namespace, so must define ::mfcstl */
00327 namespace mfcstl
00328 {
00329 # else
00330 /* Define stlsoft::mfcstl_project */
00331 
00332 namespace stlsoft
00333 {
00334 
00335 namespace mfcstl_project
00336 {
00337 
00338 # endif /* _STLSOFT_NO_NAMESPACE */
00339 #else
00340 stlsoft_ns_using(move_lhs_from_rhs)
00341 #endif /* !_MFCSTL_NO_NAMESPACE */
00342 
00345 
00348 
00349 #ifndef _MFCSTL_NO_NAMESPACE
00350 # define mfcstl_ns_qual(x)          ::mfcstl::x
00351 # define mfcstl_ns_using(x)         using ::mfcstl::x;
00352 #else
00353 # define mfcstl_ns_qual(x)          x
00354 # define mfcstl_ns_using(x)
00355 #endif /* !_MFCSTL_NO_NAMESPACE */
00356 
00359 
00362 
00363 #ifdef __STLSOFT_CF_std_NAMESPACE
00364 # define mfcstl_ns_qual_std(x)      ::std::x
00365 # define mfcstl_ns_using_std(x)     using ::std::x;
00366 #else
00367 # define mfcstl_ns_qual_std(x)      x
00368 # define mfcstl_ns_using_std(x)
00369 #endif /* !__STLSOFT_CF_std_NAMESPACE */
00370 
00371 /* 
00372  * Typedefs
00373  *
00374  * The MFCSTL uses a number of typedefs to aid in compiler-independence in the
00375  * libraries' main code.
00376  */
00377 
00378 typedef stlsoft_ns_qual(ss_char_a_t)        ms_char_a_t;    
00379 typedef stlsoft_ns_qual(ss_char_w_t)        ms_char_w_t;    
00380 typedef stlsoft_ns_qual(ss_sint8_t)         ms_sint8_t;     
00381 typedef stlsoft_ns_qual(ss_uint8_t)         ms_uint8_t;     
00382 typedef stlsoft_ns_qual(ss_int16_t)         ms_int16_t;     
00383 typedef stlsoft_ns_qual(ss_sint16_t)        ms_sint16_t;    
00384 typedef stlsoft_ns_qual(ss_uint16_t)        ms_uint16_t;    
00385 typedef stlsoft_ns_qual(ss_int32_t)         ms_int32_t;     
00386 typedef stlsoft_ns_qual(ss_sint32_t)        ms_sint32_t;    
00387 typedef stlsoft_ns_qual(ss_uint32_t)        ms_uint32_t;    
00388 #ifdef STLSOFT_CF_64BIT_INT_SUPPORT
00389 typedef stlsoft_ns_qual(ss_int64_t)         ms_int64_t;     
00390 typedef stlsoft_ns_qual(ss_sint64_t)        ms_sint64_t;    
00391 typedef stlsoft_ns_qual(ss_uint64_t)        ms_uint64_t;    
00392 #endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
00393 typedef stlsoft_ns_qual(ss_int_t)           ms_int_t;       
00394 typedef stlsoft_ns_qual(ss_sint_t)          ms_sint_t;      
00395 typedef stlsoft_ns_qual(ss_uint_t)          ms_uint_t;      
00396 typedef stlsoft_ns_qual(ss_long_t)          ms_long_t;      
00397 typedef stlsoft_ns_qual(ss_bool_t)          ms_bool_t;      
00398 typedef DWORD                               ms_dword_t;     
00399 typedef stlsoft_ns_qual(ss_size_t)          ms_size_t;      
00400 typedef stlsoft_ns_qual(ss_ptrdiff_t)       ms_ptrdiff_t;   
00401 typedef stlsoft_ns_qual(ss_streampos_t)     ms_streampos_t; 
00402 typedef stlsoft_ns_qual(ss_streamoff_t)     ms_streamoff_t; 
00403 
00404 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00405 /* 
00406  * Values
00407  *
00408  * Since the boolean type may not be supported natively on all compilers, the
00409  * values of true and false may also not be provided. Hence the values of
00410  * ms_true_v and ms_false_v are defined, and are used in all code.
00411  */
00412 
00413 #define ms_true_v       ss_true_v
00414 #define ms_false_v      ss_false_v
00415 
00416 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00417 /* 
00418  * Code modification macros
00419  */
00420 
00421 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION
00422 /* Exception signatures. */
00423 #define mfcstl_throw_0()                                stlsoft_throw_0()
00424 #define mfcstl_throw_1(x1)                              stlsoft_throw_1(x1)
00425 #define mfcstl_throw_2(x1, x2)                          stlsoft_throw_2(x1, x2)
00426 #define mfcstl_throw_3(x1, x2, x3)                      stlsoft_throw_3(x1, x2, x3)
00427 #define mfcstl_throw_4(x1, x2, x3, x4)                  stlsoft_throw_4(x1, x2, x3, x4)
00428 #define mfcstl_throw_5(x1, x2, x3, x4, x5)              stlsoft_throw_5(x1, x2, x3, x4, x5)
00429 #define mfcstl_throw_6(x1, x2, x3, x4, x5, x6)          stlsoft_throw_6(x1, x2, x3, x4, x5, x6)
00430 #define mfcstl_throw_7(x1, x2, x3, x4, x5, x6, x7)      stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7)
00431 #define mfcstl_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)  stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)
00432 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */
00433 
00435 #define mfcstl_num_elements(ar)                         stlsoft_num_elements(ar)
00436 
00438 #define mfcstl_destroy_instance(t, _type, p)            stlsoft_destroy_instance(t, _type, p)
00439 
00441 #define mfcstl_gen_opaque(_htype)                       stlsoft_gen_opaque(_htype)
00442 
00443 /* 
00444 
00445 #ifndef _MFCSTL_NO_NAMESPACE
00446 # if defined(_STLSOFT_NO_NAMESPACE) || \
00447      defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION)
00448 } // namespace mfcstl
00449 # else
00450 } // namespace mfcstl_project
00451 } // namespace stlsoft
00452 namespace mfcstl = ::stlsoft::mfcstl_project;
00453 # endif /* _STLSOFT_NO_NAMESPACE */
00454 #endif /* !_MFCSTL_NO_NAMESPACE */
00455 
00456 /* 
00457 
00458 #endif /* MFCSTL_INCL_H_MFCSTL */
00459 
00460 /* 

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