CORBA_macros.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ============================================================================
00004 /**
00005  * @file CORBA_macros.h
00006  *
00007  * CORBA_macros.h,v 1.35 2005/08/19 12:27:51 jwillemsen Exp
00008  *
00009  *   Writing code that is portable between platforms with or without
00010  *   native C++ exceptions is hard.  The following macros offer some
00011  *   help on this task, mostly oriented to making the ORB code and the
00012  *   IDL generated code portable.
00013  *
00014  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00015  *  @author Aniruddha Gokhale  <gokhale@sahyadri.research.bell-labs.com>
00016  *  @author Carlos O'Ryan  <coryan@uci.edu>, et al.
00017  */
00018 // ============================================================================
00019 
00020 // Macros for handling CORBA exceptions.
00021 
00022 #ifndef ACE_CORBA_MACROS_H
00023 #define ACE_CORBA_MACROS_H
00024 
00025 #include /**/ "ace/pre.h"
00026 
00027 #include "ace/config-all.h"
00028 
00029 # if !defined (ACE_LACKS_PRAGMA_ONCE)
00030 #   pragma once
00031 # endif /* ACE_LACKS_PRAGMA_ONCE */
00032 
00033 #define ACE_ENV_POLLUTE_NAMES
00034 
00035 #include "ace/Exception_Macros.h"
00036 
00037 // If you wish to you use these macros for emulating exceptions on
00038 // platforms which lack native exception support, you need to do the
00039 // following:
00040 // 1. Define a class Exception. You can name it as you please. This class
00041 //    should be at the root of the inheritance hierarchy of all the
00042 //    exceptions used in your application. It should define at a minimum
00043 //    the following pure virtual methods:
00044 //    a) _downcast () - Which allows narrowing of the base exception type to a
00045 //       derived type.
00046 //    b) _raise() - Which throws an exception of type Exception.
00047 //
00048 //    Classes which derive from these should implement these operations.
00049 //
00050 // 2. Define a class Environment. You can name it as you please. This class
00051 //    is an exception holder. This class is always on the stack. It should
00052 //    support at a minimum the following methods:
00053 //      a) exception() - Which returns the Exception held in the current
00054 //         Environment.
00055 //      b) exception (Exception* foo) - Which replaces/sets the Exception
00056 //         held in the current Environment with foo.
00057 //      b) clear() - Which resets a particular instance of Environment.
00058 //      c) A copy constructor and an assignment operator.
00059 //
00060 //  Note that the above description assumes that you use the following
00061 //  macros only within a particular domain. For example, if your
00062 //  application has to interoperate across domains, then you need to define
00063 //  an exception adapter to translate exceptions from one domain to
00064 //  exceptions in the other. Please refer to Stroustrup's book on how to do
00065 //  this. If your use case is this complex, you would be better off with
00066 //  going with native exceptions rather than emulated exceptions, though
00067 //  the macros should still work if you defined your adapter class as
00068 //  ACE_EXCEPTION_TYPE.
00069 
00070 
00071 // The following macros assume that an environment variable is passed
00072 // in/out of each function that can throw an exception. The type of the
00073 // environment variable is defined by ACE_ENV_TYPE.
00074 
00075 #if !defined (ACE_ENV_TYPE)
00076 # define ACE_ENV_TYPE  CORBA::Environment
00077 #endif /* ACE_ENV_TYPE */
00078 
00079 // The name of the variable is defined by ACE_TRY_ENV. Below is the name
00080 // that we use by default. If you wish to change it you can redefine
00081 // ACE_TRY_ENV to change the default name. Also ACE_ADOPT_ENV allows the
00082 // use of non-standard name within a scope.
00083 
00084 #if !defined (ACE_TRY_ENV)
00085 # define ACE_TRY_ENV  _ACE_CORBA_Environment_variable
00086 #endif /* ACE_TRY_ENV */
00087 
00088 // The base type of Exception from which all the other exception types are
00089 // derived. You can set this to any type as you please. By default, it is
00090 // set to CORBA::Exception.
00091 
00092 #if !defined (ACE_EXCEPTION_TYPE)
00093 # define ACE_EXCEPTION_TYPE  CORBA::Exception
00094 #endif /* ACE_EXCEPTION_TYPE */
00095 
00096 // This method is used to get the default value of the Environment
00097 // variable. In the case of TAO, this variable is part of the TSS ORB
00098 // resources and the method TAO_default_environment() returns the
00099 // Environment variable.
00100 
00101 #if !defined (ACE_DEFAULT_GET_ENV_METHOD)
00102 # define ACE_DEFAULT_GET_ENV_METHOD  TAO_default_environment
00103 #endif /* ACE_DEFAULT_GET_ENV_METHOD */
00104 
00105 // This is the exception caught by ACE_CATCHANY.
00106 #if !defined (ACE_ANY_EXCEPTION)
00107 # define ACE_ANY_EXCEPTION ex
00108 #endif /* ACE_ANY_EXCEPTION */
00109 
00110 // Declare a new environment variable on the stack. The type of the
00111 // environment variable is determined by ACE_ENV_TYPE.
00112 #define ACE_DECLARE_NEW_ENV \
00113      ACE_ENV_TYPE ACE_TRY_ENV
00114 
00115 // Provided for backward compatibility purposes. Don't use it in new code.
00116 // Use the definition above along with defining ACE_ENV_TYPE.
00117 
00118 #if defined (ACE_ENV_POLLUTE_NAMES)
00119 #  define ACE_DECLARE_NEW_CORBA_ENV ACE_ENV_TYPE ACE_TRY_ENV
00120 #endif /* ACE_ENV_POLLUTE_NAMES */
00121 
00122 #if defined (ACE_USES_NATIVE_EXCEPTIONS)
00123 // -----------------------------------------------------------------
00124 
00125 // Provided for backward compatibility purposes. Don't use it in new code.
00126 #if defined (ACE_ENV_POLLUTE_NAMES)
00127 #  define ACE_ADOPT_CORBA_ENV(ENV)
00128 #endif /* ACE_ENV_POLLUTE_NAMES */
00129 
00130 #define ACE_ADOPT_ENV (ENV)
00131 
00132 // No need to check. Native exceptions handle the control flow
00133 // automatically when an exception occurs.
00134 # define ACE_CHECK
00135 
00136 // Used when the function requires a return value.
00137 # define ACE_CHECK_RETURN(RETV)
00138 
00139 // ACE_THROW_INT should not be used by the user.
00140 # define ACE_THROW_INT(EXCEPTION) \
00141       throw EXCEPTION
00142 
00143 // Throwing an exception is easy. These two macros should _NOT_ be
00144 // used within try blocks.
00145 # define ACE_THROW(EXCEPTION) \
00146       throw EXCEPTION
00147 
00148 // Throwing an exception when the function requires a return value.
00149 # if defined (__HP_aCC)
00150 #   define ACE_THROW_RETURN(EXCEPTION, RETV) \
00151        do \
00152          { \
00153            throw EXCEPTION; \
00154            return RETV; \
00155          } while (0)
00156 # else
00157 #   define ACE_THROW_RETURN(EXCEPTION,RETV) \
00158       throw EXCEPTION
00159 # endif
00160 
00161 // For compilers with native exceptions, we can simply use try to try. ;-)
00162 // do {} while (0) is required to avoid compilation warnings.
00163 # define ACE_TRY \
00164    do \
00165      { \
00166        try \
00167          {
00168 # define ACE_TRY_NEW_ENV \
00169    do \
00170      { \
00171        ACE_ENV_TYPE ACE_TRY_ENV; \
00172        try \
00173          {
00174 # define ACE_TRY_EX(LABEL) \
00175    do \
00176      { \
00177        try \
00178          {
00179 
00180 // No need to check for exceptions within try block for compilers with
00181 // native exceptions.
00182 # define ACE_TRY_CHECK
00183 # define ACE_TRY_CHECK_EX(LABEL)
00184 
00185 // Likewise, throwing exceptions within try blocks is easy.
00186 # define ACE_TRY_THROW(EXCEPTION) throw EXCEPTION
00187 # define ACE_TRY_THROW_EX(EXCEPTION,LABEL) throw EXCEPTION
00188 
00189 // Same thing for catch.
00190 # define ACE_CATCH(EXCEPTION,VAR) \
00191          } \
00192        catch (EXCEPTION & VAR) \
00193          { \
00194            ACE_UNUSED_ARG (VAR);
00195 
00196 # define ACE_CATCHANY \
00197        ACE_CATCH(ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION)
00198 
00199 # define ACE_CATCHALL \
00200          } \
00201        catch (...) \
00202          {
00203 
00204 #   if defined (ACE_HAS_DEPRECATED_ACE_RETHROW)
00205 #     define ACE_RETHROW throw
00206 #   endif /* ACE_HAS_DEPRECATED_ACE_RETHROW */
00207 
00208 // Rethrowing the exception from catch blocks.
00209 # define ACE_RE_THROW throw
00210 # define ACE_RE_THROW_EX(LABEL) throw
00211 
00212 // Close the catch block.
00213 # define ACE_ENDTRY \
00214          } \
00215      } while (0)
00216 
00217 #else /* ! ACE_USES_NATIVE_EXCEPTIONS */
00218 // -----------------------------------------------------------------
00219 
00220 // When handling compilers without native exceptions, things get a bit
00221 // hairy. Exceptions are simulated using ACE_ENV_TYPE. The trick here is to
00222 // make sure the flow-of-control can simulate the case when native
00223 // exceptions occur...
00224 
00225 #if defined (ACE_ENV_POLLUTE_NAMES)
00226 # define ACE_ADOPT_CORBA_ENV(ENV) ACE_ENV_TYPE &ACE_TRY_ENV = ENV
00227 #endif /* ACE_ENV_POLLUTE_NAMES */
00228 
00229 # define ACE_ADOPT_ENV(ENV) ACE_ENV_TYPE &ACE_TRY_ENV = ENV
00230 
00231 // Follow every statement that could throw exceptions with ACE_CHECK or
00232 // ACE_CHECK_RETURN. These two macros should _NOT_ be used within try
00233 // blocks. Use ACE_TRY_CHECK or ACE_TRY_CHECK_EX instead.
00234 # define ACE_CHECK \
00235     if (ACE_TRY_ENV . exception () != 0) \
00236       return
00237 // When function requires a return value
00238 # define ACE_CHECK_RETURN(RETV) \
00239     if (ACE_TRY_ENV . exception () != 0) \
00240       return RETV
00241 
00242 // ACE_THROW_INT should not be used by the user.
00243 # define ACE_THROW_INT(EXCEPTION) ACE_TRY_ENV.exception (new EXCEPTION)
00244 
00245 // Throwing exceptions will inevitably cause a return from the current
00246 // function. These two macros should _NOT_ be used within try blocks. Use
00247 // ACE_TRY_THROW or ACE_TRY_THROW_EX instead.
00248 # define ACE_THROW(EXCEPTION) \
00249     do \
00250       { \
00251         ACE_TRY_ENV.exception (new EXCEPTION); \
00252         return; \
00253       } while (0)
00254 
00255 # define ACE_THROW_RETURN(EXCEPTION,RETV) \
00256     do \
00257       { \
00258         ACE_TRY_ENV.exception (new EXCEPTION); \
00259         return RETV; \
00260       } while (0)
00261 
00262 // ACE_TRY sets up flags to control program flow. ACE_TRY_FLAG acts like a
00263 // one-shot flip-flop. When an exception occurs (detected using
00264 // ACE_TRY_CHECK,) ACE_TRY_FLAG will be reset and the control goes back
00265 // into ACE_TRY_LABEL. Since ACE_TRY_FLAG is reset, the try block won't get
00266 // executed again and the control proceeds to the following catch blocks.
00267 // ACE_EXCEPTION_NOT_CAUGHT flag is used to prevent catching an exception
00268 // twice. This macro assumes there's already an ACE_ENV_TYPE variable
00269 // ACE_TRY_ENV defined (which should be the case normally)
00270 # define ACE_TRY \
00271    do { \
00272      int ACE_TRY_FLAG = 1; \
00273      int ACE_EXCEPTION_NOT_CAUGHT = 1; \
00274    ACE_TRY_LABEL: \
00275      if (ACE_TRY_FLAG) \
00276        do {
00277 
00278 // ACE_TRY_NEW_ENV functions like the macro ACE_TRY but defines a new
00279 // ACE_ENV_TYPE variable ACE_TRY_ENV. It is most often used in the outer
00280 // most function where no ACE_TRY_ENV is available.
00281 # define ACE_TRY_NEW_ENV \
00282    do { \
00283      ACE_ENV_TYPE ACE_TRY_ENV;\
00284      int ACE_TRY_FLAG = 1; \
00285      int ACE_EXCEPTION_NOT_CAUGHT = 1; \
00286    ACE_TRY_LABEL: \
00287      if (ACE_TRY_FLAG) \
00288        do {
00289 
00290 // ACE_TRY_EX works exactly like ACE_TRY macro except the label used in the
00291 // try block is customizable to avoid name clashing. It should be used when
00292 // nested try blocks or multiple try blocks are required, in the same
00293 // function.
00294 # define ACE_TRY_EX(LABEL) \
00295    do { \
00296      int ACE_TRY_FLAG = 1; \
00297      int ACE_EXCEPTION_NOT_CAUGHT = 1; \
00298    ACE_TRY_LABEL ## LABEL: \
00299      if (ACE_TRY_FLAG) \
00300        do {
00301 
00302 // Check for exceptions within try blocks.
00303 # define ACE_TRY_CHECK \
00304     { \
00305       if (ACE_TRY_ENV.exception () != 0) \
00306         { \
00307           ACE_TRY_FLAG = 0; \
00308           goto ACE_TRY_LABEL; \
00309         } \
00310     }
00311 
00312 // Checking exception within EX try blocks.
00313 # define ACE_TRY_CHECK_EX(LABEL) \
00314     { \
00315       if (ACE_TRY_ENV.exception () != 0) \
00316         { \
00317           ACE_TRY_FLAG = 0; \
00318           goto ACE_TRY_LABEL ## LABEL; \
00319         } \
00320     }
00321 
00322 // Throwing exception within TRY blocks.
00323 # define ACE_TRY_THROW(EXCEPTION) \
00324     { \
00325       ACE_TRY_ENV.exception (new EXCEPTION); \
00326       ACE_TRY_FLAG = 0; \
00327       goto ACE_TRY_LABEL; \
00328     }
00329 
00330 # define ACE_TRY_THROW_EX(EXCEPTION,LABEL) \
00331     { \
00332       ACE_TRY_ENV.exception (new EXCEPTION); \
00333       ACE_TRY_FLAG = 0; \
00334       goto ACE_TRY_LABEL ## LABEL; \
00335     }
00336 
00337 // When exceptions occur or try block finishes execution without exception,
00338 // control will continue in the catch block. This macro first checks if
00339 // there's any uncaught exception left. If all the conditions are met, we
00340 // have caught an exception. It then resets ACE_EXCEPTION_NOT_CAUGHT to
00341 // prevent subsequent catch blocks from catching the same exception again,
00342 // and extracts out the underlying exception in ACE_TRY_ENV. We also make a
00343 // copy of ACE_TRY_ENV in ACE_CAUGHT_ENV, in case we want to rethrow the
00344 // exception. ACE_TRY_ENV is cleared out after the exception is caught so
00345 // you should not use ACE_TRY_ENV within the catch block(You should use the
00346 // exception directly).
00347 # define ACE_CATCH(TYPE,VAR) \
00348      } while (0); \
00349    do \
00350      if (ACE_TRY_ENV.exception () != 0 && ACE_EXCEPTION_NOT_CAUGHT && \
00351        TYPE::_downcast(ACE_TRY_ENV.exception ()) != 0) \
00352        { \
00353          ACE_ENV_TYPE ACE_CAUGHT_ENV = ACE_TRY_ENV;\
00354          ACE_EXCEPTION_NOT_CAUGHT = 0; \
00355          TYPE &VAR = *TYPE::_downcast (ACE_CAUGHT_ENV.exception ()); \
00356          ACE_UNUSED_ARG (VAR); \
00357          ACE_TRY_ENV.clear ();
00358 
00359 // ACE_CATCHANY uses ACE_CATCH to catch all exceptions derived from
00360 // ACE_EXCEPTION_TYPE
00361 # define ACE_CATCHANY ACE_CATCH (ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION)
00362 
00363 // Since there's no other exception for compilers without exception
00364 // support, we simply catch all ACE_EXCEPTION_TYPE exceptions for
00365 // ACE_CATCHALL.
00366 # define ACE_CATCHALL ACE_CATCHANY
00367 
00368 #   if defined (ACE_HAS_DEPRECATED_ACE_RETHROW)
00369 #     define ACE_RETHROW \
00370         do \
00371           ACE_TRY_ENV = ACE_CAUGHT_ENV; \
00372         while (0)
00373 #   endif /* ACE_HAS_DEPRECATED_ACE_RETHROW */
00374 
00375 // Rethrowing exception within catch blocks. Notice that we depend on the
00376 // ACE_CHECK/ACE_CHECK_RETURN following the ACE_ENDTRY, or ACE_TRY_CHECK/
00377 // ACE_TRY_CHECK_EX following the ACE_ENDTRY when the catch block is within
00378 // another try block, to do the "Right Thing[TM]."
00379 # define ACE_RE_THROW \
00380     do {\
00381       ACE_TRY_ENV = ACE_CAUGHT_ENV; \
00382       goto ACE_TRY_LABEL; \
00383     } while (0)
00384 # define ACE_RE_THROW_EX(LABEL) \
00385     do {\
00386       ACE_TRY_ENV = ACE_CAUGHT_ENV; \
00387       goto ACE_TRY_LABEL ## LABEL; \
00388     } while (0)
00389 
00390 // Close the try block. Since exceptions may not get caught, and exceptions
00391 // can also be rethrown from the catch block, it's always a good idea to
00392 // follow ACE_ENDTRY with ACE_CHECK or ACE_TRY_CHECK (depending on the
00393 // context.)
00394 # define ACE_ENDTRY \
00395       } while (0); \
00396     } while (0)
00397 
00398 #endif /* ! ACE_CORBA_HAS_EXCEPTIONS */
00399 
00400 // ACE_HAS_EXCEPTIONS is not the same as ACE_NEW_THROWS_EXCEPTIONS.
00401 #if defined(ACE_NEW_THROWS_EXCEPTIONS)
00402 
00403 #   define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \
00404      do { try { POINTER = new CONSTRUCTOR; } \
00405        catch (ACE_bad_alloc) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \
00406      } while (0)
00407 
00408 #else /* ! ACE_NEW_THROWS_EXCEPTIONS */
00409 
00410 #   define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \
00411      do { POINTER = new CONSTRUCTOR; \
00412        if (POINTER == 0) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \
00413      } while (0)
00414 
00415 #endif /* ACE_NEW_THROWS_EXCEPTIONS */
00416 
00417 # define ACE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
00418   ACE_Guard< MUTEX > OBJ (LOCK); \
00419     if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);
00420 
00421 # define ACE_READ_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
00422   ACE_Read_Guard< MUTEX > OBJ (LOCK); \
00423     if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);
00424 
00425 # define ACE_WRITE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
00426   ACE_Write_Guard< MUTEX > OBJ (LOCK); \
00427     if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);
00428 
00429 //@{
00430 /**
00431  * @name Native C++ exceptions portability macros.
00432  *
00433  * The following macros are used to write code portable between platforms
00434  * with and without native C++ exception support. Their main goal is to
00435  * hide the presence of the ACE_ENV_TYPE argument, but they collaborate
00436  * with the ACE_TRY_* macros to emulate the try/catch blocks.
00437  */
00438 
00439 /// Define a macro to emit code only when ACE_ENV_TYPE is used
00440 #if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT)
00441 #  define ACE_ENV_EMIT_CODE(X) X
00442 #else
00443 #  define ACE_ENV_EMIT_CODE(X)
00444 #endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACE_ENV_BKWD_COMPAT */
00445 
00446 /// Another macro to emit code only when ACE_ENV_TYPE is used
00447 #if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT)
00448 #  define ACE_ENV_EMIT_CODE2(X,Y) X,Y
00449 #else
00450 #  define ACE_ENV_EMIT_CODE2(X,Y)
00451 #endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACE_ENV_BKWD_COMPAT */
00452 
00453 /// Helper macro
00454 #define ACE_ENV_EMIT_DUMMY
00455 
00456 /// Declare a ACE_ENV_TYPE argument as the last argument of a
00457 /// function
00458 /**
00459  * Normally this macro is used as follows:
00460  *
00461  * <CODE>void my_funct (int x, int y ACE_ENV_ARG_DECL);</CODE>
00462  *
00463  * Its purpose is to provide developers (and users) with a mechanism to
00464  * write code that is portable to platforms with and without native C++
00465  * exceptions.
00466  */
00467 #define ACE_ENV_ARG_DECL \
00468     ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
00469                        ACE_ENV_TYPE &ACE_TRY_ENV)
00470 
00471 /// Declare a ACE_ENV_TYPE argument with the default value obtained from
00472 /// the ORB/application.
00473 /**
00474  * It is similar to ACE_ENV_ARG_DECL. The name of the default environment
00475  * getter method needs to be changed when switching ORBs or when used with
00476  * another application.
00477  */
00478 #define ACE_ENV_ARG_DECL_WITH_DEFAULTS \
00479     ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
00480                        ACE_ENV_TYPE &ACE_TRY_ENV = \
00481                            ACE_DEFAULT_GET_ENV_METHOD ())
00482 
00483 /// Declare a ACE_ENV_TYPE argument that is not used by the
00484 /// function definition.
00485 /**
00486  * Similar to ACE_ENV_ARG_DECL, but the formal parameter name is dropped to
00487  * avoid warnings about unused parameters
00488  */
00489 #define ACE_ENV_ARG_DECL_NOT_USED \
00490     ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
00491                        ACE_ENV_TYPE &)
00492 
00493 /// Declare a ACE_ENV_TYPE argument for methods that do not take any other
00494 /// parameters
00495 #define ACE_ENV_SINGLE_ARG_DECL \
00496     ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV)
00497 
00498 /// Declare a ACE_ENV_TYPE argument with a default value for methods that
00499 /// do not take any other parameters. The name of the default environment
00500 /// getter method needs to be changed when switching ORBs or when used in
00501 /// another application.
00502 #define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS \
00503     ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV = \
00504                           ACE_DEFAULT_GET_ENV_METHOD ())
00505 
00506 /// Declare a ACE_ENV_TYPE argument for methods which don't use it.
00507 #define ACE_ENV_SINGLE_ARG_DECL_NOT_USED \
00508     ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &)
00509 
00510 /// Use the ACE_ENV_TYPE argument in a nested call
00511 #define ACE_ENV_ARG_PARAMETER \
00512     ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
00513                        ACE_TRY_ENV)
00514 
00515 /// Use the ACE_ENV_TYPE argument in a nested call, assuming that the
00516 /// called function takes only the ACE_TRY_ENV argument.
00517 #define ACE_ENV_SINGLE_ARG_PARAMETER \
00518     ACE_ENV_EMIT_CODE(ACE_TRY_ENV)
00519 
00520 /// Eliminate unused argument warnings about ACE_TRY_ENV
00521 #define ACE_ENV_ARG_NOT_USED \
00522     ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV))
00523 //@}
00524 
00525 #if !defined (ACE_USES_NATIVE_EXCEPTIONS)
00526 // This thing can be moved above when we drop ACE_ENV_BKWD_COMPAT.
00527 #  define ACE_ENV_RAISE(ex) ACE_TRY_ENV.exception (ex)
00528 #else
00529 #  define ACE_ENV_RAISE(ex) (ex)->_raise ()
00530 #endif /* ACE_CORBA_HAS_EXCEPTIONS */
00531 
00532 // ============================================================
00533 
00534 // Print out a TAO exception.  This is not CORBA compliant.
00535 # define ACE_PRINT_TAO_EXCEPTION(EX,INFO) \
00536   EX._tao_print_exception (INFO)
00537 
00538 // Print out a CORBA exception.  There is not portable way to
00539 // dump a CORBA exception.  If you are using other ORB implementation,
00540 // redefine the macro to get what you want.
00541 # if !defined ACE_PRINT_EXCEPTION
00542 #   define ACE_PRINT_EXCEPTION(EX,INFO) ACE_PRINT_TAO_EXCEPTION(EX,INFO)
00543 # endif /* ACE_PRINT_EXCEPTION */
00544 
00545 #include /**/ "ace/post.h"
00546 
00547 #endif /* ACE_CORBA_MACROS_H */

Generated on Thu Nov 9 09:41:49 2006 for ACE by doxygen 1.3.6