TAO 4.0.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CORBA::Exception Class Referenceabstract

Exception. More...

#include <Exception.h>

Inheritance diagram for CORBA::Exception:
Inheritance graph
[legend]
Collaboration diagram for CORBA::Exception:
Collaboration graph
[legend]

Public Member Functions

 Exception (const Exception &src)
 Copy constructor.
 
virtual ~Exception ()=default
 Destructor.
 
virtual void _raise () const =0
 
virtual const char * _rep_id () const
 Return the repository ID of the Exception.
 
virtual const char * _name () const
 Return the name of the Exception.
 
virtual CORBA::TypeCode_ptr _tao_type () const =0
 Will be overridden in the concrete derived classes.
 
void _tao_print_exception (const char *info, FILE *f=stdout) const
 Print the exception to output determined by f.
 
virtual ACE_CString _info () const =0
 
virtual void _tao_encode (TAO_OutputCDR &cdr) const =0
 
virtual void _tao_decode (TAO_InputCDR &cdr)=0
 
virtual CORBA::Exception_tao_duplicate () const =0
 Deep copy.
 

Static Public Member Functions

static Exception_downcast (Exception *x)
 
static Exception const * _downcast (Exception const *x)
 
static void _tao_any_destructor (void *)
 Used in the non-copying Any insertion operator.
 

Protected Member Functions

 Exception ()=default
 Default constructor.
 
Exceptionoperator= (const Exception &src)
 Assignment operator.
 
 Exception (const char *repository_id, const char *local_name)
 Construct from a repository id.
 

Private Attributes

CORBA::String_var id_
 Repository Id.
 
CORBA::String_var name_
 Local name.
 

Detailed Description

Exception.

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

Todo
According to the OMG CORBA C++ Mapping version 1.1, the copy constructors should be moved to "protected" section in class declarations. Since the current MS Visual C++ 7.1 compiler will cause some problems to TAO's exception mechanism, we defer doing this until we drop support for MSVC++ 7.1. Maybe there is another solution, have to test that later.

Constructor & Destructor Documentation

◆ Exception() [1/3]

CORBA::Exception::Exception ( const Exception & src)

Copy constructor.

Note
This constructor should be protected, but VC7.1 at warning level 4 complains about the inaccessible copy constructor preventing it from being caught. However, that probably isn't true for most cases since CORBA exceptions are typically caught by reference, not by copy.

◆ ~Exception()

virtual CORBA::Exception::~Exception ( )
virtualdefault

Destructor.

◆ Exception() [2/3]

CORBA::Exception::Exception ( )
protecteddefault

Default constructor.

◆ Exception() [3/3]

CORBA::Exception::Exception ( const char * repository_id,
const char * local_name )
protected

Construct from a repository id.

Member Function Documentation

◆ _downcast() [1/2]

CORBA::Exception * CORBA::Exception::_downcast ( CORBA::Exception * x)
static

◆ _downcast() [2/2]

CORBA::Exception const * CORBA::Exception::_downcast ( CORBA::Exception const * x)
static

◆ _info()

virtual ACE_CString CORBA::Exception::_info ( ) const
pure virtual

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

Implemented in CORBA::SystemException, and CORBA::UserException.

◆ _name()

const char * CORBA::Exception::_name ( ) const
virtual

Return the name of the Exception.

◆ _raise()

virtual void CORBA::Exception::_raise ( ) const
pure virtual

◆ _rep_id()

const char * CORBA::Exception::_rep_id ( ) const
virtual

Return the repository ID of the Exception.

◆ _tao_any_destructor()

void CORBA::Exception::_tao_any_destructor ( void * x)
static

Used in the non-copying Any insertion operator.

◆ _tao_decode()

virtual void CORBA::Exception::_tao_decode ( TAO_InputCDR & cdr)
pure virtual

◆ _tao_duplicate()

virtual CORBA::Exception * CORBA::Exception::_tao_duplicate ( ) 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:
  CORBA::Exception *_tao_duplicate () override const
  {
    CORBA::Exception *result {};
    ACE_NEW_RETURN (
        result,
        SomeException (*this),
        nullptr);
    return result;
  }
};

Implemented in CORBA::ORB::InvalidName, CORBA::SystemException, and CORBA::WrongTransaction.

◆ _tao_encode()

virtual void CORBA::Exception::_tao_encode ( TAO_OutputCDR & cdr) const
pure virtual

◆ _tao_print_exception()

void CORBA::Exception::_tao_print_exception ( const char * info,
FILE * f = stdout ) const

Print the exception to output determined by f.

Note
This method is TAO-specific.

◆ _tao_type()

virtual CORBA::TypeCode_ptr CORBA::Exception::_tao_type ( ) const
pure virtual

Will be overridden in the concrete derived classes.

Implemented in CORBA::UserException, and CORBA::WrongTransaction.

◆ operator=()

CORBA::Exception & CORBA::Exception::operator= ( const Exception & src)
protected

Assignment operator.

Member Data Documentation

◆ id_

CORBA::String_var CORBA::Exception::id_
private

Repository Id.

◆ name_

CORBA::String_var CORBA::Exception::name_
private

Local name.


The documentation for this class was generated from the following files: