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
28 lines
633 B
Text
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
|