Back to index

salome-kernel  6.5.0
Defines | Functions
Utils_CorbaException.hxx File Reference
#include "SALOME_Utils.hxx"
#include <SALOMEconfig.h>
#include <ostream>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define THROW_SALOME_CORBA_EXCEPTION(chain, typex)
 To raise a CORBA exception from a CORBA servant.

Functions

std::ostream & operator<< (std::ostream &os, const CORBA::Exception &e)

Define Documentation

#define THROW_SALOME_CORBA_EXCEPTION (   chain,
  typex 
)
Value:
{\
                SALOME::ExceptionStruct ExDescription; \
                ExDescription.text = CORBA::string_dup(chain); \
                ExDescription.type = typex; \
                ExDescription.sourceFile = CORBA::string_dup(__FILE__); \
                ExDescription.lineNumber = __LINE__; \
                throw SALOME::SALOME_Exception(ExDescription); \
              }

To raise a CORBA exception from a CORBA servant.

Definition at line 40 of file Utils_CorbaException.hxx.


Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CORBA::Exception &  e 
) [inline]

Definition at line 53 of file Utils_CorbaException.hxx.

{
  CORBA::Any tmp;
  tmp<<= e;
  CORBA::TypeCode_var tc = tmp.type();
  const char *p = tc->name();
  os<<"CORBA Exception was catch of the kind : ";
  if ( *p != '\0' ) {
    os<<p;
  } 
  else  { 
    os << tc->id();
  }
  
  return os;
}