ViennaGrid for Python
 All Classes Files Functions Variables
exception_translator.hpp
Go to the documentation of this file.
1 
6 #ifndef EXCEPTION_TRANSLATOR_HPP
7 #define EXCEPTION_TRANSLATOR_HPP
8 
20 template <typename T>
27  PyObject *m_py_except;
28 public:
36  ExceptionTranslator(PyObject *py_except) : m_py_except(py_except) {}
37 
55  void operator()(const T& cxx_except) const
56  {
57  PyErr_SetString(m_py_except, cxx_except.what());
58  }
59 };
60 
61 #endif