1 // mds_utils/python/dictionary.i
3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
5 // Distributed under the MIT License (See accompanying file LICENSE)
7 %include "mds_utils/python/obj.i"
9 %typemap(in) (mds_utils::python::Dictionary) {
11 if (!PyDict_Check($input)) {
12 throw std::invalid_argument("The dictionary argument is not a dictionary.");
15 } catch (std::exception& e) {
16 PyErr_SetString(PyExc_RuntimeError,e.what());
21 %typemap(out) mds_utils::python::Dictionary = mds_utils::python::Obj;
23 %typecheck(SWIG_TYPECHECK_POINTER) mds_utils::python::Dictionary {
24 $1 = PyDict_Check($input);