swig/Lib/python/builtin.swg
Stefan Zager ee3a6623da First cut. Works for wrapping OpenAccess, but there's plenty
left to do.

Currently, the test suite hurls at director_stl.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12332 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-07 21:50:00 +00:00

28 lines
633 B
Text

#ifdef __cplusplus
namespace {
template <typename _Tp> struct PySwigBuiltin : public SwigPyObject {
typedef PySwigBuiltin<_Tp> this_type;
typedef _Tp obj_type;
typedef obj_type* pointer;
typedef obj_type& reference;
static PyMethodDef methods[];
static PyTypeObject pytype;
static SwigPyClientData clientdata;
};
template <typename _Tp> void py_builtin_dealloc (PyObject *pyobj)
{
typedef PySwigBuiltin<_Tp> builtin_type;
builtin_type *obj = (builtin_type*) pyobj;
if (obj->own)
delete reinterpret_cast<_Tp*>(obj->ptr);
(*pyobj->ob_type->tp_free)(pyobj);
}
} // namespace {
#endif