6 #ifndef DYNAMIC_GRAPH_EXCEPTION_ABSTRACT_H
7 #define DYNAMIC_GRAPH_EXCEPTION_ABSTRACT_H
8 #include <dynamic-graph/dynamic-graph-api.h>
10 #include <dynamic-graph/fwd.hh>
17 (const ::dynamicgraph::ExceptionAbstract &err) { throw err; }
19 #ifdef DYNAMICGRAPH_EXCEPTION_PASSING_PARAM
21 throw ::dynamicgraph::ExceptionAbstract::Param(__LINE__, __FUNCTION__, \
24 #define DG_THROW throw
25 #endif // DYNAMICGRAPH_EXCEPTION_PASSING_PARAM
38 static const int BUFFER_SIZE = 80;
40 Param(
const int &_line,
const char *_function,
const char *_file);
51 const char *functionPTR;
52 char function[BUFFER_SIZE];
55 char file[BUFFER_SIZE];
75 static const std::string EXCEPTION_NAME;
80 virtual const std::string &getExceptionName()
const {
return EXCEPTION_NAME; }
86 const std::string &getStringMessage()
const;
92 const char *getMessage()
const;
94 virtual const char *what()
const throw() {
95 return getStringMessage().c_str();
99 DYNAMIC_GRAPH_DLLAPI
friend std::ostream &operator<<(
100 std::ostream &os,
const ExceptionAbstract &err);
110 #ifdef DYNAMICGRAPH_EXCEPTION_PASSING_PARAM
129 #endif // DYNAMICGRAPH_EXCEPTION_PASSING_PARAM