Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

pantheios/quality/contract.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/quality/contract.h (formerly pantheios/contract/assert.h)
00003  *
00004  * Purpose:     Defines the contract enforcement constructs used in the
00005  *              Pantheios core and APIs.
00006  *
00007  * Created:     26th June 2005
00008  * Updated:     2nd August 2010
00009  *
00010  * Home:        http://www.pantheios.org/
00011  *
00012  * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
00013  * Copyright (c) 1999-2005, Synesis Software and Matthew Wilson
00014  * All rights reserved.
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions are
00018  * met:
00019  *
00020  * - Redistributions of source code must retain the above copyright notice,
00021  *   this list of conditions and the following disclaimer.
00022  * - Redistributions in binary form must reproduce the above copyright
00023  *   notice, this list of conditions and the following disclaimer in the
00024  *   documentation and/or other materials provided with the distribution.
00025  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
00026  *   names of any contributors may be used to endorse or promote products
00027  *   derived from this software without specific prior written permission.
00028  *
00029  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00030  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00031  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00032  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00033  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00034  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00035  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00036  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00037  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00038  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00039  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00040  *
00041  * ////////////////////////////////////////////////////////////////////// */
00042 
00043 
00050 #ifndef PANTHEIOS_INCL_PANTHEIOS_QUALITY_H_CONTRACT
00051 #define PANTHEIOS_INCL_PANTHEIOS_QUALITY_H_CONTRACT
00052 
00053 /* /////////////////////////////////////////////////////////////////////////
00054  * Version information
00055  */
00056 
00057 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00058 # define PANTHEIOS_VER_PANTHEIOS_QUALITY_H_CONTRACT_MAJOR       3
00059 # define PANTHEIOS_VER_PANTHEIOS_QUALITY_H_CONTRACT_MINOR       2
00060 # define PANTHEIOS_VER_PANTHEIOS_QUALITY_H_CONTRACT_REVISION    1
00061 # define PANTHEIOS_VER_PANTHEIOS_QUALITY_H_CONTRACT_EDIT        16
00062 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00063 
00064 /* /////////////////////////////////////////////////////////////////////////
00065  * Includes
00066  */
00067 
00068 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00069 # include <pantheios/pantheios.h>
00070 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00071 
00072 #if defined(PANTHEIOS_QA_USE_CUSTOM_CONTRACT)
00073 # include PANTHEIOS_QA_CUSTOM_CONTRACT_INCLUDE
00074 #elif defined(PANTHEIOS_QA_USE_XCONTRACT)
00075 # include <xcontract/xcontract.h>
00076 #else /* ? contract */
00077 # include <stlsoft/stlsoft.h>
00078 #endif /* contract */
00079 
00080 /* /////////////////////////////////////////////////////////////////////////
00081  * Helper macros
00082  */
00083 
00084 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00085 
00086 # ifndef PANTHEIOS_QA_DO_MSG_TYPECHECK
00087    /* Since this typecheck is only needed to ensure a coding error has not
00088     * been made, it is not actually necessary to check it on every compiler,
00089     * only on at least one compiler used to verify the distribution before
00090     * release. Therefore, we only do the check on compilers we already know
00091     * to work; for any others we avoid the possible ambiguities (such as
00092     * those we see with GCC in C) between literals and char const*, and so
00093     * on.
00094     */
00095 
00096 #  ifdef __cplusplus
00097     /* C++ */
00098 #   if defined(STLSOFT_COMPILER_IS_BORLAND) || \
00099        defined(STLSOFT_COMPILER_IS_MWERKS) || \
00100        defined(STLSOFT_COMPILER_IS_DMC) || \
00101        defined(STLSOFT_COMPILER_IS_GCC) || \
00102        defined(STLSOFT_COMPILER_IS_MSVC)
00103 #    define PANTHEIOS_QA_DO_MSG_TYPECHECK
00104 #   endif /* compiler */
00105 #  else /* ? __cplusplus */
00106     /* C */
00107 #   if defined(STLSOFT_CF_C99_INLINE) || \
00108        defined(STLSOFT_CUSTOM_C_INLINE)
00109 #   if defined(STLSOFT_COMPILER_IS_BORLAND) || \
00110        defined(STLSOFT_COMPILER_IS_MWERKS) || \
00111        defined(STLSOFT_COMPILER_IS_DMC) || \
00112        defined(STLSOFT_COMPILER_IS_MSVC)
00113 #    define PANTHEIOS_QA_DO_MSG_TYPECHECK
00114 #   endif /* compiler */
00115 #  endif /* C99 or custom inline */
00116 #  endif /* __cplusplus */
00117 # endif /* !PANTHEIOS_QA_DO_MSG_TYPECHECK */
00118 
00119 # if defined(PANTHEIOS_QA_DO_MSG_TYPECHECK)
00120 STLSOFT_INLINE char const* PANTHEIOS_TYPECHECK_MSG_(char const* msg)
00121 {
00122     return msg;
00123 }
00124 
00125 #  if defined(__cplusplus)
00126 #   ifdef STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT
00127 template <size_t N>
00128 inline char const* PANTHEIOS_TYPECHECK_MSG_(char (&ar)[N])
00129 {
00130     return &ar[0];
00131 }
00132 #   endif /* STLSOFT_CF_STATIC_ARRAY_SIZE_DETERMINATION_SUPPORT */
00133 inline void PANTHEIOS_TYPECHECK_MSG_(...)
00134 {}
00135 #  endif /* __cplusplus */
00136 
00137 # else /* ? PANTHEIOS_QA_DO_MSG_TYPECHECK */
00138 #  define PANTHEIOS_TYPECHECK_MSG_(msg)             (msg)
00139 # endif /* PANTHEIOS_QA_DO_MSG_TYPECHECK */
00140 
00141 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00142 
00143 /* /////////////////////////////////////////////////////////////////////////
00144  * Enforcements
00145  */
00146 
00147 #if defined(PANTHEIOS_QA_USE_CUSTOM_CONTRACT)
00148 
00149  /* If the user is supplying a custom contract library, then they must
00150   * define all the requisite symbols, so we just test their existence.
00151   */
00152 
00153 # ifndef PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_INTERNAL
00154 #  define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_INTERNAL is not defined by the custom contract library
00155 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_INTERNAL */
00156 
00157 # ifndef PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_API
00158 #  define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_API is not defined by the custom contract library
00159 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_API */
00160 
00161 # ifndef PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_APPL_LAYER
00162 #  define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_APPL_LAYER is not defined by the custom contract library
00163 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_APPL_LAYER */
00164 
00165 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_INTERNAL
00166 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_INTERNAL is not defined by the custom contract library
00167 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_INTERNAL */
00168 
00169 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_API
00170 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_API is not defined by the custom contract library
00171 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_API */
00172 
00173 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_APPL_LAYER
00174 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_APPL_LAYER is not defined by the custom contract library
00175 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_APPL_LAYER */
00176 
00177 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_INTERNAL
00178 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_INTERNAL is not defined by the custom contract library
00179 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_INTERNAL */
00180 
00181 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API
00182 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API is not defined by the custom contract library
00183 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API */
00184 
00185 # ifndef PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_APPL_LAYER
00186 #  define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_APPL_LAYER is not defined by the custom contract library
00187 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_APPL_LAYER */
00188 
00189 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_INTERNAL
00190 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_INTERNAL is not defined by the custom contract library
00191 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_INTERNAL */
00192 
00193 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_API
00194 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_API is not defined by the custom contract library
00195 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_API */
00196 
00197 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_APPL_LAYER
00198 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_APPL_LAYER is not defined by the custom contract library
00199 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_APPL_LAYER */
00200 
00201 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_INTERNAL
00202 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_INTERNAL is not defined by the custom contract library
00203 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_INTERNAL */
00204 
00205 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_API
00206 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_API is not defined by the custom contract library
00207 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_API */
00208 
00209 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_APPL_LAYER
00210 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_APPL_LAYER is not defined by the custom contract library
00211 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_APPL_LAYER */
00212 
00213 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_INTERNAL
00214 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_INTERNAL is not defined by the custom contract library
00215 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_INTERNAL */
00216 
00217 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_API
00218 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_API is not defined by the custom contract library
00219 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_API */
00220 
00221 # ifndef PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_APPL_LAYER
00222 #  define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_APPL_LAYER is not defined by the custom contract library
00223 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_APPL_LAYER */
00224 
00225 # ifndef PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_INTERNAL
00226 #  define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_INTERNAL is not defined by the custom contract library
00227 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_INTERNAL */
00228 
00229 # ifndef PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_API
00230 #  define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_API is not defined by the custom contract library
00231 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_API */
00232 
00233 # ifndef PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_APPL_LAYER
00234 #  define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_APPL_LAYER is not defined by the custom contract library
00235 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_APPL_LAYER */
00236 
00237 # ifndef PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_INTERNAL
00238 #  define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_INTERNAL is not defined by the custom contract library
00239 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_INTERNAL */
00240 
00241 # ifndef PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_API
00242 #  define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_API is not defined by the custom contract library
00243 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_API */
00244 
00245 # ifndef PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_APPL_LAYER
00246 #  define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_APPL_LAYER is not defined by the custom contract library
00247 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_APPL_LAYER */
00248 
00249 # ifndef PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_INTERNAL
00250 #  define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_INTERNAL is not defined by the custom contract library
00251 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_INTERNAL */
00252 
00253 # ifndef PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_API
00254 #  define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_API is not defined by the custom contract library
00255 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_API */
00256 
00257 # ifndef PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_LAYER
00258 #  define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_LAYER is not defined by the custom contract library
00259 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_LAYER */
00260 
00261 # ifndef PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_DEF
00262 #  define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_DEF is not defined by the custom contract library
00263 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_DEF */
00264 
00265 # ifndef PANTHEIOS_CONTRACT_ENFORCE_ASSUMPTION
00266 #  define PANTHEIOS_CONTRACT_ENFORCE_ASSUMPTION is not defined by the custom contract library
00267 # endif /* !PANTHEIOS_CONTRACT_ENFORCE_ASSUMPTION */
00268 
00269 #elif defined(PANTHEIOS_QA_USE_XCONTRACT)
00270 
00271 # ifndef PANTHEIOS_CONTRACT_LEVEL_INTERNAL
00272 #  define PANTHEIOS_CONTRACT_LEVEL_INTERNAL        (41)
00273 # endif /* !PANTHEIOS_CONTRACT_LEVEL_INTERNAL */
00274 
00275 # ifndef PANTHEIOS_CONTRACT_LEVEL_API
00276 #  define PANTHEIOS_CONTRACT_LEVEL_API             (43)
00277 # endif /* !PANTHEIOS_CONTRACT_LEVEL_API */
00278 
00279 # ifndef PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER
00280 #  define PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER      (45)
00281 # endif /* !PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER */
00282 
00283 # ifndef PANTHEIOS_CONTRACT_LEVEL_APPL_DEF
00284 #  define PANTHEIOS_CONTRACT_LEVEL_APPL_DEF        (47)
00285 # endif /* !PANTHEIOS_CONTRACT_LEVEL_APPL_DEF */
00286 
00287 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_INTERNAL(msg)              XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_unexpectedCondition), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, NULL, PANTHEIOS_TYPECHECK_MSG_(msg))
00288 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_API(msg)                   XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_unexpectedCondition), PANTHEIOS_CONTRACT_LEVEL_API, NULL, PANTHEIOS_TYPECHECK_MSG_(msg))
00289 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_APPL_LAYER(msg)            XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_unexpectedCondition), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, NULL, PANTHEIOS_TYPECHECK_MSG_(msg))
00290 
00291 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_INTERNAL(expr, msg)          XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_logic), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00292 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_API(expr, msg)               XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_logic), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00293 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_APPL_LAYER(expr, msg)        XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_logic), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00294 
00295 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_INTERNAL(expr, msg)         XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_parameters), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00296 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API(expr, msg)              XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_parameters), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00297 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_APPL_LAYER(expr, msg)       XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_precondition_parameters), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00298 
00299 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_INTERNAL(expr, msg)        XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_returnValue), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00300 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_API(expr, msg)             XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_returnValue), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00301 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_APPL_LAYER(expr, msg)      XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_returnValue), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00302 
00303 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_INTERNAL(expr, msg)         XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_logic), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00304 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_API(expr, msg)              XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_logic), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00305 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_APPL_LAYER(expr, msg)       XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_logic), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00306 
00307 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_INTERNAL(expr, msg)        XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_parameters), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00308 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_API(expr, msg)             XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_parameters), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00309 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_APPL_LAYER(expr, msg)      XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_postcondition_parameters), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00310 
00311 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_INTERNAL(expr, msg)             XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_class), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00312 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_API(expr, msg)                  XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_class), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00313 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_APPL_LAYER(expr, msg)           XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_class), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00314 
00315 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_INTERNAL(expr, msg)            XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_global), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00316 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_API(expr, msg)                 XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_global), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00317 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_APPL_LAYER(expr, msg)          XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_invariant_global), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00318 
00319 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_INTERNAL(expr, msg)                 XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_staticData), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00320 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_API(expr, msg)                      XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_staticData), PANTHEIOS_CONTRACT_LEVEL_API, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00321 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_LAYER(expr, msg)               XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_staticData), PANTHEIOS_CONTRACT_LEVEL_APPL_LAYER, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00322 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_DEF(expr, msg)                 XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_staticData), PANTHEIOS_CONTRACT_LEVEL_APPL_DEF, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00323 
00324 # define PANTHEIOS_CONTRACT_ENFORCE_ASSUMPTION(expr)                                XCONTRACT_ENFORCE_CONDITION_TYPE_LEVEL_(XCONTRACT_NS_QUAL(xContract_intermediateAssumption), PANTHEIOS_CONTRACT_LEVEL_INTERNAL, expr, PANTHEIOS_TYPECHECK_MSG_(msg))
00325 
00326 #else /* ? PANTHEIOS_QA_USE_XCONTRACT */
00327 
00336 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_INTERNAL(msg)              STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), 0)
00337 
00346 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_API(msg)                   STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), 0)
00347 
00356 # define PANTHEIOS_CONTRACT_ENFORCE_UNEXPECTED_CONDITION_APPL_LAYER(msg)            STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), 0)
00357 
00358 
00368 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_INTERNAL(expr, msg)          STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00369 
00379 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_API(expr, msg)               STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00380 
00390 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_STATE_APPL_LAYER(expr, msg)        STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00391 
00392 
00402 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_INTERNAL(expr, msg)         STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00403 
00413 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API(expr, msg)              STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00414 
00424 # define PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_APPL_LAYER(expr, msg)       STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00425 
00426 
00436 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_INTERNAL(expr, msg)        STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00437 
00447 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_API(expr, msg)             STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00448 
00458 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_RETURN_APPL_LAYER(expr, msg)      STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00459 
00460 
00470 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_INTERNAL(expr, msg)         STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00471 
00481 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_API(expr, msg)              STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00482 
00492 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_STATE_APPL_LAYER(expr, msg)       STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00493 
00494 
00504 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_INTERNAL(expr, msg)        STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00505 
00515 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_API(expr, msg)             STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00516 
00526 # define PANTHEIOS_CONTRACT_ENFORCE_POSTCONDITION_PARAMS_APPL_LAYER(expr, msg)      STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00527 
00528 
00538 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_INTERNAL(expr, msg)             STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00539 
00549 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_API(expr, msg)                  STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00550 
00560 # define PANTHEIOS_CONTRACT_ENFORCE_CLASS_INVARIANT_APPL_LAYER(expr, msg)           STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00561 
00562 
00572 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_INTERNAL(expr, msg)            STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00573 
00583 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_API(expr, msg)                 STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00584 
00594 # define PANTHEIOS_CONTRACT_ENFORCE_GLOBAL_INVARIANT_APPL_LAYER(expr, msg)          STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00595 
00596 
00606 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_INTERNAL(expr, msg)                 STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00607 
00617 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_API(expr, msg)                      STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00618 
00628 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_LAYER(expr, msg)               STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00629 
00639 # define PANTHEIOS_CONTRACT_ENFORCE_STATIC_DATA_APPL_DEF(expr, msg)                 STLSOFT_MESSAGE_ASSERT(PANTHEIOS_TYPECHECK_MSG_(msg), expr)
00640 
00641 
00650 # define PANTHEIOS_CONTRACT_ENFORCE_ASSUMPTION(expr)                                STLSOFT_ASSERT(expr)
00651 
00652 
00653 #endif /* PANTHEIOS_QA_USE_XCONTRACT */
00654 
00655 /* ////////////////////////////////////////////////////////////////////// */
00656 
00657 #endif /* !PANTHEIOS_INCL_PANTHEIOS_QUALITY_H_CONTRACT */
00658 
00659 /* ///////////////////////////// end of file //////////////////////////// */

pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo