exception-python.hh
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 // Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
3 // JRL, CNRS/AIST.
4 
5 #ifndef DYNAMIC_GRAPH_PYTHON_EXCEPTION_PYTHON_H
6 #define DYNAMIC_GRAPH_PYTHON_EXCEPTION_PYTHON_H
7 
8 #include <dynamic-graph/fwd.hh>
9 #include <dynamic-graph/exception-abstract.h>
11 
12 // Depending on whether one is building or using the
13 // library define DLLAPI to import or export.
14 #if defined(WIN32)
15 #if defined(wrap_EXPORTS)
16 #define WRAP_DLLAPI __declspec(dllexport)
17 #else
18 #define WRAP_DLLAPI __declspec(dllimport)
19 #endif
20 #else
21 #define WRAP_DLLAPI
22 #endif
23 
24 namespace dynamicgraph {
25 namespace python {
26 
30 class WRAP_DLLAPI ExceptionPython : public ExceptionAbstract {
31  public:
32  enum ErrorCodeEnum { GENERIC, VALUE_PARSING, VECTOR_PARSING, MATRIX_PARSING, CLASS_INCONSISTENT };
33 
34  static const std::string EXCEPTION_NAME;
35 
36  explicit ExceptionPython(const ExceptionPython::ErrorCodeEnum& errcode, const std::string& msg = "");
37 
38  ExceptionPython(const ExceptionPython::ErrorCodeEnum& errcode, const std::string& msg, const char* format, ...);
39 
40  virtual ~ExceptionPython() throw() {}
41 
42  virtual const std::string& getExceptionName() const { return ExceptionPython::EXCEPTION_NAME; }
43 };
44 } // end of namespace python
45 } // end of namespace dynamicgraph
46 
47 #endif
#define WRAP_DLLAPI
Definition: exception-python.hh:21
ErrorCodeEnum
Definition: exception-python.hh:32
virtual const std::string & getExceptionName() const
Definition: exception-python.hh:42
static const std::string EXCEPTION_NAME
Definition: exception-python.hh:34
Generic error class.
Definition: exception-python.hh:30
virtual ~ExceptionPython()
Definition: exception-python.hh:40
Definition: convert-dg-to-py.hh:7