00001 #ifndef toast_python_wrapper_h 00002 #define toast_python_wrapper_h 00003 00004 #include <sstream> 00005 #include <stdexcept> 00006 #include <boost/python.hpp> 00007 00014 namespace toast { 00015 namespace python { 00016 00034 template <typename T> 00035 struct wrapper : boost::python::wrapper<T> 00036 { 00041 boost::python::override get_pure_override( char const *name ) 00042 { 00043 boost::python::override o( this->get_override(name) ); 00044 if( not o ) 00045 { 00046 std::ostringstream os; 00047 os << name << " is not implemented"; 00048 throw std::runtime_error( os.str().c_str() ); 00049 } 00050 return o; 00051 } 00052 }; 00053 00056 } 00057 } 00058 00059 00060 #endif