being initialized. */
and putting the following in IMP.i to define the function uniquely.
%{
/* Code to convert C++ exceptions into scripting language errors. Saves
having lots of catch statements in every single wrapper. */
void IMP_swig_handle_exception(void)
{
try {
throw;
} catch (std::out_of_range &e) {
SWIG_exception(SWIG_IndexError, e.what());
} catch (IMP::IndexException &e) {
SWIG_exception(SWIG_IndexError, e.what());
} catch (IMP::InvalidStateException &e) {
SWIG_exception(SWIG_ValueError, e.what());
} catch (IMP::ErrorException &e) {
SWIG_exception(SWIG_RuntimeError, e.what());
}
/* SWIG_exception contains "goto fail" so make sure the label is defined */
fail:
return;
}
%}
Here is a patch for everything in IMP (not for EMbed).