Defines

CORBA_macros.h File Reference

#include "ace/Exception_Macros.h"
Include dependency graph for CORBA_macros.h:

Go to the source code of this file.

Defines

#define ACE_ENV_POLLUTE_NAMES
#define ACE_del_bad_alloc
#define ACE_ENV_TYPE   CORBA::Environment
#define ACE_TRY_ENV   _ACE_CORBA_Environment_variable
#define ACE_EXCEPTION_TYPE   CORBA::Exception
#define ACE_DEFAULT_GET_ENV_METHOD   TAO_default_environment
#define ACE_ANY_EXCEPTION   ex
#define ACE_DECLARE_NEW_ENV   ACE_ENV_TYPE ACE_TRY_ENV
#define ACE_DECLARE_NEW_CORBA_ENV   ACE_DECLARE_NEW_ENV
#define ACE_ADOPT_CORBA_ENV(ENV)   ACE_ENV_TYPE &ACE_TRY_ENV = ENV
#define ACE_ADOPT_ENV(ENV)   ACE_ENV_TYPE &ACE_TRY_ENV = ENV
#define ACE_CHECK
#define ACE_CHECK_RETURN(RETV)
#define ACE_THROW_INT(EXCEPTION)   ACE_TRY_ENV.exception (new EXCEPTION)
#define ACE_THROW(EXCEPTION)
#define ACE_THROW_RETURN(EXCEPTION, RETV)
#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)
#define ACE_TRY_THROW_EX(EXCEPTION, LABEL)
#define ACE_CATCH(TYPE, VAR)
#define ACE_CATCHANY   ACE_CATCH (ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION)
#define ACE_CATCHALL   ACE_CATCHANY
#define ACE_RE_THROW
#define ACE_RE_THROW_EX(LABEL)
#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)   ACE_TRY_ENV.exception (ex)
#define ACE_PRINT_TAO_EXCEPTION(EX, INFO)   EX._tao_print_exception (INFO)
#define ACE_PRINT_EXCEPTION(EX, INFO)   ACE_PRINT_TAO_EXCEPTION(EX,INFO)
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 ACE_ENV_TYPE argument, but they collaborate with the ACE_TRY_* macros to emulate the try/catch blocks.

#define ACE_ENV_EMIT_CODE(X)   X
 Define a macro to emit code only when ACE_ENV_TYPE is used.
#define ACE_ENV_EMIT_CODE2(X, Y)   X,Y
 Another macro to emit code only when ACE_ENV_TYPE is used.
#define ACE_ENV_EMIT_DUMMY
 Helper macro.
#define ACE_ENV_ARG_DECL
#define ACE_ENV_ARG_DECL_WITH_DEFAULTS
#define ACE_ENV_ARG_DECL_NOT_USED
#define ACE_ENV_SINGLE_ARG_DECL   ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV)
#define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
#define ACE_ENV_SINGLE_ARG_DECL_NOT_USED   ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &)
 Declare a ACE_ENV_TYPE argument for methods which don't use it.
#define ACE_ENV_ARG_PARAMETER
 Use the ACE_ENV_TYPE argument in a nested call.
#define ACE_ENV_SINGLE_ARG_PARAMETER   ACE_ENV_EMIT_CODE(ACE_TRY_ENV)
#define ACE_ENV_ARG_NOT_USED   ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV))
 Eliminate unused argument warnings about ACE_TRY_ENV.

Detailed Description

Id:
CORBA_macros.h 80826 2008-03-04 14:51:23Z wotte

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.

Definition in file CORBA_macros.h.


Define Documentation

#define ACE_ADOPT_CORBA_ENV (   ENV  )     ACE_ENV_TYPE &ACE_TRY_ENV = ENV

Definition at line 237 of file CORBA_macros.h.

#define ACE_ADOPT_ENV (   ENV  )     ACE_ENV_TYPE &ACE_TRY_ENV = ENV

Definition at line 240 of file CORBA_macros.h.

#define ACE_ANY_EXCEPTION   ex

Definition at line 122 of file CORBA_macros.h.

#define ACE_CATCH (   TYPE,
  VAR 
)
Value:
} while (0); \
   do \
     if (ACE_TRY_ENV.exception () != 0 && ACE_EXCEPTION_NOT_CAUGHT && \
       TYPE::_downcast(ACE_TRY_ENV.exception ()) != 0) \
       { \
         ACE_ENV_TYPE ACE_CAUGHT_ENV = ACE_TRY_ENV;\
         ACE_EXCEPTION_NOT_CAUGHT = 0; \
         TYPE &VAR = *TYPE::_downcast (ACE_CAUGHT_ENV.exception ()); \
         ACE_UNUSED_ARG (VAR); \
         ACE_TRY_ENV.clear ();

Definition at line 358 of file CORBA_macros.h.

#define ACE_CATCHALL   ACE_CATCHANY

Definition at line 377 of file CORBA_macros.h.

#define ACE_CATCHANY   ACE_CATCH (ACE_EXCEPTION_TYPE, ACE_ANY_EXCEPTION)

Definition at line 372 of file CORBA_macros.h.

#define ACE_CHECK
Value:
if (ACE_TRY_ENV . exception () != 0) \
      return

Definition at line 245 of file CORBA_macros.h.

#define ACE_CHECK_RETURN (   RETV  ) 
Value:
if (ACE_TRY_ENV . exception () != 0) \
      return RETV

Definition at line 249 of file CORBA_macros.h.

#define ACE_DECLARE_NEW_CORBA_ENV   ACE_DECLARE_NEW_ENV

Definition at line 140 of file CORBA_macros.h.

#define ACE_DECLARE_NEW_ENV   ACE_ENV_TYPE ACE_TRY_ENV

Definition at line 132 of file CORBA_macros.h.

#define ACE_DEFAULT_GET_ENV_METHOD   TAO_default_environment

Definition at line 117 of file CORBA_macros.h.

#define ACE_del_bad_alloc

Definition at line 47 of file CORBA_macros.h.

#define ACE_ENDTRY
Value:
} while (0); \
    } while (0)

Definition at line 405 of file CORBA_macros.h.

#define ACE_ENV_ARG_DECL
Value:

Declare a ACE_ENV_TYPE argument as the last argument of a function Normally this macro is used as follows:

void my_funct (int x, int y ACE_ENV_ARG_DECL);

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

Definition at line 493 of file CORBA_macros.h.

#define ACE_ENV_ARG_DECL_NOT_USED
Value:

Declare a ACE_ENV_TYPE argument that is not used by the function definition. Similar to ACE_ENV_ARG_DECL, but the formal parameter name is dropped to avoid warnings about unused parameters

Definition at line 515 of file CORBA_macros.h.

#define ACE_ENV_ARG_DECL_WITH_DEFAULTS
Value:

Declare a ACE_ENV_TYPE argument with the default value obtained from the ORB/application. It is similar to ACE_ENV_ARG_DECL. The name of the default environment getter method needs to be changed when switching ORBs or when used with another application.

Definition at line 504 of file CORBA_macros.h.

#define ACE_ENV_ARG_NOT_USED   ACE_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACE_TRY_ENV))

Eliminate unused argument warnings about ACE_TRY_ENV.

Definition at line 547 of file CORBA_macros.h.

#define ACE_ENV_ARG_PARAMETER
Value:

Use the ACE_ENV_TYPE argument in a nested call.

Definition at line 537 of file CORBA_macros.h.

#define ACE_ENV_EMIT_CODE (   X  )     X

Define a macro to emit code only when ACE_ENV_TYPE is used.

Definition at line 467 of file CORBA_macros.h.

#define ACE_ENV_EMIT_CODE2 (   X,
  Y 
)    X,Y

Another macro to emit code only when ACE_ENV_TYPE is used.

Definition at line 474 of file CORBA_macros.h.

#define ACE_ENV_EMIT_DUMMY

Helper macro.

Definition at line 480 of file CORBA_macros.h.

#define ACE_ENV_POLLUTE_NAMES

Definition at line 33 of file CORBA_macros.h.

#define ACE_ENV_RAISE (   ex  )     ACE_TRY_ENV.exception (ex)

Definition at line 553 of file CORBA_macros.h.

#define ACE_ENV_SINGLE_ARG_DECL   ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &ACE_TRY_ENV)

Declare a ACE_ENV_TYPE argument for methods that do not take any other parameters

Definition at line 521 of file CORBA_macros.h.

#define ACE_ENV_SINGLE_ARG_DECL_NOT_USED   ACE_ENV_EMIT_CODE(ACE_ENV_TYPE &)

Declare a ACE_ENV_TYPE argument for methods which don't use it.

Definition at line 533 of file CORBA_macros.h.

#define ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
Value:

Declare a ACE_ENV_TYPE 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 or when used in another application.

Definition at line 528 of file CORBA_macros.h.

#define ACE_ENV_SINGLE_ARG_PARAMETER   ACE_ENV_EMIT_CODE(ACE_TRY_ENV)

Use the ACE_ENV_TYPE argument in a nested call, assuming that the called function takes only the ACE_TRY_ENV argument.

Definition at line 543 of file CORBA_macros.h.

#define ACE_ENV_TYPE   CORBA::Environment

Definition at line 91 of file CORBA_macros.h.

#define ACE_EXCEPTION_TYPE   CORBA::Exception

Definition at line 108 of file CORBA_macros.h.

#define ACE_GUARD_THROW_EX (   MUTEX,
  OBJ,
  LOCK,
  EXCEPTION 
)
Value:
ACE_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) throw EXCEPTION;

