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

CORBA_macros.h File Reference

CORBA_macros.h,v 1.29 2002/04/10 17:44:15 ossama Exp. More...

#include "ace/pre.h"
#include "ace/config-all.h"
#include "ace/post.h"

Include dependency graph for CORBA_macros.h:

Include dependency graph

Native C++ exceptions portability macros.

The following macros are used to write code portable between platforms with and without native C++ exception support.

Their main goal is to hide the presence of the CORBA::Environment argument, but they collaborate with the ACE_TRY_* macros to emulate the try/catch blocks.

#define ACE_ENV_EMIT_CODE(X)
 Define a macro to emit code only when CORBA::Environment is used. More...

#define ACE_ENV_EMIT_CODE2(X, Y)
 Another macro to emit code only when CORBA::Environment is used. More...

#define ACE_ENV_EMIT_DUMMY
 Helper macro. More...

#define ACE_ENV_ARG_DECL
 Normally this macro is used as follows:. More...

#define ACE_ENV_ARG_DECL_WITH_DEFAULTS
 Declare a CORBA::Environment argument with the default value obtained from the ORB. Similar to ACE_ENV_ARG_DECL. The name of the default environment getter method needs to be changed when switching ORBs. More...

#define ACE_ENV_ARG_DECL_NOT_USED
 Similar to ACE_ENV_ARG_DECL, but the formal parameter name is dropped to avoid warnings about unused parameters. More...

#define ACE_ENV_SINGLE_ARG_DECL   ACE_ENV_EMIT_CODE(CORBA::Environment &ACE_TRY_ENV)
 Declare a CORBA::Environment argument for methods that do not take any other parameters. More...

#define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
 Declare a CORBA::Environment argument with a default value for methods that do not take any other parameters. The name of the default environment getter method needs to be changed when switching ORBs. More...

#define ACE_ENV_SINGLE_ARG_DECL_NOT_USED   ACE_ENV_EMIT_CODE(CORBA::Environment &)
 Declare a CORBA::Environment argument for for ethods. More...

#define ACE_ENV_ARG_PARAMETER
 Use the CORBA::Environment argument is a nested call. More...

#define ACE_ENV_SINGLE_ARG_PARAMETER   ACE_ENV_EMIT_CODE(ACE_TRY_ENV)
 Use the CORBA::Environment argument is a nested call, assuming the called function take only the ACE_TRY_ENV argument. More...

#define ACE_ENV_ARG_NOT_USED   ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV))
 Eliminate unused argument warnings about ACE_TRY_ENV. More...


Defines

#define ACE_TRY_ENV   _ACE_CORBA_Environment_variable
#define ACE_ANY_EXCEPTION   ex
#define ACE_CORBA_HAS_EXCEPTIONS
#define ACE_DECLARE_NEW_CORBA_ENV   CORBA::Environment ACE_TRY_ENV
#define ACE_ADOPT_CORBA_ENV(ENV)
#define ACE_CHECK
#define ACE_CHECK_RETURN(RETV)
#define ACE_THROW_INT(EXCEPTION)   throw EXCEPTION
#define ACE_THROW(EXCEPTION)   throw EXCEPTION
#define ACE_THROW_RETURN(EXCEPTION, RETV)   throw EXCEPTION
#define ACE_TRY
#define ACE_TRY_NEW_ENV
#define ACE_TRY_EX(LABEL)
#define ACE_TRY_CHECK
#define ACE_TRY_CHECK_EX(LABEL)
#define ACE_TRY_THROW(EXCEPTION)   throw EXCEPTION
#define ACE_TRY_THROW_EX(EXCEPTION, LABEL)   throw EXCEPTION
#define ACE_CATCH(EXCEPTION, VAR)
#define ACE_CATCHANY   ACE_CATCH(CORBA::Exception, ACE_ANY_EXCEPTION)
#define ACE_CATCHALL
#define ACE_RE_THROW   throw
#define ACE_RE_THROW_EX(LABEL)   throw
#define ACE_ENDTRY
#define ACE_NEW_THROW_EX(POINTER, CONSTRUCTOR, EXCEPTION)
#define ACE_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION)
#define ACE_READ_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION)
#define ACE_WRITE_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION)
#define ACE_ENV_RAISE(ex)   (ex)->_raise ()
#define ACE_PRINT_TAO_EXCEPTION(EX, INFO)   EX._tao_print_exception (INFO)
#define ACE_PRINT_EXCEPTION(EX, INFO)   ACE_PRINT_TAO_EXCEPTION(EX,INFO)

Detailed Description

CORBA_macros.h,v 1.29 2002/04/10 17:44:15 ossama Exp.

Writing code that is portable between platforms with or without native C++ exceptions is hard. The following macros offer some help on this task, mostly oriented to making the ORB code and the IDL generated code portable.

Author:
Nanbor Wang <nanbor@cs.wustl.edu> , Aniruddha Gokhale <gokhale@sahyadri.research.bell-labs.com> , Carlos O'Ryan <coryan@uci.edu>, et al.

Define Documentation

#define ACE_ADOPT_CORBA_ENV ENV   
 

#define ACE_ANY_EXCEPTION   ex
 

#define ACE_CATCH EXCEPTION,
VAR   
 

Value:

} \
       catch (EXCEPTION & VAR) \
         { \
           ACE_UNUSED_ARG (VAR);

#define ACE_CATCHALL
 

Value:

} \
       catch (...) \
         {

#define ACE_CATCHANY   ACE_CATCH(CORBA::Exception, ACE_ANY_EXCEPTION)
 

#define ACE_CHECK
 

#define ACE_CHECK_RETURN RETV   
 

#define ACE_CORBA_HAS_EXCEPTIONS
 

#define ACE_DECLARE_NEW_CORBA_ENV   CORBA::Environment ACE_TRY_ENV
 

#define ACE_ENDTRY
 

Value:

} \
     } while (0)

#define ACE_ENV_ARG_DECL
 

Value:

Normally this macro is used as follows:.

void my_funct (int x, int y ACE_ENV_ARG_DECL);

Its purpose is to provide CORBA developers (and users) with a mechanism to write code that is portable to platforms with and without native C++ exceptions.

#define ACE_ENV_ARG_DECL_NOT_USED
 

Value:

ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
                       CORBA::Environment &)
Similar to ACE_ENV_ARG_DECL, but the formal parameter name is dropped to avoid warnings about unused parameters.

#define ACE_ENV_ARG_DECL_WITH_DEFAULTS
 

Value:

ACE_ENV_EMIT_CODE2(ACE_ENV_EMIT_DUMMY, \
                       CORBA::Environment &ACE_TRY_ENV = \
                           TAO_default_environment ())
Declare a CORBA::Environment argument with the default value obtained from the ORB. Similar to ACE_ENV_ARG_DECL. The name of the default environment getter method needs to be changed when switching ORBs.

#define ACE_ENV_ARG_NOT_USED   ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV))
 

Eliminate unused argument warnings about ACE_TRY_ENV.

#define ACE_ENV_ARG_PARAMETER
 

Value:

Use the CORBA::Environment argument is a nested call.

#define ACE_ENV_EMIT_CODE  
 

Define a macro to emit code only when CORBA::Environment is used.

#define ACE_ENV_EMIT_CODE2 X,
 
 

Another macro to emit code only when CORBA::Environment is used.

#define ACE_ENV_EMIT_DUMMY
 

Helper macro.

#define ACE_ENV_RAISE ex       (ex)->_raise ()
 

#define ACE_ENV_SINGLE_ARG_DECL   ACE_ENV_EMIT_CODE(CORBA::Environment &ACE_TRY_ENV)
 

Declare a CORBA::Environment argument for methods that do not take any other parameters.

#define ACE_ENV_SINGLE_ARG_DECL_NOT_USED   ACE_ENV_EMIT_CODE(CORBA::Environment &)
 

Declare a CORBA::Environment argument for for ethods.

#define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
 

Value:

ACE_ENV_EMIT_CODE(CORBA::Environment &ACE_TRY_ENV = \
                          TAO_default_environment ())
Declare a CORBA::Environment argument with a default value for methods that do not take any other parameters. The name of the default environment getter method needs to be changed when switching ORBs.

#define ACE_ENV_SINGLE_ARG_PARAMETER   ACE_ENV_EMIT_CODE(ACE_TRY_ENV)
 

Use the CORBA::Environment argument is a nested call, assuming the called function take only the ACE_TRY_ENV argument.

#define ACE_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

ACE_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);

#define ACE_NEW_THROW_EX POINTER,
CONSTRUCTOR,
EXCEPTION   
 

Value:

do { POINTER = new CONSTRUCTOR; \
       if (POINTER == 0) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \
     } while (0)

#define ACE_PRINT_EXCEPTION EX,
INFO       ACE_PRINT_TAO_EXCEPTION(EX,INFO)
 

#define ACE_PRINT_TAO_EXCEPTION EX,
INFO       EX._tao_print_exception (INFO)
 

#define ACE_RE_THROW   throw
 

#define ACE_RE_THROW_EX LABEL       throw
 

#define ACE_READ_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

ACE_Read_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);

#define ACE_THROW EXCEPTION       throw EXCEPTION
 

#define ACE_THROW_INT EXCEPTION       throw EXCEPTION
 

#define ACE_THROW_RETURN EXCEPTION,
RETV       throw EXCEPTION
 

#define ACE_TRY
 

Value:

do \
     { \
       try \
         {

#define ACE_TRY_CHECK
 

#define ACE_TRY_CHECK_EX LABEL   
 

#define ACE_TRY_ENV   _ACE_CORBA_Environment_variable
 

#define ACE_TRY_EX LABEL   
 

Value:

do \
     { \
       try \
         {

#define ACE_TRY_NEW_ENV
 

Value:

do \
     { \
       CORBA::Environment ACE_TRY_ENV; \
       try \
         {

#define ACE_TRY_THROW EXCEPTION       throw EXCEPTION
 

#define ACE_TRY_THROW_EX EXCEPTION,
LABEL       throw EXCEPTION
 

#define ACE_WRITE_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

ACE_Write_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) ACE_THROW_INT (EXCEPTION);


Generated on Tue Aug 20 14:35:11 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001