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
This commit is contained in:
parent
25a1f9844b
commit
ee3a6623da
8 changed files with 1520 additions and 1040 deletions
28
Lib/python/builtin.swg
Normal file
28
Lib/python/builtin.swg
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue