Michele De Stefano's C++ Utilities
obj.i
1 // mds_utils/python/obj.i
2 //
3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
7 %typemap(in) (mds_utils::python::Obj) {
8  try {
9  $1 = $input;
10  } catch (std::exception& e) {
11  PyErr_SetString(PyExc_RuntimeError,e.what());
12  SWIG_fail;
13  }
14 }
15 
16 %typemap(out) mds_utils::python::Obj {
17  $result = $1.transfer();
18 }
19 
20 %typecheck(SWIG_TYPECHECK_POINTER) mds_utils::python::Obj {
21  $1 = 1;
22 }