Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions | Protected Member Functions

Standard_Failure Class Reference

Forms the root of the entire exception hierarchy. More...

#include <Standard_Failure.hxx>

Inheritance diagram for Standard_Failure:
Inheritance graph
[legend]

Public Member Functions

 Standard_Failure ()
 Creates a status object of type "Failure". More...
 
 Standard_Failure (const Standard_Failure &f)
 
 Standard_Failure (const Standard_CString aString)
 Creates a status object of type "Failure". More...
 
Standard_Failureoperator= (const Standard_Failure &f)
 
void Destroy ()
 
 ~Standard_Failure ()
 
void Print (Standard_OStream &s) const
 Prints on the stream <s> the exception name followed by the error message. Level: Advanced Warning: The operator "OStream& operator<< (Standard_OStream&, Handle(Standard_Failure)&)" is implemented. (This operator uses the method Print) More...
 
void operator<< (Standard_OStream &s) const
 
Standard_CString GetMessageString () const
 Returns error message. More...
 
void SetMessageString (const Standard_CString aMessage)
 Sets error message. More...
 
void Reraise ()
 
void Reraise (const Standard_CString aMessage)
 
void Reraise (const Standard_SStream &aReason)
 Reraises a caught exception and changes its error message. More...
 
void Jump () const
 Used to throw CASCADE exception from C signal handler. On platforms that do not allow throwing C++ exceptions from this handler (e.g. Linux), uses longjump to get to the current active signal handler, and only then is converted to C++ exception. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static void Raise (const Standard_CString aMessage="")
 Raises an exception of type "Failure" and associates an error message to it. The message can be printed in an exception handler. More...
 
static void Raise (const Standard_SStream &aReason)
 Raises an exception of type "Failure" and associates an error message to it. The message can be constructed at run-time. More...
 
static Handle< Standard_FailureNewInstance (const Standard_CString aMessage)
 Used to construct an instance of the exception object as a handle. Shall be used to protect against possible construction of exception object in C stack – that is dangerous since some of methods require that object was allocated dynamically. More...
 
static Handle< Standard_FailureCaught ()
 Returns the last caught exception. Needed when exceptions are emulated by C longjumps, in other cases is also provided for compatibility. More...
 

Protected Member Functions

virtual void Throw () const
 Used only if standard C++ exceptions are used. Throws exception of the same type as this by C++ throw, and stores current object as last thrown exception, to be accessible by method Caught() More...
 

Detailed Description

Forms the root of the entire exception hierarchy.

Constructor & Destructor Documentation

Standard_Failure::Standard_Failure ( )

Creates a status object of type "Failure".

Standard_Failure::Standard_Failure ( const Standard_Failure f)
Standard_Failure::Standard_Failure ( const Standard_CString  aString)

Creates a status object of type "Failure".

Standard_Failure::~Standard_Failure ( )
inline

Member Function Documentation

static Handle< Standard_Failure > Standard_Failure::Caught ( )
static

Returns the last caught exception. Needed when exceptions are emulated by C longjumps, in other cases is also provided for compatibility.

void Standard_Failure::Destroy ( )
Standard_CString Standard_Failure::GetMessageString ( ) const

Returns error message.

void Standard_Failure::Jump ( ) const

Used to throw CASCADE exception from C signal handler. On platforms that do not allow throwing C++ exceptions from this handler (e.g. Linux), uses longjump to get to the current active signal handler, and only then is converted to C++ exception.

static Handle< Standard_Failure > Standard_Failure::NewInstance ( const Standard_CString  aMessage)
static

Used to construct an instance of the exception object as a handle. Shall be used to protect against possible construction of exception object in C stack – that is dangerous since some of methods require that object was allocated dynamically.

void Standard_Failure::operator<< ( Standard_OStream s) const
inline
Standard_Failure& Standard_Failure::operator= ( const Standard_Failure f)
void Standard_Failure::Print ( Standard_OStream s) const

Prints on the stream <s> the exception name followed by the error message. Level: Advanced Warning: The operator "OStream& operator<< (Standard_OStream&, Handle(Standard_Failure)&)" is implemented. (This operator uses the method Print)

static void Standard_Failure::Raise ( const Standard_CString  aMessage = "")
static

Raises an exception of type "Failure" and associates an error message to it. The message can be printed in an exception handler.

static void Standard_Failure::Raise ( const Standard_SStream aReason)
static

Raises an exception of type "Failure" and associates an error message to it. The message can be constructed at run-time.

void Standard_Failure::Reraise ( )
void Standard_Failure::Reraise ( const Standard_CString  aMessage)
void Standard_Failure::Reraise ( const Standard_SStream aReason)

Reraises a caught exception and changes its error message.

void Standard_Failure::SetMessageString ( const Standard_CString  aMessage)

Sets error message.

virtual void Standard_Failure::Throw ( ) const
protectedvirtual

Used only if standard C++ exceptions are used. Throws exception of the same type as this by C++ throw, and stores current object as last thrown exception, to be accessible by method Caught()


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