#include "ace/config-all.h"
#include "ace/Exception_Macros.h"
Include dependency graph for XML_Macros.h:
This graph shows which files directly or indirectly include this file:
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 ACEXML_ENV_TYPE argument, but they collaborate with the ACEXML_TRY_* macros to emulate the try/catch blocks. | |
#define | ACEXML_ENV_EMIT_CODE(X) |
Define a macro to emit code only when ACEXML_ENV_TYPE is used. | |
#define | ACEXML_ENV_EMIT_CODE2(X, Y) |
Another macro to emit code only when ACEXML_ENV_TYPE is used. | |
#define | ACEXML_ENV_EMIT_DUMMY |
Helper macro. | |
#define | ACEXML_ENV_ARG_DECL |
#define | ACEXML_ENV_ARG_DECL_NOT_USED |
#define | ACEXML_ENV_SINGLE_ARG_DECL ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &ACEXML_TRY_ENV) |
#define | ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &) |
Declare a ACEXML_ENV_TYPE argument for methods which don't use it. | |
#define | ACEXML_ENV_ARG_PARAMETER |
Use the ACEXML_ENV_TYPE argument in a nested call. | |
#define | ACEXML_ENV_SINGLE_ARG_PARAMETER ACEXML_ENV_EMIT_CODE(ACEXML_TRY_ENV) |
#define | ACEXML_ENV_ARG_NOT_USED ACEXML_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACEXML_TRY_ENV)) |
Eliminate unused argument warnings about ACEXML_TRY_ENV. | |
Defines | |
#define | ACEXML_ENV_TYPE ACEXML_Env |
#define | ACEXML_TRY_ENV _ACEXML_Env_variable |
#define | ACEXML_EXCEPTION_TYPE ACEXML_Exception |
#define | ACEXML_ANY_EXCEPTION ex |
#define | ACEXML_DECLARE_NEW_ENV ACEXML_ENV_TYPE ACEXML_TRY_ENV |
#define | ACEXML_ADOPT_ENV (ENV) |
#define | ACEXML_CHECK |
#define | ACEXML_CHECK_RETURN(RETV) |
#define | ACEXML_THROW_R_INT(EXCEPTION) throw EXCEPTION |
#define | ACEXML_THROW(EXCEPTION) throw EXCEPTION |
#define | ACEXML_THROW_RETURN(EXCEPTION, RETV) throw EXCEPTION |
#define | ACEXML_TRY |
#define | ACEXML_TRY_NEW_ENV |
#define | ACEXML_TRY_EX(LABEL) |
#define | ACEXML_TRY_CHECK |
#define | ACEXML_TRY_CHECK_EX(LABEL) |
#define | ACEXML_TRY_THROW(EXCEPTION) throw EXCEPTION |
#define | ACEXML_TRY_THROW_EX(EXCEPTION, LABEL) throw EXCEPTION |
#define | ACEXML_CATCH(EXCEPTION, VAR) |
#define | ACEXML_CATCHANY ACEXML_CATCH(ACEXML_EXCEPTION_TYPE, ACEXML_ANY_EXCEPTION) |
#define | ACEXML_CATCHALL |
#define | ACEXML_RE_THROW throw |
#define | ACEXML_RE_THROW_EX(LABEL) throw |
#define | ACEXML_ENDTRY |
#define | ACEXML_NEW_THROW_EX(POINTER, CONSTRUCTOR, EXCEPTION) |
#define | ACEXML_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION) |
#define | ACEXML_READ_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION) |
#define | ACEXML_WRITE_GUARD_THROW_EX(MUTEX, OBJ, LOCK, EXCEPTION) |
#define | ACEXML_ENV_RAISE(ex) (ex)->_raise () |
Writing code that is portable between platforms with or without native C++ exceptions is hard. The following macros offer some help on this task.
Aniruddha Gokhale <gokhale@sahyadri.research.bell-labs.com>
Carlos O'Ryan <coryan@uci.edu>
Krishnakumar B <kitty@cs.wustl.edu>, et al.
|
|
|
|
|
Value: } \ catch (EXCEPTION & VAR) \ { \ ACE_UNUSED_ARG (VAR); |
|
Value: } \
catch (...) \
{
|
|
|
|
|
|
|
|
|
|
Value: } \
} while (0)
|
|
Value: ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ ACEXML_ENV_TYPE &ACEXML_TRY_ENV)
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. |
|
Value: ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ ACEXML_ENV_TYPE &) |
|
Eliminate unused argument warnings about ACEXML_TRY_ENV.
|
|
Value: ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ ACEXML_TRY_ENV)
|
|
Define a macro to emit code only when ACEXML_ENV_TYPE is used.
|
|
Another macro to emit code only when ACEXML_ENV_TYPE is used.
|
|
Helper macro.
|
|
|
|
Declare a ACEXML_ENV_TYPE argument for methods that do not take any other parameters |
|
Declare a ACEXML_ENV_TYPE argument for methods which don't use it.
|
|
Use the ACEXML_ENV_TYPE argument in a nested call, assuming that the called function takes only the ACEXML_TRY_ENV argument. |
|
|
|
|
|
Value: ACE_Guard< MUTEX > OBJ (LOCK); \ if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); |
|
Value: do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; ACEXML_THROW_R_INT (EXCEPTION); } \ } while (0) |
|
|
|
|
|
Value: ACE_Read_Guard< MUTEX > OBJ (LOCK); \ if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); |
|
|
|
|
|
|
|
Value: do \ { \ try \ { |
|
|
|
|
|
|
|
Value: do \ { \ try \ { |
|
Value: do \ { \ ACEXML_ENV_TYPE ACEXML_TRY_ENV; \ try \ { |
|
|
|
|
|
Value: ACE_Write_Guard< MUTEX > OBJ (LOCK); \ if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); |