Definition at line 441 of file CORBA_macros.h.

#define ACE_NEW_THROW_EX (   POINTER,
  CONSTRUCTOR,
  EXCEPTION 
)
Value:
do { POINTER = new CONSTRUCTOR;                               \
    if (POINTER == 0) { throw EXCEPTION; }                      \
  } while (0)

Definition at line 434 of file CORBA_macros.h.

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

Definition at line 568 of file CORBA_macros.h.

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

Definition at line 561 of file CORBA_macros.h.

#define ACE_RE_THROW
Value:
do {\
      ACE_TRY_ENV = ACE_CAUGHT_ENV; \
      goto ACE_TRY_LABEL; \
    } while (0)

Definition at line 390 of file CORBA_macros.h.

#define ACE_RE_THROW_EX (   LABEL  ) 
Value:
do {\
      ACE_TRY_ENV = ACE_CAUGHT_ENV; \
      goto ACE_TRY_LABEL ## LABEL; \
    } while (0)

Definition at line 395 of file CORBA_macros.h.

#define ACE_READ_GUARD_THROW_EX (   MUTEX,
  OBJ,
  LOCK,
  EXCEPTION 
)
Value:
ACE_Read_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) throw EXCEPTION;

Definition at line 445 of file CORBA_macros.h.

#define ACE_THROW (   EXCEPTION  ) 
Value:
do \
      { \
        ACE_TRY_ENV.exception (new EXCEPTION); \
        return; \
      } while (0)

Definition at line 259 of file CORBA_macros.h.

#define ACE_THROW_INT (   EXCEPTION  )     ACE_TRY_ENV.exception (new EXCEPTION)

Definition at line 254 of file CORBA_macros.h.

#define ACE_THROW_RETURN (   EXCEPTION,
  RETV 
)
Value:
do \
      { \
        ACE_TRY_ENV.exception (new EXCEPTION); \
        return RETV; \
      } while (0)

Definition at line 266 of file CORBA_macros.h.

#define ACE_TRY
Value:
do { \
     int ACE_TRY_FLAG = 1; \
     int ACE_EXCEPTION_NOT_CAUGHT = 1; \
   ACE_TRY_LABEL: \
     if (ACE_TRY_FLAG) \
       do {

Definition at line 281 of file CORBA_macros.h.

#define ACE_TRY_CHECK
Value:
{ \
      if (ACE_TRY_ENV.exception () != 0) \
        { \
          ACE_TRY_FLAG = 0; \
          goto ACE_TRY_LABEL; \
        } \
    }

Definition at line 314 of file CORBA_macros.h.

#define ACE_TRY_CHECK_EX (   LABEL  ) 
Value:
{ \
      if (ACE_TRY_ENV.exception () != 0) \
        { \
          ACE_TRY_FLAG = 0; \
          goto ACE_TRY_LABEL ## LABEL; \
        } \
    }

Definition at line 324 of file CORBA_macros.h.

#define ACE_TRY_ENV   _ACE_CORBA_Environment_variable

Definition at line 100 of file CORBA_macros.h.

#define ACE_TRY_EX (   LABEL  ) 
Value:
do { \
     int ACE_TRY_FLAG = 1; \
     int ACE_EXCEPTION_NOT_CAUGHT = 1; \
   ACE_TRY_LABEL ## LABEL: \
     if (ACE_TRY_FLAG) \
       do {

Definition at line 305 of file CORBA_macros.h.

#define ACE_TRY_NEW_ENV
Value:
do { \
     ACE_DECLARE_NEW_ENV;\
     int ACE_TRY_FLAG = 1; \
     int ACE_EXCEPTION_NOT_CAUGHT = 1; \
   ACE_TRY_LABEL: \
     if (ACE_TRY_FLAG) \
       do {

Definition at line 292 of file CORBA_macros.h.

#define ACE_TRY_THROW (   EXCEPTION  ) 
Value:
{ \
      ACE_TRY_ENV.exception (new EXCEPTION); \
      ACE_TRY_FLAG = 0; \
      goto ACE_TRY_LABEL; \
    }

Definition at line 334 of file CORBA_macros.h.

#define ACE_TRY_THROW_EX (   EXCEPTION,
  LABEL 
)
Value:
{ \
      ACE_TRY_ENV.exception (new EXCEPTION); \
      ACE_TRY_FLAG = 0; \
      goto ACE_TRY_LABEL ## LABEL; \
    }

Definition at line 341 of file CORBA_macros.h.

#define ACE_WRITE_GUARD_THROW_EX (   MUTEX,
  OBJ,
  LOCK,
  EXCEPTION 
)
Value:
ACE_Write_Guard< MUTEX > OBJ (LOCK); \
    if (OBJ.locked () == 0) throw EXCEPTION;

Definition at line 449 of file CORBA_macros.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines