2009-01-13 04:40:13 +05:00
|
|
|
#ifndef FILE_NGEXCEPTION
|
|
|
|
#define FILE_NGEXCEPTION
|
|
|
|
|
|
|
|
/**************************************************************************/
|
|
|
|
/* File: ngexception.hpp */
|
|
|
|
/* Author: Joachim Schoeberl */
|
|
|
|
/* Date: 16. Jan. 2002 */
|
|
|
|
/**************************************************************************/
|
|
|
|
|
2009-07-20 14:36:36 +06:00
|
|
|
namespace netgen
|
|
|
|
{
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
/// Base class for all ng exceptions
|
2017-08-24 16:59:16 +05:00
|
|
|
class NgException : public std::exception
|
2009-01-13 04:40:13 +05:00
|
|
|
{
|
|
|
|
/// verbal description of exception
|
2017-08-24 16:59:16 +05:00
|
|
|
string m_what;
|
2009-01-13 04:40:13 +05:00
|
|
|
public:
|
|
|
|
///
|
2011-03-04 02:42:20 +05:00
|
|
|
DLL_HEADER NgException (const string & s);
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2011-03-04 02:42:20 +05:00
|
|
|
DLL_HEADER virtual ~NgException ();
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
/// append string to description
|
2011-03-04 02:42:20 +05:00
|
|
|
DLL_HEADER void Append (const string & s);
|
2009-01-13 04:40:13 +05:00
|
|
|
// void Append (const char * s);
|
|
|
|
|
|
|
|
/// verbal description of exception
|
2017-08-24 16:59:16 +05:00
|
|
|
const string & What() const { return m_what; }
|
|
|
|
virtual const char* what() const noexcept override { return m_what.c_str(); }
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
2009-07-20 14:36:36 +06:00
|
|
|
}
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
#endif
|