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

CORBA_Exception Class Reference

CORBA_Exception. More...

#include <Exception.h>

Inheritance diagram for CORBA_Exception:

Inheritance graph
[legend]
List of all members.

Public Methods

 CORBA_Exception (const CORBA_Exception &src)
 Copy constructor. More...

CORBA_Exception & operator= (const CORBA_Exception &src)
 Assignment operator. More...

virtual ~CORBA_Exception (void)
 Destructor. More...

virtual void _raise (void)=0
const char * _rep_id (void) const
 Return the repository ID of the Exception. More...

const char * _name (void) const
 Return the name of the Exception. More...

virtual CORBA::TypeCode_ptr _type (void) const
 Will be overridden in the concrete derived classes. More...

virtual int _is_a (const char *repository_id) const
 CORBA_Exception (const char *repository_id, const char *local_name)
 Constructor from a respository id. More...

void _tao_print_exception (const char *info, FILE *f=stdout) const
 Print the exception <ex> to output determined by <f>. This function is not CORBA compliant. More...

virtual ACE_CString _info (void) const=0
 Returns a string containing information about the exception. This function is not CORBA compliant. More...

virtual void _tao_encode (TAO_OutputCDR &cdr ACE_ENV_ARG_DECL_NOT_USED) const=0
virtual void _tao_decode (TAO_InputCDR &cdr ACE_ENV_ARG_DECL_NOT_USED)=0
virtual CORBA_Exception * _tao_duplicate (void) const=0
 Deep copy. More...


Static Public Methods

CORBA_Exception * _downcast (CORBA_Exception *x)
void _tao_any_destructor (void *)
 Used in the non-copying Any insertion operator. More...


Protected Methods

 CORBA_Exception (void)

Private Attributes

char * id_
 Storage of our repository id and local name. More...

char * name_

Detailed Description

CORBA_Exception.

CORBA2-specified exception hierarchy. All exceptions have a type (represented by a TypeCode) and a widely scoped type ID (in the TypeCode) that generated by any OMG-IDL compiler and available through the Interface Repositories. Think of it as a "globally scoped" name distinguishing each exception.

Definition at line 52 of file Exception.h.


Constructor & Destructor Documentation

CORBA_Exception::CORBA_Exception const CORBA_Exception &    src
 

Copy constructor.

Definition at line 52 of file Exception.cpp.

References ACE_ASSERT, and CORBA::string_dup.

00053   : id_ (CORBA::string_dup (src.id_)),
00054     name_ (CORBA::string_dup (src.name_))
00055 {
00056   ACE_ASSERT (this->id_ != 0 && this->name_ != 0);
00057 }

CORBA_Exception::~CORBA_Exception void    [virtual]
 

Destructor.

Definition at line 69 of file Exception.cpp.

References CORBA::string_free.

00070 {
00071   CORBA::string_free (this->id_);
00072   CORBA::string_free (this->name_);
00073 }

CORBA_Exception::CORBA_Exception const char *    repository_id,
const char *    local_name
 

Constructor from a respository id.

Definition at line 44 of file Exception.cpp.

References ACE_ASSERT, and CORBA::string_dup.

00046   : id_ (CORBA::string_dup (repository_id)),
00047     name_ ( CORBA::string_dup (local_name))
00048 {
00049   ACE_ASSERT (this->id_ != 0 && this->name_ != 0);
00050 }

CORBA_Exception::CORBA_Exception void    [protected]
 

Definition at line 63 of file Exception.cpp.

00064   : id_ (0),
00065     name_ (0)
00066 {
00067 }


Member Function Documentation

ACE_INLINE CORBA_Exception * CORBA_Exception::_downcast CORBA_Exception *    x [static]
 

Reimplemented in CORBA_UserException.

Definition at line 5 of file Exception.i.

00006 {
00007   return x;
00008 }

virtual ACE_CString CORBA_Exception::_info void    const [pure virtual]
 

Returns a string containing information about the exception. This function is not CORBA compliant.

Implemented in CORBA_UserException.

int CORBA_Exception::_is_a const char *    repository_id const [virtual]
 

Reimplemented in CORBA_UserException.

Definition at line 116 of file Exception.cpp.

References ACE_OS_String::strcmp.

Referenced by CORBA_TypeCode::BadKind::_downcast, CORBA_TypeCode::Bounds::_downcast, CORBA_SystemException::_downcast, CORBA_UserException::_downcast, CORBA_SystemException::_is_a, and CORBA_UserException::_is_a.

