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

Exception.cpp File Reference

#include "tao_pch.h"
#include "ace/streams.h"
#include "ace/Dynamic_Service.h"
#include "ace/Malloc_Allocator.h"
#include "tao/Exception.h"
#include "tao/Typecode.h"
#include "tao/Environment.h"
#include "tao/Any.h"
#include "tao/CDR.h"
#include "tao/ORB.h"
#include "tao/ORB_Core.h"
#include "tao/Dynamic_Adapter.h"
#include "tao/Exception.i"

Include dependency graph for Exception.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define STANDARD_EXCEPTION_LIST
#define TAO_TC_BUF_LEN   256
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)
#define TAO_SYSTEM_EXCEPTION(name)

Functions

const char * get_rcsid_TAO_Exception (const char *)
ostream & operator<< (ostream &os, const CORBA_Exception &e)
STANDARD_EXCEPTION_LIST void tao_insert_for_insertion_system_exception (CORBA::Any &any, const CORBA::SystemException &ex, const char *msg)
STANDARD_EXCEPTION_LIST void tao_insert_system_exception (CORBA::Any &any, CORBA::SystemException *ex, CORBA::Any::_tao_destructor destructor, const char *msg)
STANDARD_EXCEPTION_LIST CORBA::Boolean tao_insert_in_extractor_system_exception (const CORBA::Any &any, CORBA::SystemException *&tmp, CORBA::SystemException *(*allocator)(void), CORBA::TypeCode_ptr tc_name, CORBA::Any::_tao_destructor destructor, const char *compare_IR_Id, const char *msg)

Variables

const char * rcsid_TAO_Exception = get_rcsid_TAO_Exception ( rcsid_TAO_Exception )
CORBA::TypeCode_ptr TC_completion_status


Define Documentation

#define STANDARD_EXCEPTION_LIST
 

Definition at line 1024 of file Exception.cpp.

Referenced by TAO_Exceptions::create_system_exception, TAO_Exceptions::fini, and TAO_Exceptions::init.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA::Boolean operator>>= (const CORBA::Any &any, \
                            const CORBA_##name *&ex) \
{ \
  ex = 0; \
  CORBA_SystemException *tmp; \
  if (tao_insert_in_extractor_system_exception (any, \
       tmp, \
       _tao_allocator_##name, \
       CORBA::_tc_##name, \
       CORBA_##name ::_tao_any_destructor, \
       "IDL:omg.org/CORBA/" #name ":1.0", \
       "\tCORBA::Any extraction of CORBA_" #name "\n") == 0) \
         { \
             ex = 0; \
         return 0; \
         } \
 ex = (CORBA_##name*)tmp; \
 return 1; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

static CORBA_SystemException* _tao_allocator_##name (void) \
{ \
  return new CORBA_##name; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

void operator<<= (CORBA::Any &any, CORBA_##name *ex) \
{ \
  tao_insert_system_exception (any, ex, \
          CORBA_##name ::_tao_any_destructor, \
          "\tCORBA::Any insertion (non-copy) of CORBA_" #name "\n" \
                               ); \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

void operator<<= (CORBA::Any &any, const CORBA_##name &ex) \
{ \
  tao_insert_for_insertion_system_exception (any, ex, \
            "\tCORBA::Any insertion (non-copy) of CORBA_" #name "\n" \
                               ); \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA_Exception * \
CORBA_##name ::_tao_duplicate (void) const \
{ \
  CORBA_Exception *result; \
  ACE_NEW_RETURN (result, CORBA_##name (*this), 0); \
  return result; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

void \
CORBA_##name ::_tao_any_destructor (void *x) \
{ \
  CORBA_##name *tmp = ACE_static_cast (CORBA_##name *, x); \
  delete tmp; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA::TypeCode_ptr \
CORBA_##name ::_type (void) const \
{ \
  return CORBA::_tc_ ## name; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA_##name :: CORBA_##name (void) \
  :  CORBA_SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
                            #name, \
                            TAO_DEFAULT_MINOR_CODE, \
                            CORBA::COMPLETED_NO) \
{ \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

void \
CORBA_##name ::_raise (void) \
{ \
  TAO_RAISE (*this); \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA_##name * \
CORBA_##name ::_downcast (CORBA_Exception* exception) \
{ \
  if (exception->_is_a ("IDL:omg.org/CORBA/" #name ":1.0")) \
    return ACE_dynamic_cast (CORBA_##name *, exception); \
  return 0; \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

int \
CORBA_##name ::_is_a (const char* interface_id) const \
{ \
  return ((ACE_OS_String::strcmp ( \
               interface_id, \
               "IDL:omg.org/CORBA/" #name ":1.0") == 0) \
          || CORBA_SystemException::_is_a (interface_id)); \
}

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

CORBA::release (CORBA::_tc_ ## name); \
  CORBA::_tc_ ## name = 0;

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

{ \
    const char* xid = "IDL:omg.org/CORBA/" #name ":1.0"; \
    if (ACE_OS_String::strcmp (id, xid) == 0) \
      return new CORBA:: name; \
  }

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

TAO_Exceptions::make_standard_typecode (CORBA::_tc_ ## name, \
                                          #name, \
                                          (char*)tc_buf_##name, \
                                          sizeof(tc_buf_##name) \
                                           ACE_ENV_ARG_PARAMETER); \
  ACE_CHECK;

Definition at line 1362 of file Exception.cpp.

#define TAO_SYSTEM_EXCEPTION name   
 

Value:

static CORBA::Long tc_buf_##name[TAO_TC_BUF_LEN/sizeof(CORBA::Long)]; \
    TAO_NAMESPACE_TYPE(CORBA::TypeCode_ptr) \
    TAO_NAMESPACE_BEGIN (CORBA) \
    TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_##name, 0) \
    TAO_NAMESPACE_END

Definition at line 1362 of file Exception.cpp.

#define TAO_TC_BUF_LEN   256
 

Definition at line 1071 of file Exception.cpp.


Function Documentation

const char* get_rcsid_TAO_Exception const char *    [inline, static]
 

Definition at line 29 of file Exception.cpp.

00029 : Exception.cpp,v 1.1.1.4.2.3 2003/05/19 16:25:41 chad Exp $")

ostream& operator<< ostream &    os,
const CORBA_Exception   e
 

Definition at line 155 of file Exception.cpp.

References CORBA_Exception::_name, and CORBA_Exception::_rep_id.

00157 {
00158   os << e._name () << " (" << e._rep_id () << ')';
00159 
00160   return os;
00161 }

STANDARD_EXCEPTION_LIST void tao_insert_for_insertion_system_exception CORBA::Any   any,
const CORBA::SystemException   ex,
const char *    msg
[static]
 

Definition at line 1219 of file Exception.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

01222 {
01223   ACE_DECLARE_NEW_CORBA_ENV;
01224   ACE_TRY
01225     {
01226       TAO_OutputCDR stream;
01227       ex._tao_encode (stream ACE_ENV_ARG_PARAMETER);
01228       ACE_TRY_CHECK;
01229       any._tao_replace (ex._type (),
01230                         TAO_ENCAP_BYTE_ORDER,
01231                         stream.begin ());
01232     }
01233   ACE_CATCHANY
01234     {
01235       ACE_PRINT_EXCEPTION (
01236           ACE_ANY_EXCEPTION,
01237           msg);
01238     }
01239   ACE_ENDTRY;
01240   ACE_CHECK;
01241 }

STANDARD_EXCEPTION_LIST CORBA::Boolean tao_insert_in_extractor_system_exception const CORBA::Any   any,
CORBA::SystemException *&    tmp,
CORBA::SystemException *(*    allocator)(void),
CORBA::TypeCode_ptr    tc_name,
CORBA::Any::_tao_destructor    destructor,
const char *    compare_IR_Id,
const char *    msg
[static]
 

Definition at line 1304 of file Exception.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, and ACE_OS_String::strcmp.

01312 {
01313   ACE_DECLARE_NEW_CORBA_ENV;
01314   ACE_TRY
01315     {
01316       CORBA::TypeCode_var type = any.type ();
01317       CORBA::Boolean equiv =
01318         type->equivalent (tc_name ACE_ENV_ARG_PARAMETER);
01319       ACE_TRY_CHECK;
01320       if (!equiv)
01321         return 0;
01322       if (any.any_owns_data ())
01323         {
01324           tmp = (CORBA_SystemException *)any.value ();
01325           return 1;
01326         }
01327       else
01328         {
01329           TAO_InputCDR stream (
01330               any._tao_get_cdr (),
01331               any._tao_byte_order ()
01332             );
01333           CORBA::String_var interface_repository_id;
01334           if (!(stream >> interface_repository_id.out ()))
01335             return 0;
01336           if (ACE_OS_String::strcmp (interface_repository_id.in (),
01337                                      compare_IR_Id))
01338             return 0;
01339           CORBA::SystemException *tmp = allocator ();
01340           tmp->_tao_decode (stream ACE_ENV_ARG_PARAMETER);
01341           ACE_TRY_CHECK;
01342           ((CORBA::Any *)&any)->_tao_replace (
01343               tc_name,
01344               1,
01345               tmp,
01346               destructor
01347             );
01348           return 1;
01349         }
01350     }
01351   ACE_CATCHANY
01352     {
01353       ACE_PRINT_EXCEPTION (
01354           ACE_ANY_EXCEPTION,
01355           msg
01356         );
01357     }
01358   ACE_ENDTRY;
01359   return 0;
01360 }

STANDARD_EXCEPTION_LIST void tao_insert_system_exception CORBA::Any   any,
CORBA::SystemException   ex,
CORBA::Any::_tao_destructor    destructor,
const char *    msg
[static]
 

Definition at line 1254 of file Exception.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

01258 {
01259   ACE_DECLARE_NEW_CORBA_ENV;
01260   ACE_TRY
01261     {
01262       TAO_OutputCDR stream;
01263       ex->_tao_encode (stream ACE_ENV_ARG_PARAMETER);
01264       ACE_TRY_CHECK;
01265       any._tao_replace (ex->_type (),
01266                         TAO_ENCAP_BYTE_ORDER,
01267                         stream.begin (),
01268                         1,
01269                         ex,
01270                         destructor);
01271     }
01272   ACE_CATCHANY
01273     {
01274       ACE_PRINT_EXCEPTION (
01275           ACE_ANY_EXCEPTION,
01276           msg
01277         );
01278     }
01279   ACE_ENDTRY;
01280   ACE_CHECK;
01281 }


Variable Documentation

const char* rcsid_TAO_Exception = get_rcsid_TAO_Exception ( rcsid_TAO_Exception ) [static]
 

Definition at line 29 of file Exception.cpp.

CORBA::TypeCode_ptr TC_completion_status
 

Definition at line 40 of file Exception.cpp.

Referenced by TAO_Exceptions::make_standard_typecode.


Generated on Mon Jun 16 14:06:33 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002