27 #ifndef DSC_EXCEPTION_HXX
28 #define DSC_EXCEPTION_HXX
48 #if defined(_DEBUG_) || defined(_DEBUG)
50 # define LOC(message) (message), __FILE__ , __LINE__ , __FUNCTION__
52 # define LOC(message) (message), __FILE__, __LINE__
55 # define LOC(message) (message)
79 operator std::string()
104 const char *fileName=
"",
105 const unsigned int lineNumber=0,
106 const char *funcName=
"" ):
126 virtual const char*
what(
void )
const noexcept
128 return _what.c_str() ;
146 if ( strcmp(fileName,
"") )
147 oss << fileName <<
"##" << funcName;
161 #define DSC_EXCEPTION(Derived) struct Derived : public DSC_Exception { \
162 Derived ( const std::string & text, const char *fileName="", const unsigned int lineNumber=0, const char *funcName="" \
163 ) : DSC_Exception(text,fileName,lineNumber,funcName) { \
164 _exceptionName = #Derived; \
166 virtual ~Derived(void) noexcept;\
172 #define DSC_EXCEPTION_CXX(NameSpace,Derived) NameSpace::Derived::~Derived(void) noexcept {}
std::string makeText(const char *text, const char *fileName, const unsigned int lineNumber)
Definition: Utils_SALOME_Exception.cxx:43
Class OSS is useful when streaming data through a function that expect a string as parameter.
Definition: DSC_Exception.hxx:65
OSS()
Definition: DSC_Exception.hxx:70
OSS & operator<<(T obj)
Definition: DSC_Exception.hxx:73
std::ostringstream oss_
Definition: DSC_Exception.hxx:67
Definition: Utils_SALOME_Exception.hxx:66
std::string _text
Definition: Utils_SALOME_Exception.hxx:68
obj
Definition: batchmode_salome.py:275
Definition: DSC_Exception.hxx:94
std::string _filefuncName
Definition: DSC_Exception.hxx:155
std::string _exceptionName
Definition: DSC_Exception.hxx:157
int _lineNumber
Definition: DSC_Exception.hxx:156
virtual const char * what(void) const noexcept
Definition: DSC_Exception.hxx:126
virtual ~DSC_Exception(void) noexcept
Definition: DSC_Exception.hxx:136
DSC_Exception(const std::string &text, const char *fileName="", const unsigned int lineNumber=0, const char *funcName="")
Definition: DSC_Exception.hxx:103
std::string _what
Definition: DSC_Exception.hxx:158
virtual const std::string & getExceptionName() const
Definition: DSC_Exception.hxx:138
std::string _dscText
Definition: DSC_Exception.hxx:150
std::string setFileFuncName(const char *fileName, const char *funcName)
Definition: DSC_Exception.hxx:142
#define ASSERT(condition)
Definition: utilities.h:121