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

XML_Macros.h File Reference

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

Include dependency graph for XML_Macros.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of 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. More...

#define ACEXML_ENV_EMIT_CODE2(X, Y)
 Another macro to emit code only when ACEXML_ENV_TYPE is used. More...

#define ACEXML_ENV_EMIT_DUMMY
 Helper macro. More...

#define ACEXML_ENV_ARG_DECL
 Declare a ACEXML_ENV_TYPE argument as the last argument of a function. More...

#define ACEXML_ENV_ARG_DECL_NOT_USED
 Declare a ACEXML_ENV_TYPE argument that is not used by the function definition. More...

#define ACEXML_ENV_SINGLE_ARG_DECL   ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &ACEXML_TRY_ENV)
 Declare a ACEXML_ENV_TYPE argument for methods that do not take any other parameters. More...

#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. More...

#define ACEXML_ENV_ARG_PARAMETER
 Use the ACEXML_ENV_TYPE argument in a nested call. More...

#define ACEXML_ENV_SINGLE_ARG_PARAMETER   ACEXML_ENV_EMIT_CODE(ACEXML_TRY_ENV)
 Use the ACEXML_ENV_TYPE argument in a nested call, assuming that the called function takes only the ACEXML_TRY_ENV argument. More...

#define ACEXML_ENV_ARG_NOT_USED   ACEXML_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACEXML_TRY_ENV))
 Eliminate unused argument warnings about ACEXML_TRY_ENV. More...


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 ()


Detailed Description

Id:
XML_Macros.h,v 1.1.1.1 2003/02/21 18:36:32 chad 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.

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

Definition in file XML_Macros.h.


Define Documentation

#define ACEXML_ADOPT_ENV   (ENV)
 

Definition at line 72 of file XML_Macros.h.

#define ACEXML_ANY_EXCEPTION   ex
 

Definition at line 61 of file XML_Macros.h.

#define ACEXML_CATCH EXCEPTION,
VAR   
 

Value:

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

Definition at line 132 of file XML_Macros.h.

#define ACEXML_CATCHALL
 

Value:

} \
       catch (...) \
         {

Definition at line 141 of file XML_Macros.h.

#define ACEXML_CATCHANY   ACEXML_CATCH(ACEXML_EXCEPTION_TYPE, ACEXML_ANY_EXCEPTION)
 

Definition at line 138 of file XML_Macros.h.

#define ACEXML_CHECK
 

Definition at line 76 of file XML_Macros.h.

#define ACEXML_CHECK_RETURN RETV   
 

Definition at line 79 of file XML_Macros.h.

#define ACEXML_DECLARE_NEW_ENV   ACEXML_ENV_TYPE ACEXML_TRY_ENV
 

Definition at line 66 of file XML_Macros.h.

#define ACEXML_ENDTRY
 

Value:

} \
     } while (0)

Definition at line 151 of file XML_Macros.h.

#define ACEXML_ENV_ARG_DECL
 

Value:

Declare a ACEXML_ENV_TYPE argument as the last argument of a function.

Normally this macro is used as follows:

