// File generated by CPPExt (Transient)
//
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _Standard_Failure_HeaderFile
#define _Standard_Failure_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Standard_Failure_HeaderFile
#include <Handle_Standard_Failure.hxx>
#endif

#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Standard_Transient_HeaderFile
#include <Standard_Transient.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
#ifndef _Standard_SStream_HeaderFile
#include <Standard_SStream.hxx>
#endif
class Standard_NoSuchObject;



//!   Forms the root of the entire exception hierarchy. <br>
class Standard_Failure : public Standard_Transient {

public:
 // Methods PUBLIC
 // 


//!   Creates a status object of type "Failure". <br>
Standard_EXPORT Standard_Failure();
Standard_EXPORT Standard_Failure (const Standard_Failure& f);


//!   Creates a status object of type "Failure". <br>
Standard_EXPORT Standard_Failure(const Standard_CString aString);
Standard_EXPORT Standard_Failure& operator= (const Standard_Failure& f);


Standard_EXPORT   void Destroy() ;
~Standard_Failure()
{
  Destroy();
}



//!   Prints on the stream <s> the exception name followed by <br>
//!   the error message. <br>
//!  Level: Advanced <br>
//!  Warning: <br>
//!   The operator "OStream& operator<< (Standard_OStream&, <br>
//!                                      Handle(Standard_Failure)&)" <br>
//!   is implemented. (This operator uses the method Print) <br>
//! <br>
Standard_EXPORT   void Print(Standard_OStream& s) const;
  void operator<<(Standard_OStream& s) const
{
  Print(s);
}

//! Returns error message <br>
  Standard_CString GetMessageString() const;

//! Sets error message <br>
Standard_EXPORT   void SetMessageString(const Standard_CString aMessage) ;


Standard_EXPORT   void Reraise() ;

//! Reraises a caught exception and changes its error message. <br>
Standard_EXPORT   void Reraise(const Standard_CString aMessage) ;

//! Raises an exception of type "Failure" and associates <br>
//!          an error message to it. The message can be printed <br>
//!          in an exception handler. <br>
Standard_EXPORT static  void Raise(const Standard_CString aMessage = "") ;

//! Raises an exception of type "Failure" and associates <br>
//!          an error message to it. The message can be constructed <br>
//!          at run-time. <br>
Standard_EXPORT static  void Raise(Standard_SStream& aReason) ;

//! Used to construct an instance of the exception object <br>
//!          as a handle. Shall be used to protect against possible <br>
//!          construction of exception object in C stack -- that is <br>
//!          dangerous since some of methods require that object <br>
//!          was allocated dynamically. <br>
Standard_EXPORT static  Handle_Standard_Failure NewInstance(const Standard_CString aMessage) ;

//! Used to throw CASCADE exception from C signal handler. <br>
//!          On platforms that do not allow throwing C++ exceptions <br>
//!          from this handler (e.g. Linux), uses longjump to get to <br>
//!          the current active signal handler, and only then is <br>
//!          converted to C++ exception. <br>
Standard_EXPORT   void Jump() const;

//! Returns the last caught exception. <br>
//!          Needed when exceptions are emulated by C longjumps, <br>
//!          in other cases is also provided for compatibility. <br>
Standard_EXPORT static  Handle_Standard_Failure Caught() ;




 // Type management
 //
 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
 //Standard_EXPORT Standard_Boolean	       IsKind(const Handle(Standard_Type)&) const;

protected:

 // Methods PROTECTED
 // 

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


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
Standard_CString myMessage;


};


#include <Standard_Failure.lxx>



// other Inline functions and methods (like "C++: function call" methods)
//


#endif