00117 {
00118   return ACE_OS_String::strcmp (repository_id,
00119                                 "IDL:omg.org/CORBA/Exception:1.0") == 0;
00120 }

const char * CORBA_Exception::_name void    const
 

Return the name of the Exception.

Definition at line 104 of file Exception.cpp.

References name_.

Referenced by operator<<.

00105 {
00106   return this->name_;
00107 }

virtual void CORBA_Exception::_raise void    [pure virtual]
 

Implemented in CORBA_TypeCode::Bounds.

const char * CORBA_Exception::_rep_id void    const
 

Return the repository ID of the Exception.

Definition at line 98 of file Exception.cpp.

References id_.

Referenced by CORBA_SystemException::_info, CORBA_UserException::_info, CORBA_TypeCode::BadKind::_tao_encode, CORBA_TypeCode::Bounds::_tao_encode, CORBA_Environment::exception_id, and operator<<.

00099 {
00100   return this->id_;
00101 }

void CORBA_Exception::_tao_any_destructor void *    [static]
 

Used in the non-copying Any insertion operator.

Definition at line 146 of file Exception.cpp.

Referenced by CORBA_Any::operator<<=.

00147 {
00148   CORBA_Exception *tmp = ACE_static_cast (CORBA_Exception *, x);
00149   delete tmp;
00150 }

virtual void CORBA_Exception::_tao_decode TAO_InputCDR &cdr    ACE_ENV_ARG_DECL_NOT_USED [pure virtual]
 

Implemented in CORBA_SystemException.

virtual CORBA_Exception* CORBA_Exception::_tao_duplicate void    const [pure virtual]
 

Deep copy.

The following operation is used in the implementation of it performs a deep copy of the exception, normally it is implemented as:

 class SomeException : public // Derives from CORBA_Exception
 {
 public:
   virtual CORBA_Exception *_tao_duplicate (void) const
   {
     return new SomeException (*this);
   }
 };
 

Implemented in CORBA_TypeCode::Bounds.

Referenced by CORBA_Environment::CORBA_Environment.

virtual void CORBA_Exception::_tao_encode TAO_OutputCDR &cdr    ACE_ENV_ARG_DECL_NOT_USED const [pure virtual]
 

Implemented in CORBA_SystemException.

Referenced by CORBA_Any::operator<<=.

void CORBA_Exception::_tao_print_exception const char *    info,
FILE *    f = stdout
const
 

Print the exception <ex> to output determined by <f>. This function is not CORBA compliant.

Definition at line 123 of file Exception.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_TEXT_CHAR_TO_TCHAR, and LM_ERROR.

00125 {
00126   ACE_DEBUG ((LM_ERROR,
00127               ACE_LIB_TEXT("(%P|%t) EXCEPTION, %s\n")
00128               ACE_LIB_TEXT("%s\n"),
00129               ACE_TEXT_CHAR_TO_TCHAR(user_provided_info),
00130               ACE_TEXT_CHAR_TO_TCHAR(this->_info ().c_str ())));
00131 }

CORBA::TypeCode_ptr CORBA_Exception::_type void    const [virtual]
 

Will be overridden in the concrete derived classes.

Definition at line 110 of file Exception.cpp.

Referenced by CORBA_Any::operator<<=.

00111 {
00112   return CORBA::TypeCode::_nil ();
00113 }

CORBA_Exception & CORBA_Exception::operator= const CORBA_Exception &    src
 

Assignment operator.

Definition at line 76 of file Exception.cpp.

References ACE_ASSERT, id_, name_, CORBA::string_dup, and CORBA::string_free.

Referenced by CORBA_SystemException::operator=, and CORBA_UserException::operator=.

00077 {
00078   if (this->id_)
00079     {
00080       CORBA::string_free (this->id_);
00081     }
00082 
00083   this->id_ = CORBA::string_dup (src.id_);
00084   ACE_ASSERT (this->id_ != 0);
00085 
00086   if (this->name_)
00087     {
00088       CORBA::string_free (this->name_);
00089     }
00090 
00091   this->name_ = CORBA::string_dup (src.name_);
00092   ACE_ASSERT (this->name_ != 0);
00093 
00094   return *this;
00095 }


Member Data Documentation

char* CORBA_Exception::id_ [private]
 

Storage of our repository id and local name.

Definition at line 138 of file Exception.h.

Referenced by _rep_id, and operator=.

char* CORBA_Exception::name_ [private]
 

Definition at line 139 of file Exception.h.

Referenced by _name, and operator=.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 14:57:41 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002