void my_funct (int x, int y ACEXML_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 396 of file XML_Macros.h.

Referenced by Basic_Content_Tester::characters, ACEXML_Svcconf_Handler::endElement, ACEXML_Svcconf_Handler::get_dynamic_attrs, ACEXML_Svcconf_Handler::get_id, ACEXML_Svcconf_Handler::get_initializer_attrs, ACEXML_Svcconf_Handler::get_static_attrs, ACEXML_Svcconf_Handler::get_stream_id, ACEXML_Debug_DTD_Manager::getValidator, ACEXML_Debug_Attributes_Builder::insertAttribute, ACEXML_Debug_DTD_Manager::insertAttributes_Definition, ACEXML_Debug_DTD_Manager::insertElement_Definition, ACEXML_XMLFilterImpl::parse, ACEXML_Debug_Attribute_Builder::setAttType, and ACEXML_Debug_Element_Builder::setContentType.

#define ACEXML_ENV_ARG_DECL_NOT_USED
 

Value:

Declare a ACEXML_ENV_TYPE argument that is not used by the function definition.

Similar to ACEXML_ENV_ARG_DECL, but the formal parameter name is dropped to avoid warnings about unused parameters

Definition at line 406 of file XML_Macros.h.

Referenced by ACEXML_Svcconf_Handler::characters, ACEXML_DefaultHandler::characters, ACEXML_Debug_Element_Builder::endChildGroup, ACEXML_SAXPrint_Handler::endElement, ACEXML_Print_Handler::endElement, ACEXML_SAXPrint_Handler::endPrefixMapping, ACEXML_Print_Handler::endPrefixMapping, ACEXML_Svcconf_Handler::ignorableWhitespace, ACEXML_SAXPrint_Handler::ignorableWhitespace, ACEXML_Print_Handler::ignorableWhitespace, ACEXML_DefaultHandler::ignorableWhitespace, ACEXML_Debug_Element_Builder::insertElement, ACEXML_Debug_Element_Builder::insertMixedElement, ACEXML_SAXPrint_Handler::processingInstruction, ACEXML_Print_Handler::processingInstruction, ACEXML_Debug_Attribute_Builder::setDefault, ACEXML_Debug_Attributes_Builder::setElement, ACEXML_Debug_Element_Builder::setElementName, ACEXML_SAXPrint_Handler::skippedEntity, ACEXML_Print_Handler::skippedEntity, ACEXML_SAXPrint_Handler::startPrefixMapping, ACEXML_Print_Handler::startPrefixMapping, and ACEXML_Print_Handler::unparsedEntityDecl.

#define ACEXML_ENV_ARG_NOT_USED   ACEXML_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACEXML_TRY_ENV))
 

Eliminate unused argument warnings about ACEXML_TRY_ENV.

Definition at line 430 of file XML_Macros.h.

#define ACEXML_ENV_ARG_PARAMETER
 

Value:

Use the ACEXML_ENV_TYPE argument in a nested call.

Definition at line 420 of file XML_Macros.h.

Referenced by ACEXML_XMLFilterImpl::parse.

#define ACEXML_ENV_EMIT_CODE  
 

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

Definition at line 372 of file XML_Macros.h.

#define ACEXML_ENV_EMIT_CODE2 X,
 
 

Another macro to emit code only when ACEXML_ENV_TYPE is used.

Definition at line 379 of file XML_Macros.h.

#define ACEXML_ENV_EMIT_DUMMY
 

Helper macro.

Definition at line 383 of file XML_Macros.h.

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

Definition at line 438 of file XML_Macros.h.

#define ACEXML_ENV_SINGLE_ARG_DECL   ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &ACEXML_TRY_ENV)
 

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

Definition at line 412 of file XML_Macros.h.

#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.

Definition at line 416 of file XML_Macros.h.

Referenced by ACEXML_Svcconf_Handler::endDocument, ACEXML_SAXPrint_Handler::endDocument, ACEXML_Print_Handler::endDocument, ACEXML_DefaultHandler::endDocument, ACEXML_Svcconf_Handler::startDocument, ACEXML_SAXPrint_Handler::startDocument, ACEXML_Print_Handler::startDocument, and ACEXML_DefaultHandler::startDocument.

#define ACEXML_ENV_SINGLE_ARG_PARAMETER   ACEXML_ENV_EMIT_CODE(ACEXML_TRY_ENV)
 

Use the ACEXML_ENV_TYPE argument in a nested call, assuming that the called function takes only the ACEXML_TRY_ENV argument.

Definition at line 426 of file XML_Macros.h.

#define ACEXML_ENV_TYPE   ACEXML_Env
 

Definition at line 40 of file XML_Macros.h.

#define ACEXML_EXCEPTION_TYPE   ACEXML_Exception
 

Definition at line 56 of file XML_Macros.h.

#define ACEXML_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

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

Definition at line 346 of file XML_Macros.h.

#define ACEXML_NEW_THROW_EX POINTER,
CONSTRUCTOR,
EXCEPTION   
 

Value:

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

Definition at line 339 of file XML_Macros.h.

#define ACEXML_RE_THROW   throw
 

Definition at line 147 of file XML_Macros.h.

#define ACEXML_RE_THROW_EX LABEL       throw
 

Definition at line 148 of file XML_Macros.h.

#define ACEXML_READ_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

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

Definition at line 350 of file XML_Macros.h.

#define ACEXML_THROW EXCEPTION       throw EXCEPTION
 

Definition at line 87 of file XML_Macros.h.

Referenced by Basic_Content_Tester::characters, and ACEXML_XMLFilterImpl::parse.

#define ACEXML_THROW_R_INT EXCEPTION       throw EXCEPTION
 

Definition at line 82 of file XML_Macros.h.

#define ACEXML_THROW_RETURN EXCEPTION,
RETV       throw EXCEPTION
 

Definition at line 99 of file XML_Macros.h.

Referenced by ACEXML_Debug_DTD_Manager::getValidator, ACEXML_Debug_Attributes_Builder::insertAttribute, ACEXML_Debug_DTD_Manager::insertAttributes_Definition, ACEXML_Debug_DTD_Manager::insertElement_Definition, ACEXML_Debug_Attribute_Builder::setAttType, and ACEXML_Debug_Element_Builder::setContentType.

#define ACEXML_TRY
 

Value:

do \
     { \
       try \
         {

Definition at line 105 of file XML_Macros.h.

#define ACEXML_TRY_CHECK
 

Definition at line 124 of file XML_Macros.h.

#define ACEXML_TRY_CHECK_EX LABEL   
 

Definition at line 125 of file XML_Macros.h.

#define ACEXML_TRY_ENV   _ACEXML_Env_variable
 

Definition at line 49 of file XML_Macros.h.

#define ACEXML_TRY_EX LABEL   
 

Value:

do \
     { \
       try \
         {

Definition at line 116 of file XML_Macros.h.

#define ACEXML_TRY_NEW_ENV
 

Value:

do \
     { \
       ACEXML_ENV_TYPE ACEXML_TRY_ENV; \
       try \
         {

Definition at line 110 of file XML_Macros.h.

#define ACEXML_TRY_THROW EXCEPTION       throw EXCEPTION
 

Definition at line 128 of file XML_Macros.h.

#define ACEXML_TRY_THROW_EX EXCEPTION,
LABEL       throw EXCEPTION
 

Definition at line 129 of file XML_Macros.h.

#define ACEXML_WRITE_GUARD_THROW_EX MUTEX,
OBJ,
LOCK,
EXCEPTION   
 

Value:

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

Definition at line 354 of file XML_Macros.h.


Generated on Mon Jun 16 13:26:10 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002