00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Unknown_User_Exception.h 00006 * 00007 * $Id: Unknown_User_Exception.h 80380 2008-01-07 13:11:49Z mcorino $ 00008 * 00009 * Defines the way an exception is reported by a DII request. 00010 * 00011 * 00012 * @author Portions Copyright 1994-1995 by Sun Microsystems Inc. 00013 * @author Portions Copyright 1997-2003 by Washington University 00014 */ 00015 //============================================================================= 00016 00017 00018 #ifndef TAO_UNKNOWN_USER_EXCEPTION_H 00019 #define TAO_UNKNOWN_USER_EXCEPTION_H 00020 00021 #include /**/ "ace/pre.h" 00022 00023 #include "tao/DynamicInterface/dynamicinterface_export.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 #include "tao/UserException.h" 00030 00031 #if defined (TAO_EXPORT_MACRO) 00032 #undef TAO_EXPORT_MACRO 00033 #endif 00034 #define TAO_EXPORT_MACRO TAO_DynamicInterface_Export 00035 00036 #if defined (TAO_EXPORT_NESTED_CLASSES) 00037 # if defined (TAO_EXPORT_NESTED_MACRO) 00038 # undef TAO_EXPORT_NESTED_MACRO 00039 # endif /* defined (TAO_EXPORT_NESTED_MACRO) */ 00040 # define TAO_EXPORT_NESTED_MACRO TAO_DynamicInterface_Export 00041 #endif /* TAO_EXPORT_NESTED_CLASSES */ 00042 00043 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00044 00045 namespace CORBA 00046 { 00047 /** 00048 * @class UnknownUserException 00049 * 00050 * @brief UnknownUserException 00051 * 00052 * When user exceptions are received by a DII invocation the ORB 00053 * is unable to create the exception with the right dynamic type; 00054 * to workaround this problem it throws a 00055 * @c CORBA::UnknownUserException that contains the exception inside 00056 * an Any. 00057 */ 00058 class TAO_DynamicInterface_Export UnknownUserException 00059 : public CORBA::UserException 00060 { 00061 public: 00062 00063 /// Constructor. 00064 UnknownUserException (void); 00065 00066 /// Constructor. 00067 UnknownUserException (CORBA::Any& exception); 00068 00069 /// Copy constructor. 00070 UnknownUserException (const UnknownUserException& e); 00071 00072 /// Destructor. 00073 virtual ~UnknownUserException (void); 00074 00075 /// Return the any containing the user exception. 00076 CORBA::Any& exception (void); 00077 00078 /// To throw an UnknownUserException of this type. 00079 virtual void _raise (void) const; 00080 00081 virtual CORBA::Exception *_tao_duplicate (void) const; 00082 virtual void _tao_encode (TAO_OutputCDR &cdr) const; 00083 virtual void _tao_decode (TAO_InputCDR &cdr); 00084 00085 /// Narrow to an UnknowUserException. 00086 static UnknownUserException * _downcast (CORBA::Exception *ex); 00087 static UnknownUserException const * _downcast (CORBA::Exception const * ex); 00088 00089 /// Return the repository ID of the Exception. 00090 virtual const char * _rep_id (void) const; 00091 00092 // = TAO specific extension. 00093 00094 /// This class has a specific typecode. 00095 virtual CORBA::TypeCode_ptr _tao_type (void) const; 00096 00097 private: 00098 /// Holder for the actual exception. 00099 CORBA::Any *exception_; 00100 }; 00101 00102 // The CORBA::UnknownUserException TypeCode. 00103 extern TAO_DynamicInterface_Export TypeCode_ptr const 00104 _tc_UnknownUserException; 00105 00106 } // End CORBA namespace. 00107 00108 TAO_END_VERSIONED_NAMESPACE_DECL 00109 00110 #include /**/ "ace/post.h" 00111 00112 #endif /* TAO_UNKNOWN_USER_EXCEPTION_H */