#include "foomodule4.h"

PyObject *
_wrap_foo4_xptoget_foo_datum(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    std::string retval;
    PyObject *foo;
    Foo foo2;
    const char *keywords[] = {"foo", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &foo)) {
        return NULL;
    }
    if (PyObject_IsInstance(foo, (PyObject*) &PyFoo_Type)) {
        foo2 = *((PyFoo *) foo)->obj;
    } else if (PyObject_IsInstance(foo, (PyObject*) &PyZoo_Type)) {
        foo2 = *((PyZoo *) foo)->obj;
    } else {
    
        PyErr_Format(PyExc_TypeError, "parameter must an instance of one of the types (Foo, Zoo), not %s", foo->ob_type->tp_name);
        return NULL;
    }
    retval = xpto::get_foo_datum(foo2);
    py_retval = Py_BuildValue((char *) "s#", (retval).c_str(), (retval).size());
    return py_retval;
}


PyObject *
_wrap_foo4_xptoget_flow_id(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    xpto::FlowId retval;
    unsigned int flowId;
    const char *keywords[] = {"flowId", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "I", (char **) keywords, &flowId)) {
        return NULL;
    }
    retval = xpto::get_flow_id(flowId);
    py_retval = Py_BuildValue((char *) "N", PyLong_FromUnsignedLong(retval));
    return py_retval;
}


PyObject *
_wrap_foo4_xptoget_foo_type()
{
    PyObject *py_retval;
    xpto::FooType retval;
    
    retval = xpto::get_foo_type();
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}




PyObject *
_wrap_foo4get_simple_list()
{
    PyObject *py_retval;
    SimpleStructList retval;
    PySimpleStructList *py_SimpleStructList;
    
    retval = get_simple_list();
    py_SimpleStructList = PyObject_New(PySimpleStructList, &PySimpleStructList_Type);
    py_SimpleStructList->obj = new SimpleStructList(retval);
    py_retval = Py_BuildValue((char *) "N", py_SimpleStructList);
    return py_retval;
}


PyObject *
_wrap_foo4get_map()
{
    PyObject *py_retval;
    std::map< std::string, int > retval;
    Pystd__map__lt___std__string__int___gt__ *py_std__map__lt___std__string__int___gt__;
    
    retval = get_map();
    py_std__map__lt___std__string__int___gt__ = PyObject_New(Pystd__map__lt___std__string__int___gt__, &Pystd__map__lt___std__string__int___gt___Type);
    py_std__map__lt___std__string__int___gt__->obj = new std::map< std::string, int >(retval);
    py_retval = Py_BuildValue((char *) "N", py_std__map__lt___std__string__int___gt__);
    return py_retval;
}


PyObject *
_wrap_foo4get_cannot_be_constructed_ptr()
{
    PyObject *py_retval;
    CannotBeConstructed *retval;
    PyCannotBeConstructed *py_CannotBeConstructed;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = get_cannot_be_constructed_ptr();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyCannotBeConstructed_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyCannotBeConstructed_wrapper_registry.end()) {
        py_CannotBeConstructed = NULL;
    } else {
        py_CannotBeConstructed = (PyCannotBeConstructed *) wrapper_lookup_iter->second;
        Py_INCREF(py_CannotBeConstructed);
    }
    
    if (py_CannotBeConstructed == NULL) {
        py_CannotBeConstructed = PyObject_New(PyCannotBeConstructed, &PyCannotBeConstructed_Type);
        py_CannotBeConstructed->obj = retval;
        py_CannotBeConstructed->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyCannotBeConstructed_wrapper_registry[(void *) py_CannotBeConstructed->obj] = (PyObject *) py_CannotBeConstructed;
    }
    py_retval = Py_BuildValue((char *) "N", py_CannotBeConstructed);
    return py_retval;
}


PyObject *
_wrap_foo4create_new_foobar()
{
    PyObject *py_retval;
    Foobar *retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = create_new_foobar();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = retval;
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    return py_retval;
}


PyObject *
_wrap_foo4get_hidden_subclass_pointer()
{
    PyObject *py_retval;
    Foo *retval;
    PyFoo *py_Foo;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    PyTypeObject *wrapper_type = 0;
    
    retval = get_hidden_subclass_pointer();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoo_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyFoo_wrapper_registry.end()) {
        py_Foo = NULL;
    } else {
        py_Foo = (PyFoo *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foo);
    }
    
    if (py_Foo == NULL) {
        wrapper_type = PyFoo__typeid_map.lookup_wrapper(typeid((*retval)), &PyFoo_Type);
        py_Foo = PyObject_New(PyFoo, wrapper_type);
        py_Foo->obj = retval;
        py_Foo->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyFoo_wrapper_registry[(void *) py_Foo->obj] = (PyObject *) py_Foo;
    }
    py_retval = Py_BuildValue((char *) "N", py_Foo);
    return py_retval;
}



PyObject *
_wrap_foo4function_that_takes_foo__0(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *py_retval;
    PyObject *foo;
    Foo foo2;
    const char *keywords[] = {"foo", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &foo)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    if (PyObject_IsInstance(foo, (PyObject*) &PyFoo_Type)) {
        foo2 = *((PyFoo *) foo)->obj;
    } else if (PyObject_IsInstance(foo, (PyObject*) &PyZoo_Type)) {
        foo2 = *((PyZoo *) foo)->obj;
    } else {
    
        PyErr_Format(PyExc_TypeError, "parameter must an instance of one of the types (Foo, Zoo), not %s", foo->ob_type->tp_name);
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    function_that_takes_foo(foo2);
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


static PyObject *
_wrap_foofunction_that_takes_foo_from_string(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args,
                                             PyObject *kwargs, PyObject **return_exception)
{
    PyObject *py_retval;
    char *datum;
    const char *keywords[] = {"foo", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s", (char **) keywords, &datum)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    function_that_takes_foo(Foo(datum));
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


PyObject * _wrap_foo4function_that_takes_foo(PyObject *self, PyObject *args, PyObject *kwargs)
{
    PyObject * retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_foo4function_that_takes_foo__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_foofunction_that_takes_foo_from_string(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return NULL;
}


PyObject *
_wrap_foo4get_set()
{
    PyObject *py_retval;
    std::set< unsigned int > retval;
    Pystd__set__lt___unsigned_int___gt__ *py_std__set__lt___unsigned_int___gt__;
    
    retval = get_set();
    py_std__set__lt___unsigned_int___gt__ = PyObject_New(Pystd__set__lt___unsigned_int___gt__, &Pystd__set__lt___unsigned_int___gt___Type);
    py_std__set__lt___unsigned_int___gt__->obj = new std::set< unsigned int >(retval);
    py_retval = Py_BuildValue((char *) "N", py_std__set__lt___unsigned_int___gt__);
    return py_retval;
}


PyObject *
_wrap_foo4get_foobar_with_other_as_custodian(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    Foobar *retval;
    PySomeObject *other;
    SomeObject *other_ptr;
    const char *keywords[] = {"other", NULL};
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    PyObject *wards;
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PySomeObject_Type, &other)) {
        return NULL;
    }
    other_ptr = (other ? other->obj : NULL);
    retval = get_foobar_with_other_as_custodian(other_ptr);
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = retval;
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    wards = PyObject_GetAttrString(((PyObject *) other), (char *) "__wards__");
    if (wards == NULL) {
        PyErr_Clear();
        wards = PyList_New(0);
        PyObject_SetAttrString(((PyObject *) other), (char *) "__wards__", wards);
    }
    if (((PyObject *) py_Foobar) && !PySequence_Contains(wards, ((PyObject *) py_Foobar)))
        PyList_Append(wards, ((PyObject *) py_Foobar));
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    Py_DECREF(wards);
    return py_retval;
}


PyObject *
_wrap_foo4function_that_returns_foo()
{
    PyObject *py_retval;
    PyFoo *py_Foo;
    
    Foo retval = function_that_returns_foo();
    py_Foo = PyObject_New(PyFoo, &PyFoo_Type);
    py_Foo->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    py_Foo->obj = new Foo(retval);
    py_Foo->obj->initialize();
    PyFoo_wrapper_registry[(void *) py_Foo->obj] = (PyObject *) py_Foo;
    py_retval = Py_BuildValue((char *) "N", py_Foo);
    return py_retval;
}


PyObject *
_wrap_foo4delete_some_object()
{
    PyObject *py_retval;
    
    delete_some_object();
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


PyObject *
_wrap_foo4delete_stored_zbr()
{
    PyObject *py_retval;
    
    delete_stored_zbr();
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


PyObject *
_wrap_foo4get_cannot_be_constructed_value()
{
    PyObject *py_retval;
    PyCannotBeConstructed *py_CannotBeConstructed;
    
    CannotBeConstructed retval = get_cannot_be_constructed_value();
    py_CannotBeConstructed = PyObject_New(PyCannotBeConstructed, &PyCannotBeConstructed_Type);
    py_CannotBeConstructed->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    py_CannotBeConstructed->obj = new CannotBeConstructed(retval);
    PyCannotBeConstructed_wrapper_registry[(void *) py_CannotBeConstructed->obj] = (PyObject *) py_CannotBeConstructed;
    py_retval = Py_BuildValue((char *) "N", py_CannotBeConstructed);
    return py_retval;
}


PyObject *
_wrap_foo4invoke_some_object_get_prefix()
{
    PyObject *py_retval;
    std::string retval;
    
    retval = invoke_some_object_get_prefix();
    py_retval = Py_BuildValue((char *) "s#", (retval).c_str(), (retval).size());
    return py_retval;
}



PyObject *
_wrap_foo4get_int_from_float__0(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *py_retval;
    int retval;
    double from_float;
    int multiplier = 1;
    const char *keywords[] = {"from_float", "multiplier", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d|i", (char **) keywords, &from_float, &multiplier)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    retval = get_int_from_float(from_float, multiplier);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}

PyObject *
_wrap_foo4get_int_from_float__1(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *py_retval;
    int retval;
    char const *from_string;
    int multiplier = 1;
    const char *keywords[] = {"from_string", "multiplier", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s|i", (char **) keywords, &from_string, &multiplier)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    retval = get_int_from_string(from_string, multiplier);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}

PyObject * _wrap_foo4get_int_from_float(PyObject *self, PyObject *args, PyObject *kwargs)
{
    PyObject * retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_foo4get_int_from_float__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_foo4get_int_from_float__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return NULL;
}


PyObject *
_wrap_foo4get_abstract_base_class_ptr1()
{
    PyObject *py_retval;
    AbstractBaseClass *retval;
    PyAbstractBaseClass *py_AbstractBaseClass;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = get_abstract_base_class_ptr1();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyAbstractBaseClass_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyAbstractBaseClass_wrapper_registry.end()) {
        py_AbstractBaseClass = NULL;
    } else {
        py_AbstractBaseClass = (PyAbstractBaseClass *) wrapper_lookup_iter->second;
        Py_INCREF(py_AbstractBaseClass);
    }
    
    if (py_AbstractBaseClass == NULL) {
        py_AbstractBaseClass = PyObject_GC_New(PyAbstractBaseClass, &PyAbstractBaseClass_Type);
        py_AbstractBaseClass->inst_dict = NULL;
        py_AbstractBaseClass->obj = retval;
        py_AbstractBaseClass->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyAbstractBaseClass_wrapper_registry[(void *) py_AbstractBaseClass->obj] = (PyObject *) py_AbstractBaseClass;
    }
    py_retval = Py_BuildValue((char *) "N", py_AbstractBaseClass);
    return py_retval;
}



PyObject *
_wrap_foo4invoke_zbr(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    retval = invoke_zbr(x);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}


std::map<void*, PyObject*> PyAbstractBaseClass_wrapper_registry;

static int
_wrap_PyAbstractBaseClass__tp_init(void)
{
    PyErr_SetString(PyExc_TypeError, "class 'AbstractBaseClass' cannot be constructed (have pure virtual methods but no helper class)");
    return -1;
}

static PyMethodDef PyAbstractBaseClass_methods[] = {
    {NULL, NULL, 0, NULL}
};

static void
PyAbstractBaseClass__tp_clear(PyAbstractBaseClass *self)
{
    Py_CLEAR(self->inst_dict);
        AbstractBaseClass *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyAbstractBaseClass__tp_traverse(PyAbstractBaseClass *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    return 0;
}


static void
_wrap_PyAbstractBaseClass__tp_dealloc(PyAbstractBaseClass *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyAbstractBaseClass_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyAbstractBaseClass_wrapper_registry.end()) {
        PyAbstractBaseClass_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyAbstractBaseClass__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyAbstractBaseClass__tp_richcompare (PyAbstractBaseClass *PYBINDGEN_UNUSED(self), PyAbstractBaseClass *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyAbstractBaseClass_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyAbstractBaseClass_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.AbstractBaseClass",            /* tp_name */
    sizeof(PyAbstractBaseClass),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyAbstractBaseClass__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyAbstractBaseClass__tp_traverse,     /* tp_traverse */
    (inquiry)PyAbstractBaseClass__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyAbstractBaseClass__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyAbstractBaseClass_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyAbstractBaseClass, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyAbstractBaseClass__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyAbstractBaseClass2_wrapper_registry;

PyObject *
PyAbstractBaseClass2__PythonHelper::_wrap_protected_virtual(PyAbstractBaseClass2 *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int x;
    PyAbstractBaseClass2__PythonHelper *helper = dynamic_cast< PyAbstractBaseClass2__PythonHelper* >(self->obj);
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    if (helper == NULL) {
        PyErr_SetString(PyExc_TypeError, "Method protected_virtual of class AbstractBaseClass2 is protected and can only be called by a subclass");
        return NULL;
    }
    retval = helper->protected_virtual__parent_caller(x);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}

int
PyAbstractBaseClass2__PythonHelper::protected_pure_virtual(int x) const
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    AbstractBaseClass2 *self_obj_before;
    PyObject *py_retval;
    int retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "protected_pure_virtual"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    self_obj_before = reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj;
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = const_cast< AbstractBaseClass2* >((const AbstractBaseClass2*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "protected_pure_virtual", (char *) "i", x);
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    py_retval = Py_BuildValue((char*) "(N)", py_retval);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &retval)) {
        PyErr_Print();
        Py_DECREF(py_retval);
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return retval;
}

int
PyAbstractBaseClass2__PythonHelper::protected_virtual(int x) const
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    AbstractBaseClass2 *self_obj_before;
    PyObject *py_retval;
    int retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "protected_virtual"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return AbstractBaseClass2::protected_virtual(x);
    }
    self_obj_before = reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj;
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = const_cast< AbstractBaseClass2* >((const AbstractBaseClass2*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "protected_virtual", (char *) "i", x);
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return AbstractBaseClass2::protected_virtual(x);
    }
    py_retval = Py_BuildValue((char*) "(N)", py_retval);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &retval)) {
        PyErr_Print();
        Py_DECREF(py_retval);
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return AbstractBaseClass2::protected_virtual(x);
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return retval;
}

int
PyAbstractBaseClass2__PythonHelper::private_virtual(int x) const
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    AbstractBaseClass2 *self_obj_before;
    PyObject *py_retval;
    int retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "private_virtual"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    self_obj_before = reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj;
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = const_cast< AbstractBaseClass2* >((const AbstractBaseClass2*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "private_virtual", (char *) "i", x);
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    py_retval = Py_BuildValue((char*) "(N)", py_retval);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &retval)) {
        PyErr_Print();
        Py_DECREF(py_retval);
        reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
    
        PyErr_Print();
        Py_FatalError("Error detected, but parent virtual is pure virtual or private virtual, "
                      "and return is a class without trival constructor");
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyAbstractBaseClass2* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return retval;
}

static int
_wrap_PyAbstractBaseClass2__tp_init(PyAbstractBaseClass2 *self, PyObject *args, PyObject *kwargs)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        return -1;
    }
    if (self->ob_type != &PyAbstractBaseClass2_Type)
    {
        self->obj = new PyAbstractBaseClass2__PythonHelper();
        ((PyAbstractBaseClass2__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'protected'
        PyErr_SetString(PyExc_TypeError, "class 'AbstractBaseClass2' cannot be constructed");
        return -1;
    }
    return 0;
}


PyObject *
_wrap_PyAbstractBaseClass2_invoke_protected_pure_virtual(PyAbstractBaseClass2 *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    retval = self->obj->invoke_protected_pure_virtual(x);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}


PyObject *
_wrap_PyAbstractBaseClass2_invoke_private_virtual(PyAbstractBaseClass2 *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    retval = self->obj->invoke_private_virtual(x);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}


PyObject *
_wrap_PyAbstractBaseClass2_invoke_protected_virtual(PyAbstractBaseClass2 *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    retval = self->obj->invoke_protected_virtual(x);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}

static PyMethodDef PyAbstractBaseClass2_methods[] = {
    {(char *) "invoke_protected_pure_virtual", (PyCFunction) _wrap_PyAbstractBaseClass2_invoke_protected_pure_virtual, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "invoke_private_virtual", (PyCFunction) _wrap_PyAbstractBaseClass2_invoke_private_virtual, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "invoke_protected_virtual", (PyCFunction) _wrap_PyAbstractBaseClass2_invoke_protected_virtual, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "protected_virtual", (PyCFunction) PyAbstractBaseClass2__PythonHelper::_wrap_protected_virtual, METH_KEYWORDS|METH_VARARGS, NULL },
    {NULL, NULL, 0, NULL}
};

static void
PyAbstractBaseClass2__tp_clear(PyAbstractBaseClass2 *self)
{
    Py_CLEAR(self->inst_dict);
        AbstractBaseClass2 *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyAbstractBaseClass2__tp_traverse(PyAbstractBaseClass2 *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    if (self->obj && typeid(*self->obj) == typeid(PyAbstractBaseClass2__PythonHelper) )
        Py_VISIT((PyObject *) self);

    return 0;
}


static void
_wrap_PyAbstractBaseClass2__tp_dealloc(PyAbstractBaseClass2 *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyAbstractBaseClass2_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyAbstractBaseClass2_wrapper_registry.end()) {
        PyAbstractBaseClass2_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyAbstractBaseClass2__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyAbstractBaseClass2__tp_richcompare (PyAbstractBaseClass2 *PYBINDGEN_UNUSED(self), PyAbstractBaseClass2 *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyAbstractBaseClass2_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyAbstractBaseClass2_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.AbstractBaseClass2",            /* tp_name */
    sizeof(PyAbstractBaseClass2),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyAbstractBaseClass2__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyAbstractBaseClass2__tp_traverse,     /* tp_traverse */
    (inquiry)PyAbstractBaseClass2__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyAbstractBaseClass2__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyAbstractBaseClass2_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyAbstractBaseClass2, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyAbstractBaseClass2__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};





static int
_wrap_PyAbstractBaseClassImpl__tp_init__0(PyAbstractBaseClassImpl *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyAbstractBaseClassImpl *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyAbstractBaseClassImpl_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new AbstractBaseClassImpl(*((PyAbstractBaseClassImpl *) arg0)->obj);
    return 0;
}


int _wrap_PyAbstractBaseClassImpl__tp_init(PyAbstractBaseClassImpl *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[1] = {0,};
    retval = _wrap_PyAbstractBaseClassImpl__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    error_list = PyList_New(1);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}



PyObject *
_wrap_PyAbstractBaseClassImpl_get_abstract_base_class_ptr1(void)
{
    PyObject *py_retval;
    AbstractBaseClass *retval;
    PyAbstractBaseClass *py_AbstractBaseClass;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = AbstractBaseClassImpl::get_abstract_base_class_ptr1();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyAbstractBaseClass_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyAbstractBaseClass_wrapper_registry.end()) {
        py_AbstractBaseClass = NULL;
    } else {
        py_AbstractBaseClass = (PyAbstractBaseClass *) wrapper_lookup_iter->second;
        Py_INCREF(py_AbstractBaseClass);
    }
    
    if (py_AbstractBaseClass == NULL) {
        py_AbstractBaseClass = PyObject_GC_New(PyAbstractBaseClass, &PyAbstractBaseClass_Type);
        py_AbstractBaseClass->inst_dict = NULL;
        py_AbstractBaseClass->obj = retval;
        py_AbstractBaseClass->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyAbstractBaseClass_wrapper_registry[(void *) py_AbstractBaseClass->obj] = (PyObject *) py_AbstractBaseClass;
    }
    py_retval = Py_BuildValue((char *) "N", py_AbstractBaseClass);
    return py_retval;
}


static PyObject*
_wrap_PyAbstractBaseClassImpl__copy__(PyAbstractBaseClassImpl *self)
{

    PyAbstractBaseClassImpl *py_copy;
    py_copy = PyObject_GC_New(PyAbstractBaseClassImpl, &PyAbstractBaseClassImpl_Type);
    py_copy->obj = new AbstractBaseClassImpl(*self->obj);
    py_copy->inst_dict = NULL;
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyAbstractBaseClass_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyAbstractBaseClassImpl_methods[] = {
    {(char *) "get_abstract_base_class_ptr1", (PyCFunction) _wrap_PyAbstractBaseClassImpl_get_abstract_base_class_ptr1, METH_NOARGS|METH_STATIC, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyAbstractBaseClassImpl__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
PyAbstractBaseClassImpl__tp_clear(PyAbstractBaseClassImpl *self)
{
    Py_CLEAR(self->inst_dict);
        AbstractBaseClassImpl *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyAbstractBaseClassImpl__tp_traverse(PyAbstractBaseClassImpl *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    return 0;
}


static void
_wrap_PyAbstractBaseClassImpl__tp_dealloc(PyAbstractBaseClassImpl *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyAbstractBaseClass_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyAbstractBaseClass_wrapper_registry.end()) {
        PyAbstractBaseClass_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyAbstractBaseClassImpl__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyAbstractBaseClassImpl__tp_richcompare (PyAbstractBaseClassImpl *PYBINDGEN_UNUSED(self), PyAbstractBaseClassImpl *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyAbstractBaseClassImpl_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyAbstractBaseClassImpl_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.AbstractBaseClassImpl",            /* tp_name */
    sizeof(PyAbstractBaseClassImpl),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyAbstractBaseClassImpl__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyAbstractBaseClassImpl__tp_traverse,     /* tp_traverse */
    (inquiry)PyAbstractBaseClassImpl__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyAbstractBaseClassImpl__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyAbstractBaseClassImpl_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyAbstractBaseClassImpl, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyAbstractBaseClassImpl__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyAbstractXpto_wrapper_registry;

void
PyAbstractXpto__PythonHelper::something(int x) const
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    AbstractXpto *self_obj_before;
    PyObject *py_retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "something"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
        return;
    }
    self_obj_before = reinterpret_cast< PyAbstractXpto* >(m_pyself)->obj;
    reinterpret_cast< PyAbstractXpto* >(m_pyself)->obj = const_cast< AbstractXpto* >((const AbstractXpto*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "something", (char *) "i", x);
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyAbstractXpto* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return;
    }
    if (py_retval != Py_None) {
        PyErr_SetString(PyExc_TypeError, "function/method should return None");
        Py_DECREF(py_retval);
        reinterpret_cast< PyAbstractXpto* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return;
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyAbstractXpto* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return;
}


static int
_wrap_PyAbstractXpto__tp_init__0(PyAbstractXpto *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyAbstractXpto *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyAbstractXpto_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (self->ob_type != &PyAbstractXpto_Type)
    {
        self->obj = new PyAbstractXpto__PythonHelper(*((PyAbstractXpto *) arg0)->obj);
        ((PyAbstractXpto__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'public'
        PyErr_SetString(PyExc_TypeError, "class 'AbstractXpto' cannot be constructed");
        return -1;
    }
    return 0;
}

static int
_wrap_PyAbstractXpto__tp_init__1(PyAbstractXpto *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (self->ob_type != &PyAbstractXpto_Type)
    {
        self->obj = new PyAbstractXpto__PythonHelper();
        ((PyAbstractXpto__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'public'
        PyErr_SetString(PyExc_TypeError, "class 'AbstractXpto' cannot be constructed");
        return -1;
    }
    return 0;
}

int _wrap_PyAbstractXpto__tp_init(PyAbstractXpto *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyAbstractXpto__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyAbstractXpto__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}


PyObject *
_wrap_PyAbstractXpto_something(PyAbstractXpto *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    self->obj->something(x);
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}

static PyMethodDef PyAbstractXpto_methods[] = {
    {(char *) "something", (PyCFunction) _wrap_PyAbstractXpto_something, METH_KEYWORDS|METH_VARARGS, NULL },
    {NULL, NULL, 0, NULL}
};

static void
PyAbstractXpto__tp_clear(PyAbstractXpto *self)
{
    Py_CLEAR(self->inst_dict);
        AbstractXpto *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyAbstractXpto__tp_traverse(PyAbstractXpto *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    if (self->obj && typeid(*self->obj) == typeid(PyAbstractXpto__PythonHelper) )
        Py_VISIT((PyObject *) self);

    return 0;
}


static void
_wrap_PyAbstractXpto__tp_dealloc(PyAbstractXpto *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyAbstractXpto_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyAbstractXpto_wrapper_registry.end()) {
        PyAbstractXpto_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyAbstractXpto__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyAbstractXpto__tp_richcompare (PyAbstractXpto *PYBINDGEN_UNUSED(self), PyAbstractXpto *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyAbstractXpto_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyAbstractXpto_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.AbstractXpto",            /* tp_name */
    sizeof(PyAbstractXpto),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyAbstractXpto__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyAbstractXpto__tp_traverse,     /* tp_traverse */
    (inquiry)PyAbstractXpto__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyAbstractXpto__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyAbstractXpto_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyAbstractXpto, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyAbstractXpto__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};




void
PyAbstractXptoImpl__PythonHelper::something(int x) const
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    AbstractXptoImpl *self_obj_before;
    PyObject *py_retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "something"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
        AbstractXptoImpl::something(x);
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
        return;
    }
    self_obj_before = reinterpret_cast< PyAbstractXptoImpl* >(m_pyself)->obj;
    reinterpret_cast< PyAbstractXptoImpl* >(m_pyself)->obj = const_cast< AbstractXptoImpl* >((const AbstractXptoImpl*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "something", (char *) "i", x);
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyAbstractXptoImpl* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return;
    }
    if (py_retval != Py_None) {
        PyErr_SetString(PyExc_TypeError, "function/method should return None");
        Py_DECREF(py_retval);
        reinterpret_cast< PyAbstractXptoImpl* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return;
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyAbstractXptoImpl* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return;
}


static int
_wrap_PyAbstractXptoImpl__tp_init__0(PyAbstractXptoImpl *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyAbstractXptoImpl *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyAbstractXptoImpl_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (self->ob_type != &PyAbstractXptoImpl_Type)
    {
        self->obj = new PyAbstractXptoImpl__PythonHelper(*((PyAbstractXptoImpl *) arg0)->obj);
        ((PyAbstractXptoImpl__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'public'
        self->obj = new AbstractXptoImpl(*((PyAbstractXptoImpl *) arg0)->obj);
    }
    return 0;
}

static int
_wrap_PyAbstractXptoImpl__tp_init__1(PyAbstractXptoImpl *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (self->ob_type != &PyAbstractXptoImpl_Type)
    {
        self->obj = new PyAbstractXptoImpl__PythonHelper();
        ((PyAbstractXptoImpl__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'public'
        self->obj = new AbstractXptoImpl();
    }
    return 0;
}

int _wrap_PyAbstractXptoImpl__tp_init(PyAbstractXptoImpl *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyAbstractXptoImpl__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyAbstractXptoImpl__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}


PyObject *
_wrap_PyAbstractXptoImpl_something(PyAbstractXptoImpl *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int x;
    PyAbstractXptoImpl__PythonHelper *helper_class = dynamic_cast<PyAbstractXptoImpl__PythonHelper*> (self->obj);
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        return NULL;
    }
    (helper_class == NULL)? (self->obj->something(x)) : (self->obj->AbstractXptoImpl::something(x));
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


static PyObject*
_wrap_PyAbstractXptoImpl__copy__(PyAbstractXptoImpl *self)
{

    PyAbstractXptoImpl *py_copy;
    py_copy = PyObject_GC_New(PyAbstractXptoImpl, &PyAbstractXptoImpl_Type);
    py_copy->obj = new AbstractXptoImpl(*self->obj);
    py_copy->inst_dict = NULL;
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyAbstractXpto_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyAbstractXptoImpl_methods[] = {
    {(char *) "something", (PyCFunction) _wrap_PyAbstractXptoImpl_something, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyAbstractXptoImpl__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
PyAbstractXptoImpl__tp_clear(PyAbstractXptoImpl *self)
{
    Py_CLEAR(self->inst_dict);
        AbstractXptoImpl *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyAbstractXptoImpl__tp_traverse(PyAbstractXptoImpl *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    if (self->obj && typeid(*self->obj) == typeid(PyAbstractXptoImpl__PythonHelper) )
        Py_VISIT((PyObject *) self);

    return 0;
}


static void
_wrap_PyAbstractXptoImpl__tp_dealloc(PyAbstractXptoImpl *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyAbstractXpto_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyAbstractXpto_wrapper_registry.end()) {
        PyAbstractXpto_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyAbstractXptoImpl__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyAbstractXptoImpl__tp_richcompare (PyAbstractXptoImpl *PYBINDGEN_UNUSED(self), PyAbstractXptoImpl *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyAbstractXptoImpl_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyAbstractXptoImpl_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.AbstractXptoImpl",            /* tp_name */
    sizeof(PyAbstractXptoImpl),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyAbstractXptoImpl__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyAbstractXptoImpl__tp_traverse,     /* tp_traverse */
    (inquiry)PyAbstractXptoImpl__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyAbstractXptoImpl__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyAbstractXptoImpl_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyAbstractXptoImpl, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyAbstractXptoImpl__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyBox_wrapper_registry;
static PyObject* _wrap_PyBox__get_m_internalFoobar(PyBox *self, void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    if (!(self->obj->m_internalFoobar)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) self->obj->m_internalFoobar);
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = self->obj->m_internalFoobar;
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    return py_retval;
}
static int _wrap_PyBox__set_m_internalFoobar(PyBox *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    PyFoobar *tmp_Foobar;
    
    py_retval = Py_BuildValue((char *) "(O)", value);
    if (!PyArg_ParseTuple(py_retval, (char *) "O!", &PyFoobar_Type, &tmp_Foobar)) {
        Py_DECREF(py_retval);
        return -1;
    }
    // dangerous!
    self->obj->m_internalFoobar = tmp_Foobar->obj;
    Py_DECREF(py_retval);
    return 0;
}
static PyGetSetDef PyBox__getsets[] = {
    {
        (char*) "m_internalFoobar", /* attribute name */
        (getter) _wrap_PyBox__get_m_internalFoobar, /* C function to get the attribute */
        (setter) _wrap_PyBox__set_m_internalFoobar, /* C function to set the attribute */
        NULL, /* optional doc string */
        NULL /* optional additional data for getter and setter */
    },
    { NULL, NULL, NULL, NULL, NULL }
};
static PyObject* _wrap_PyBox__get_instance_count(PyObject * PYBINDGEN_UNUSED(obj), void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "i", Box::instance_count);
    return py_retval;
}
static int _wrap_PyBox__set_instance_count(PyBox * PYBINDGEN_UNUSED(dummy), PyObject *value, void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "(O)", value);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &Box::instance_count)) {
        Py_DECREF(py_retval);
        return -1;
    }
    Py_DECREF(py_retval);
    return 0;
}
static PyGetSetDef BoxMeta__getsets[] = {
    {
        (char*) "instance_count", /* attribute name */
        (getter) _wrap_PyBox__get_instance_count, /* C function to get the attribute */
        (setter) _wrap_PyBox__set_instance_count, /* C function to set the attribute */
        NULL, /* optional doc string */
        NULL /* optional additional data for getter and setter */
    },
    { NULL, NULL, NULL, NULL, NULL }
};

PyTypeObject PyBoxMeta_Type = {
	PyObject_HEAD_INIT(NULL)
	0,					/* ob_size */
	(char *) "BoxMeta",		        /* tp_name */
	0,					/* tp_basicsize */
	0,					/* tp_itemsize */
	0,	 				/* tp_dealloc */
	0,					/* tp_print */
	0,					/* tp_getattr */
	0,					/* tp_setattr */
	0,					/* tp_compare */
	0,					/* tp_repr */
	0,					/* tp_as_number */
	0,					/* tp_as_sequence */
	0,		       			/* tp_as_mapping */
	0,					/* tp_hash */
	0,					/* tp_call */
	0,					/* tp_str */
	0,					/* tp_getattro */
	0,					/* tp_setattro */
	0,					/* tp_as_buffer */
	Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE, /* tp_flags */
 	0,					/* tp_doc */
	0,					/* tp_traverse */
 	0,					/* tp_clear */
	0,					/* tp_richcompare */
	0,					/* tp_weaklistoffset */
	0,					/* tp_iter */
	0,					/* tp_iternext */
	0,					/* tp_methods */
	0,					/* tp_members */
	BoxMeta__getsets,				/* tp_getset */
	0,					/* tp_base */
	0,					/* tp_dict */
	0,	                                /* tp_descr_get */
	0,  		                        /* tp_descr_set */
	0,					/* tp_dictoffset */
	0,					/* tp_init */
	0,					/* tp_alloc */
	0,					/* tp_new */
	0,               			/* tp_free */
        0,                                      /* tp_is_gc */
        0,                                      /* tp_bases */
        0,                                      /* tp_mro */
        0,                                      /* tp_cache */
        0,                                      /* tp_subclasses */
        0,                                      /* tp_weaklist */
        0                                       /* tp_del */
};


static int
_wrap_PyBox__tp_init(PyBox *self, PyObject *args, PyObject *kwargs)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        return -1;
    }
    self->obj = new Box();
    return 0;
}


PyObject *
_wrap_PyBox_getFoobarInternalPtr2(PyBox *self)
{
    PyObject *py_retval;
    Foobar *retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    PyObject *wards;
    
    retval = self->obj->getFoobarInternalPtr2();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = retval;
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    wards = PyObject_GetAttrString(((PyObject *) py_Foobar), (char *) "__wards__");
    if (wards == NULL) {
        PyErr_Clear();
        wards = PyList_New(0);
        PyObject_SetAttrString(((PyObject *) py_Foobar), (char *) "__wards__", wards);
    }
    if (((PyObject *) self) && !PySequence_Contains(wards, ((PyObject *) self)))
        PyList_Append(wards, ((PyObject *) self));
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    Py_DECREF(wards);
    return py_retval;
}


PyObject *
_wrap_PyBox_getFoobarInternalRef2(PyBox *self)
{
    PyObject *py_retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    PyObject *wards;
    
    Foobar & retval = self->obj->getFoobarInternalRef2();
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) (&retval));
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = (&retval);
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    wards = PyObject_GetAttrString(((PyObject *) py_Foobar), (char *) "__wards__");
    if (wards == NULL) {
        PyErr_Clear();
        wards = PyList_New(0);
        PyObject_SetAttrString(((PyObject *) py_Foobar), (char *) "__wards__", wards);
    }
    if (((PyObject *) self) && !PySequence_Contains(wards, ((PyObject *) self)))
        PyList_Append(wards, ((PyObject *) self));
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    Py_DECREF(wards);
    return py_retval;
}


PyObject *
_wrap_PyBox_getFoobarInternalPtr(PyBox *self)
{
    PyObject *py_retval;
    Foobar *retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = self->obj->getFoobarInternalPtr();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = retval;
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    return py_retval;
}


PyObject *
_wrap_PyBox_getFoobarInternalRef(PyBox *self)
{
    PyObject *py_retval;
    PyFoobar *py_Foobar;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    Foobar & retval = self->obj->getFoobarInternalRef();
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) (&retval));
    if (wrapper_lookup_iter == PyFoobar_wrapper_registry.end()) {
        py_Foobar = NULL;
    } else {
        py_Foobar = (PyFoobar *) wrapper_lookup_iter->second;
        Py_INCREF(py_Foobar);
    }
    
    if (py_Foobar == NULL) {
        py_Foobar = PyObject_GC_New(PyFoobar, &PyFoobar_Type);
        py_Foobar->inst_dict = NULL;
        py_Foobar->obj = (&retval);
        py_Foobar->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
        PyFoobar_wrapper_registry[(void *) py_Foobar->obj] = (PyObject *) py_Foobar;
    }
    py_retval = Py_BuildValue((char *) "N", py_Foobar);
    return py_retval;
}

static PyMethodDef PyBox_methods[] = {
    {(char *) "getFoobarInternalPtr2", (PyCFunction) _wrap_PyBox_getFoobarInternalPtr2, METH_NOARGS, NULL },
    {(char *) "getFoobarInternalRef2", (PyCFunction) _wrap_PyBox_getFoobarInternalRef2, METH_NOARGS, NULL },
    {(char *) "getFoobarInternalPtr", (PyCFunction) _wrap_PyBox_getFoobarInternalPtr, METH_NOARGS, NULL },
    {(char *) "getFoobarInternalRef", (PyCFunction) _wrap_PyBox_getFoobarInternalRef, METH_NOARGS, NULL },
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyBox__tp_dealloc(PyBox *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyBox_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyBox_wrapper_registry.end()) {
        PyBox_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        Box *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyBox__tp_richcompare (PyBox *PYBINDGEN_UNUSED(self), PyBox *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyBox_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyBox_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Box",            /* tp_name */
    sizeof(PyBox),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyBox__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyBox__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyBox_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    PyBox__getsets,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyBox__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyCannotBeConstructed_wrapper_registry;

static int
_wrap_PyCannotBeConstructed__tp_init(PyCannotBeConstructed *self, PyObject *args, PyObject *kwargs)
{
    PyCannotBeConstructed *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyCannotBeConstructed_Type, &arg0)) {
        return -1;
    }
    self->obj = new CannotBeConstructed(*((PyCannotBeConstructed *) arg0)->obj);
    return 0;
}


PyObject *
_wrap_PyCannotBeConstructed_get_ptr(void)
{
    PyObject *py_retval;
    CannotBeConstructed *retval;
    PyCannotBeConstructed *py_CannotBeConstructed;
    std::map<void*, PyObject*>::const_iterator wrapper_lookup_iter;
    
    retval = CannotBeConstructed::get_ptr();
    if (!(retval)) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    wrapper_lookup_iter = PyCannotBeConstructed_wrapper_registry.find((void *) retval);
    if (wrapper_lookup_iter == PyCannotBeConstructed_wrapper_registry.end()) {
        py_CannotBeConstructed = NULL;
    } else {
        py_CannotBeConstructed = (PyCannotBeConstructed *) wrapper_lookup_iter->second;
        Py_INCREF(py_CannotBeConstructed);
    }
    
    if (py_CannotBeConstructed == NULL) {
        py_CannotBeConstructed = PyObject_New(PyCannotBeConstructed, &PyCannotBeConstructed_Type);
        py_CannotBeConstructed->obj = retval;
        py_CannotBeConstructed->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
        PyCannotBeConstructed_wrapper_registry[(void *) py_CannotBeConstructed->obj] = (PyObject *) py_CannotBeConstructed;
    }
    py_retval = Py_BuildValue((char *) "N", py_CannotBeConstructed);
    return py_retval;
}


PyObject *
_wrap_PyCannotBeConstructed_get_value(void)
{
    PyObject *py_retval;
    PyCannotBeConstructed *py_CannotBeConstructed;
    
    CannotBeConstructed retval = CannotBeConstructed::get_value();
    py_CannotBeConstructed = PyObject_New(PyCannotBeConstructed, &PyCannotBeConstructed_Type);
    py_CannotBeConstructed->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    py_CannotBeConstructed->obj = new CannotBeConstructed(retval);
    PyCannotBeConstructed_wrapper_registry[(void *) py_CannotBeConstructed->obj] = (PyObject *) py_CannotBeConstructed;
    py_retval = Py_BuildValue((char *) "N", py_CannotBeConstructed);
    return py_retval;
}


static PyObject*
_wrap_PyCannotBeConstructed__copy__(PyCannotBeConstructed *self)
{

    PyCannotBeConstructed *py_copy;
    py_copy = PyObject_New(PyCannotBeConstructed, &PyCannotBeConstructed_Type);
    py_copy->obj = new CannotBeConstructed(*self->obj);
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyCannotBeConstructed_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyCannotBeConstructed_methods[] = {
    {(char *) "get_ptr", (PyCFunction) _wrap_PyCannotBeConstructed_get_ptr, METH_NOARGS|METH_STATIC, NULL },
    {(char *) "get_value", (PyCFunction) _wrap_PyCannotBeConstructed_get_value, METH_NOARGS|METH_STATIC, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyCannotBeConstructed__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyCannotBeConstructed__tp_dealloc(PyCannotBeConstructed *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyCannotBeConstructed_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyCannotBeConstructed_wrapper_registry.end()) {
        PyCannotBeConstructed_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        CannotBeConstructed *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyCannotBeConstructed__tp_richcompare (PyCannotBeConstructed *PYBINDGEN_UNUSED(self), PyCannotBeConstructed *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyCannotBeConstructed_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyCannotBeConstructed_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.CannotBeConstructed",            /* tp_name */
    sizeof(PyCannotBeConstructed),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyCannotBeConstructed__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyCannotBeConstructed__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyCannotBeConstructed_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyCannotBeConstructed__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyClassThatTakesFoo_wrapper_registry;


static int
_wrap_PyClassThatTakesFoo__tp_init__0(PyClassThatTakesFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyClassThatTakesFoo *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyClassThatTakesFoo_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new ClassThatTakesFoo(*((PyClassThatTakesFoo *) arg0)->obj);
    return 0;
}

static int
_wrap_PyClassThatTakesFoo__tp_init__1(PyClassThatTakesFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *foo;
    Foo foo2;
    const char *keywords[] = {"foo", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &foo)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (PyObject_IsInstance(foo, (PyObject*) &PyFoo_Type)) {
        foo2 = *((PyFoo *) foo)->obj;
    } else if (PyObject_IsInstance(foo, (PyObject*) &PyZoo_Type)) {
        foo2 = *((PyZoo *) foo)->obj;
    } else {
    
        PyErr_Format(PyExc_TypeError, "parameter must an instance of one of the types (Foo, Zoo), not %s", foo->ob_type->tp_name);
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new ClassThatTakesFoo(foo2);
    return 0;
}

int _wrap_PyClassThatTakesFoo__tp_init(PyClassThatTakesFoo *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyClassThatTakesFoo__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyClassThatTakesFoo__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}


PyObject *
_wrap_PyClassThatTakesFoo_get_foo(PyClassThatTakesFoo *self)
{
    PyObject *py_retval;
    PyFoo *py_Foo;
    
    Foo retval = self->obj->get_foo();
    py_Foo = PyObject_New(PyFoo, &PyFoo_Type);
    py_Foo->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    py_Foo->obj = new Foo(retval);
    py_Foo->obj->initialize();
    PyFoo_wrapper_registry[(void *) py_Foo->obj] = (PyObject *) py_Foo;
    py_retval = Py_BuildValue((char *) "N", py_Foo);
    return py_retval;
}


static PyObject*
_wrap_PyClassThatTakesFoo__copy__(PyClassThatTakesFoo *self)
{

    PyClassThatTakesFoo *py_copy;
    py_copy = PyObject_New(PyClassThatTakesFoo, &PyClassThatTakesFoo_Type);
    py_copy->obj = new ClassThatTakesFoo(*self->obj);
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyClassThatTakesFoo_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyClassThatTakesFoo_methods[] = {
    {(char *) "get_foo", (PyCFunction) _wrap_PyClassThatTakesFoo_get_foo, METH_NOARGS, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyClassThatTakesFoo__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyClassThatTakesFoo__tp_dealloc(PyClassThatTakesFoo *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyClassThatTakesFoo_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyClassThatTakesFoo_wrapper_registry.end()) {
        PyClassThatTakesFoo_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        ClassThatTakesFoo *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyClassThatTakesFoo__tp_richcompare (PyClassThatTakesFoo *PYBINDGEN_UNUSED(self), PyClassThatTakesFoo *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyClassThatTakesFoo_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyClassThatTakesFoo_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.ClassThatTakesFoo",            /* tp_name */
    sizeof(PyClassThatTakesFoo),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyClassThatTakesFoo__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyClassThatTakesFoo__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyClassThatTakesFoo_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyClassThatTakesFoo__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyClassThatThrows_wrapper_registry;

int
PyClassThatThrows__PythonHelper::throw_error() const throw (std::exception)
{
    PyGILState_STATE __py_gil_state;
    PyObject *py_method;
    ClassThatThrows *self_obj_before;
    PyObject *py_retval;
    int retval;
    
    __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
    py_method = PyObject_GetAttrString(m_pyself, (char *) "throw_error"); PyErr_Clear();
    if (py_method == NULL || py_method->ob_type == &PyCFunction_Type) {
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return ClassThatThrows::throw_error();
    }
    self_obj_before = reinterpret_cast< PyClassThatThrows* >(m_pyself)->obj;
    reinterpret_cast< PyClassThatThrows* >(m_pyself)->obj = const_cast< ClassThatThrows* >((const ClassThatThrows*) this);
    py_retval = PyObject_CallMethod(m_pyself, (char *) "throw_error", (char *) "");
    if (py_retval == NULL) {
        PyErr_Print();
        reinterpret_cast< PyClassThatThrows* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return ClassThatThrows::throw_error();
    }
    py_retval = Py_BuildValue((char*) "(N)", py_retval);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &retval)) {
        PyErr_Print();
        Py_DECREF(py_retval);
        reinterpret_cast< PyClassThatThrows* >(m_pyself)->obj = self_obj_before;
        Py_XDECREF(py_method);
        if (PyEval_ThreadsInitialized())
            PyGILState_Release(__py_gil_state);
        return ClassThatThrows::throw_error();
    }
    Py_DECREF(py_retval);
    reinterpret_cast< PyClassThatThrows* >(m_pyself)->obj = self_obj_before;
    Py_XDECREF(py_method);
    if (PyEval_ThreadsInitialized())
        PyGILState_Release(__py_gil_state);
    return retval;
}


static int
_wrap_PyClassThatThrows__tp_init__0(PyClassThatThrows *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyClassThatThrows *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyClassThatThrows_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (self->ob_type != &PyClassThatThrows_Type)
    {
        self->obj = new PyClassThatThrows__PythonHelper(*((PyClassThatThrows *) arg0)->obj);
        ((PyClassThatThrows__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
    } else {
        // visibility: 'public'
        self->obj = new ClassThatThrows(*((PyClassThatThrows *) arg0)->obj);
    }
    return 0;
}

static int
_wrap_PyClassThatThrows__tp_init__1(PyClassThatThrows *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    double x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &x)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    try
    {
        if (self->ob_type != &PyClassThatThrows_Type)
        {
            self->obj = new PyClassThatThrows__PythonHelper(x);
            ((PyClassThatThrows__PythonHelper*) self->obj)->set_pyobj((PyObject *)self);
        } else {
            // visibility: 'public'
            self->obj = new ClassThatThrows(x);
        }
    } catch (DomainError const &exc) {
        PyErr_SetNone((PyObject *) PyDomainError_Type);
        return -1;
    }
    return 0;
}

int _wrap_PyClassThatThrows__tp_init(PyClassThatThrows *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyClassThatThrows__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyClassThatThrows__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}


PyObject *
_wrap_PyClassThatThrows_throw_error(PyClassThatThrows *self)
{
    PyObject *py_retval;
    int retval;
    PyClassThatThrows__PythonHelper *helper_class = dynamic_cast<PyClassThatThrows__PythonHelper*> (self->obj);
    
    try
    {
        retval = (helper_class == NULL)? (self->obj->throw_error()) : (self->obj->ClassThatThrows::throw_error());
    } catch (std::exception const &exc) {
        PyErr_SetString((PyObject *) Pystd__exception_Type, exc.what());
        return NULL;
    }
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}


PyObject *
_wrap_PyClassThatThrows_my_inverse_method(PyClassThatThrows *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    double retval;
    double x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &x)) {
        return NULL;
    }
    try
    {
        retval = self->obj->my_inverse_method(x);
    } catch (DomainError const &exc) {
        PyErr_SetNone((PyObject *) PyDomainError_Type);
        return NULL;
    }
    py_retval = Py_BuildValue((char *) "d", retval);
    return py_retval;
}


PyObject *
_wrap_PyClassThatThrows_my_inverse_method2(PyClassThatThrows *self, PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    double retval;
    double x;
    const char *keywords[] = {"x", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &x)) {
        return NULL;
    }
    try
    {
        retval = self->obj->my_inverse_method2(x);
    } catch (std::exception const &exc) {
        PyErr_SetString((PyObject *) Pystd__exception_Type, exc.what());
        return NULL;
    }
    py_retval = Py_BuildValue((char *) "d", retval);
    return py_retval;
}


static PyObject*
_wrap_PyClassThatThrows__copy__(PyClassThatThrows *self)
{

    PyClassThatThrows *py_copy;
    py_copy = PyObject_GC_New(PyClassThatThrows, &PyClassThatThrows_Type);
    py_copy->obj = new ClassThatThrows(*self->obj);
    py_copy->inst_dict = NULL;
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyClassThatThrows_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyClassThatThrows_methods[] = {
    {(char *) "throw_error", (PyCFunction) _wrap_PyClassThatThrows_throw_error, METH_NOARGS, NULL },
    {(char *) "my_inverse_method", (PyCFunction) _wrap_PyClassThatThrows_my_inverse_method, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "my_inverse_method2", (PyCFunction) _wrap_PyClassThatThrows_my_inverse_method2, METH_KEYWORDS|METH_VARARGS, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyClassThatThrows__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
PyClassThatThrows__tp_clear(PyClassThatThrows *self)
{
    Py_CLEAR(self->inst_dict);
        ClassThatThrows *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyClassThatThrows__tp_traverse(PyClassThatThrows *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    if (self->obj && typeid(*self->obj) == typeid(PyClassThatThrows__PythonHelper) )
        Py_VISIT((PyObject *) self);

    return 0;
}


static void
_wrap_PyClassThatThrows__tp_dealloc(PyClassThatThrows *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyClassThatThrows_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyClassThatThrows_wrapper_registry.end()) {
        PyClassThatThrows_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyClassThatThrows__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyClassThatThrows__tp_richcompare (PyClassThatThrows *PYBINDGEN_UNUSED(self), PyClassThatThrows *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyClassThatThrows_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyClassThatThrows_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.ClassThatThrows",            /* tp_name */
    sizeof(PyClassThatThrows),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyClassThatThrows__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyClassThatThrows__tp_traverse,     /* tp_traverse */
    (inquiry)PyClassThatThrows__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyClassThatThrows__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyClassThatThrows_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyClassThatThrows, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyClassThatThrows__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};




pybindgen::TypeMap PyFoo__typeid_map;

std::map<void*, PyObject*> PyFoo_wrapper_registry;
static PyObject* _wrap_PyFoo__get_instance_count(PyObject * PYBINDGEN_UNUSED(obj), void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "i", Foo::instance_count);
    return py_retval;
}
static int _wrap_PyFoo__set_instance_count(PyFoo * PYBINDGEN_UNUSED(dummy), PyObject *value, void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "(O)", value);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &Foo::instance_count)) {
        Py_DECREF(py_retval);
        return -1;
    }
    Py_DECREF(py_retval);
    return 0;
}
static PyGetSetDef FooMeta__getsets[] = {
    {
        (char*) "instance_count", /* attribute name */
        (getter) _wrap_PyFoo__get_instance_count, /* C function to get the attribute */
        (setter) _wrap_PyFoo__set_instance_count, /* C function to set the attribute */
        NULL, /* optional doc string */
        NULL /* optional additional data for getter and setter */
    },
    { NULL, NULL, NULL, NULL, NULL }
};

PyTypeObject PyFooMeta_Type = {
	PyObject_HEAD_INIT(NULL)
	0,					/* ob_size */
	(char *) "FooMeta",		        /* tp_name */
	0,					/* tp_basicsize */
	0,					/* tp_itemsize */
	0,	 				/* tp_dealloc */
	0,					/* tp_print */
	0,					/* tp_getattr */
	0,					/* tp_setattr */
	0,					/* tp_compare */
	0,					/* tp_repr */
	0,					/* tp_as_number */
	0,					/* tp_as_sequence */
	0,		       			/* tp_as_mapping */
	0,					/* tp_hash */
	0,					/* tp_call */
	0,					/* tp_str */
	0,					/* tp_getattro */
	0,					/* tp_setattro */
	0,					/* tp_as_buffer */
	Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE, /* tp_flags */
 	0,					/* tp_doc */
	0,					/* tp_traverse */
 	0,					/* tp_clear */
	0,					/* tp_richcompare */
	0,					/* tp_weaklistoffset */
	0,					/* tp_iter */
	0,					/* tp_iternext */
	0,					/* tp_methods */
	0,					/* tp_members */
	FooMeta__getsets,				/* tp_getset */
	0,					/* tp_base */
	0,					/* tp_dict */
	0,	                                /* tp_descr_get */
	0,  		                        /* tp_descr_set */
	0,					/* tp_dictoffset */
	0,					/* tp_init */
	0,					/* tp_alloc */
	0,					/* tp_new */
	0,               			/* tp_free */
        0,                                      /* tp_is_gc */
        0,                                      /* tp_bases */
        0,                                      /* tp_mro */
        0,                                      /* tp_cache */
        0,                                      /* tp_subclasses */
        0,                                      /* tp_weaklist */
        0                                       /* tp_del */
};



static int
_wrap_PyFoo__tp_init__0(PyFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new Foo();
    self->obj->initialize();
    return 0;
}

static int
_wrap_PyFoo__tp_init__1(PyFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    int xpto;
    const char *keywords[] = {"xpto", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &xpto)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new Foo(xpto);
    self->obj->initialize();
    return 0;
}

static int
_wrap_PyFoo__tp_init__2(PyFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    const char *datum;
    Py_ssize_t datum_len;
    std::string datum_std;
    const char *keywords[] = {"datum", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &datum, &datum_len)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    datum_std = std::string(datum, datum_len);
    self->obj = new Foo(datum_std);
    self->obj->initialize();
    return 0;
}

static int
_wrap_PyFoo__tp_init__3(PyFoo *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *other;
    Foo other2;
    const char *keywords[] = {"other", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &other)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    if (PyObject_IsInstance(other, (PyObject*) &PyFoo_Type)) {
        other2 = *((PyFoo *) other)->obj;
    } else if (PyObject_IsInstance(other, (PyObject*) &PyZoo_Type)) {
        other2 = *((PyZoo *) other)->obj;
    } else {
    
        PyErr_Format(PyExc_TypeError, "parameter must an instance of one of the types (Foo, Zoo), not %s", other->ob_type->tp_name);
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new Foo(other2);
    self->obj->initialize();
    return 0;
}

int _wrap_PyFoo__tp_init(PyFoo *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[4] = {0,};
    retval = _wrap_PyFoo__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyFoo__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    retval = _wrap_PyFoo__tp_init__2(self, args, kwargs, &exceptions[2]);
    if (!exceptions[2]) {
        Py_DECREF(exceptions[0]);
        Py_DECREF(exceptions[1]);
        return retval;
    }
    retval = _wrap_PyFoo__tp_init__3(self, args, kwargs, &exceptions[3]);
    if (!exceptions[3]) {
        Py_DECREF(exceptions[0]);
        Py_DECREF(exceptions[1]);
        Py_DECREF(exceptions[2]);
        return retval;
    }
    error_list = PyList_New(4);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
    Py_DECREF(exceptions[2]);
    PyList_SET_ITEM(error_list, 3, PyObject_Str(exceptions[3]));
    Py_DECREF(exceptions[3]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}


PyObject *
_wrap_PyFoo_get_datum_deprecated(PyFoo *self)
{
    PyObject *py_retval;
    std::string retval;
    
    retval = self->obj->get_datum_deprecated();
    py_retval = Py_BuildValue((char *) "s#", (retval).c_str(), (retval).size());
    return py_retval;
}


PyObject *
_wrap_PyFoo_get_datum(PyFoo *self)
{
    PyObject *py_retval;
    std::string retval;
    
    retval = self->obj->get_datum();
    py_retval = Py_BuildValue((char *) "s#", (retval).c_str(), (retval).size());
    return py_retval;
}


PyObject *
_wrap_PyFoo_initialize(PyFoo *self)
{
    PyObject *py_retval;
    
    self->obj->initialize();
    Py_INCREF(Py_None);
    py_retval = Py_None;
    return py_retval;
}


PyObject *
_wrap_PyFoo_add_sub(PyFoo *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    int retval;
    int a;
    int b = 3;
    bool subtract;
    PyObject *py_subtract = NULL;
    const char *keywords[] = {"a", "b", "subtract", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i|iO", (char **) keywords, &a, &b, &py_subtract)) {
        return NULL;
    }
    subtract = py_subtract? (bool) PyObject_IsTrue(py_subtract) : false;
    retval = Foo::add_sub(a, b, subtract);
    py_retval = Py_BuildValue((char *) "i", retval);
    return py_retval;
}


PyObject *
_wrap_PyFoo_is_initialized(PyFoo *self)
{
    PyObject *py_retval;
    bool retval;
    
    retval = self->obj->is_initialized();
    py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
    return py_retval;
}


static PyObject*
_wrap_PyFoo__copy__(PyFoo *self)
{

    PyFoo *py_copy;
    py_copy = PyObject_New(PyFoo, &PyFoo_Type);
    py_copy->obj = new Foo(*self->obj);
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyFoo_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyFoo_methods[] = {
    {(char *) "get_datum_deprecated", (PyCFunction) _wrap_PyFoo_get_datum_deprecated, METH_NOARGS, NULL },
    {(char *) "get_datum", (PyCFunction) _wrap_PyFoo_get_datum, METH_NOARGS, NULL },
    {(char *) "initialize", (PyCFunction) _wrap_PyFoo_initialize, METH_NOARGS, NULL },
    {(char *) "add_sub", (PyCFunction) _wrap_PyFoo_add_sub, METH_KEYWORDS|METH_VARARGS|METH_STATIC, NULL },
    {(char *) "is_initialized", (PyCFunction) _wrap_PyFoo_is_initialized, METH_NOARGS, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyFoo__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyFoo__tp_dealloc(PyFoo *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyFoo_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyFoo_wrapper_registry.end()) {
        PyFoo_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        Foo *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}



static PyObject *
_wrap_PyFoo__tp_str(PyFoo *self)
{
    std::ostringstream oss;
    oss << *self->obj;
    return PyString_FromString(oss.str ().c_str ());
}


static PyObject*
_wrap_PyFoo__tp_richcompare (PyFoo *PYBINDGEN_UNUSED(self), PyFoo *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyFoo_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyFoo_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Foo",            /* tp_name */
    sizeof(PyFoo),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyFoo__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)_wrap_PyFoo__tp_str,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyFoo__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyFoo_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyFoo__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyFoobar_wrapper_registry;
static PyObject* _wrap_PyFoobar__get_instance_count(PyObject * PYBINDGEN_UNUSED(obj), void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "i", Foobar::instance_count);
    return py_retval;
}
static int _wrap_PyFoobar__set_instance_count(PyFoobar * PYBINDGEN_UNUSED(dummy), PyObject *value, void * PYBINDGEN_UNUSED(closure))
{
    PyObject *py_retval;
    
    py_retval = Py_BuildValue((char *) "(O)", value);
    if (!PyArg_ParseTuple(py_retval, (char *) "i", &Foobar::instance_count)) {
        Py_DECREF(py_retval);
        return -1;
    }
    Py_DECREF(py_retval);
    return 0;
}
static PyGetSetDef FoobarMeta__getsets[] = {
    {
        (char*) "instance_count", /* attribute name */
        (getter) _wrap_PyFoobar__get_instance_count, /* C function to get the attribute */
        (setter) _wrap_PyFoobar__set_instance_count, /* C function to set the attribute */
        NULL, /* optional doc string */
        NULL /* optional additional data for getter and setter */
    },
    { NULL, NULL, NULL, NULL, NULL }
};

PyTypeObject PyFoobarMeta_Type = {
	PyObject_HEAD_INIT(NULL)
	0,					/* ob_size */
	(char *) "FoobarMeta",		        /* tp_name */
	0,					/* tp_basicsize */
	0,					/* tp_itemsize */
	0,	 				/* tp_dealloc */
	0,					/* tp_print */
	0,					/* tp_getattr */
	0,					/* tp_setattr */
	0,					/* tp_compare */
	0,					/* tp_repr */
	0,					/* tp_as_number */
	0,					/* tp_as_sequence */
	0,		       			/* tp_as_mapping */
	0,					/* tp_hash */
	0,					/* tp_call */
	0,					/* tp_str */
	0,					/* tp_getattro */
	0,					/* tp_setattro */
	0,					/* tp_as_buffer */
	Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE, /* tp_flags */
 	0,					/* tp_doc */
	0,					/* tp_traverse */
 	0,					/* tp_clear */
	0,					/* tp_richcompare */
	0,					/* tp_weaklistoffset */
	0,					/* tp_iter */
	0,					/* tp_iternext */
	0,					/* tp_methods */
	0,					/* tp_members */
	FoobarMeta__getsets,				/* tp_getset */
	0,					/* tp_base */
	0,					/* tp_dict */
	0,	                                /* tp_descr_get */
	0,  		                        /* tp_descr_set */
	0,					/* tp_dictoffset */
	0,					/* tp_init */
	0,					/* tp_alloc */
	0,					/* tp_new */
	0,               			/* tp_free */
        0,                                      /* tp_is_gc */
        0,                                      /* tp_bases */
        0,                                      /* tp_mro */
        0,                                      /* tp_cache */
        0,                                      /* tp_subclasses */
        0,                                      /* tp_weaklist */
        0                                       /* tp_del */
};


static int
_wrap_PyFoobar__tp_init(PyFoobar *self, PyObject *args, PyObject *kwargs)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        return -1;
    }
    self->obj = new Foobar();
    return 0;
}

static PyMethodDef PyFoobar_methods[] = {
    {NULL, NULL, 0, NULL}
};

static void
PyFoobar__tp_clear(PyFoobar *self)
{
    Py_CLEAR(self->inst_dict);
        Foobar *tmp = self->obj;
    self->obj = NULL;
    if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
        delete tmp;
    }
}


static int
PyFoobar__tp_traverse(PyFoobar *self, visitproc visit, void *arg)
{
    Py_VISIT(self->inst_dict);
    
    return 0;
}


static void
_wrap_PyFoobar__tp_dealloc(PyFoobar *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyFoobar_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyFoobar_wrapper_registry.end()) {
        PyFoobar_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
    PyFoobar__tp_clear(self);
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyFoobar__tp_richcompare (PyFoobar *PYBINDGEN_UNUSED(self), PyFoobar *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyFoobar_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyFoobar_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Foobar",            /* tp_name */
    sizeof(PyFoobar),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyFoobar__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)PyFoobar__tp_traverse,     /* tp_traverse */
    (inquiry)PyFoobar__tp_clear,             /* tp_clear */
    (richcmpfunc)_wrap_PyFoobar__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyFoobar_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    offsetof(PyFoobar, inst_dict),                 /* tp_dictoffset */
    (initproc)_wrap_PyFoobar__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



std::map<void*, PyObject*> PyInterfaceId_wrapper_registry;

static int
_wrap_PyInterfaceId__tp_init(PyInterfaceId *self, PyObject *args, PyObject *kwargs)
{
    PyInterfaceId *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyInterfaceId_Type, &arg0)) {
        return -1;
    }
    self->obj = new InterfaceId(*((PyInterfaceId *) arg0)->obj);
    return 0;
}


static PyObject*
_wrap_PyInterfaceId__copy__(PyInterfaceId *self)
{

    PyInterfaceId *py_copy;
    py_copy = PyObject_New(PyInterfaceId, &PyInterfaceId_Type);
    py_copy->obj = new InterfaceId(*self->obj);
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyInterfaceId_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyInterfaceId_methods[] = {
    {(char *) "__copy__", (PyCFunction) _wrap_PyInterfaceId__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyInterfaceId__tp_dealloc(PyInterfaceId *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyInterfaceId_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyInterfaceId_wrapper_registry.end()) {
        PyInterfaceId_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        InterfaceId *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyInterfaceId__tp_richcompare (PyInterfaceId *PYBINDGEN_UNUSED(self), PyInterfaceId *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyInterfaceId_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyInterfaceId_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.InterfaceId",            /* tp_name */
    sizeof(PyInterfaceId),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyInterfaceId__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyInterfaceId__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyInterfaceId_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyInterfaceId__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};





static int
_wrap_PyBar__tp_init__0(PyBar *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new Bar();
    self->obj->initialize();
    return 0;
}

static int
_wrap_PyBar__tp_init__1(PyBar *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyBar *arg0;
    const char *keywords[] = {"arg0", NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyBar_Type, &arg0)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return -1;
    }
    self->obj = new Bar(*((PyBar *) arg0)->obj);
    self->obj->initialize();
    return 0;
}

int _wrap_PyBar__tp_init(PyBar *self, PyObject *args, PyObject *kwargs)
{
    int retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyBar__tp_init__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyBar__tp_init__1(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return -1;
}



PyObject *
_wrap_PyBar_Hooray__0(PyBar *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs, PyObject **return_exception)
{
    PyObject *py_retval;
    std::string retval;
    const char *keywords[] = {NULL};
    
    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
        {
            PyObject *exc_type, *traceback;
            PyErr_Fetch(&exc_type, return_exception, &traceback);
            Py_XDECREF(exc_type);
            Py_XDECREF(traceback);
        }
        return NULL;
    }
    retval = Bar::Hooray();
    py_retval = Py_BuildValue((char *) "s#", (retval).c_str(), (retval).size());
    return py_retval;
}


static PyObject *
_wrap_PyBar_Hooray_lenx(PyBar *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
                        PyObject **return_exception)
{
    PyObject *py_retval;
    int x;
    const char *keywords[] = {"x", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
        PyObject *exc_type, *traceback;
        PyErr_Fetch(&exc_type, return_exception, &traceback);
        Py_XDECREF(exc_type);
        Py_XDECREF(traceback);
        return NULL;
    }

    std::string retval;
    retval = Bar::Hooray();
    py_retval = Py_BuildValue((char *) "i", int(retval.size() + x));
    return py_retval;
}


PyObject * _wrap_PyBar_Hooray(PyBar *self, PyObject *args, PyObject *kwargs)
{
    PyObject * retval;
    PyObject *error_list;
    PyObject *exceptions[2] = {0,};
    retval = _wrap_PyBar_Hooray__0(self, args, kwargs, &exceptions[0]);
    if (!exceptions[0]) {
        return retval;
    }
    retval = _wrap_PyBar_Hooray_lenx(self, args, kwargs, &exceptions[1]);
    if (!exceptions[1]) {
        Py_DECREF(exceptions[0]);
        return retval;
    }
    error_list = PyList_New(2);
    PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
    Py_DECREF(exceptions[0]);
    PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
    Py_DECREF(exceptions[1]);
    PyErr_SetObject(PyExc_TypeError, error_list);
    Py_DECREF(error_list);
    return NULL;
}


static PyObject*
_wrap_PyBar__copy__(PyBar *self)
{

    PyBar *py_copy;
    py_copy = PyObject_New(PyBar, &PyBar_Type);
    py_copy->obj = new Bar(*self->obj);
    py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
    PyFoo_wrapper_registry[(void *) py_copy->obj] = (PyObject *) py_copy;
    return (PyObject*) py_copy;
}

static PyMethodDef PyBar_methods[] = {
    {(char *) "Hooray", (PyCFunction) _wrap_PyBar_Hooray, METH_KEYWORDS|METH_VARARGS|METH_STATIC, NULL },
    {(char *) "__copy__", (PyCFunction) _wrap_PyBar__copy__, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
};

static void
_wrap_PyBar__tp_dealloc(PyBar *self)
{
    std::map<void*, PyObject*>::iterator wrapper_lookup_iter;
    wrapper_lookup_iter = PyFoo_wrapper_registry.find((void *) self->obj);
    if (wrapper_lookup_iter != PyFoo_wrapper_registry.end()) {
        PyFoo_wrapper_registry.erase(wrapper_lookup_iter);
    }
    
        Bar *tmp = self->obj;
        self->obj = NULL;
        if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
            delete tmp;
        }
    self->ob_type->tp_free((PyObject*)self);
}

static PyObject*
_wrap_PyBar__tp_richcompare (PyBar *PYBINDGEN_UNUSED(self), PyBar *other, int opid)
{
    
    if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyBar_Type)) {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }
    switch (opid)
    {
    case Py_LT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_LE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_EQ:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_NE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GE:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    case Py_GT:
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    } /* closes switch (opid) */
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}

PyTypeObject PyBar_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Bar",            /* tp_name */
    sizeof(PyBar),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_PyBar__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)_wrap_PyBar__tp_richcompare,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)NULL,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)PyBar_methods, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    0,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_PyBar__tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};




static void
Pystd__vector__lt___std__string___gt__Iter__tp_clear(Pystd__vector__lt___std__string___gt__Iter *self)
{
    Py_CLEAR(self->container);
    delete self->iterator;
    self->iterator = NULL;

}


static int
Pystd__vector__lt___std__string___gt__Iter__tp_traverse(Pystd__vector__lt___std__string___gt__Iter *self, visitproc visit, void *arg)
{
    Py_VISIT((PyObject *) self->container);
    return 0;
}


static void
_wrap_Pystd__vector__lt___std__string___gt____tp_dealloc(Pystd__vector__lt___std__string___gt__ *self)
{
    delete self->obj;
    self->obj = NULL;

    self->ob_type->tp_free((PyObject*)self);
}


static void
_wrap_Pystd__vector__lt___std__string___gt__Iter__tp_dealloc(Pystd__vector__lt___std__string___gt__Iter *self)
{
    Py_CLEAR(self->container);
    delete self->iterator;
    self->iterator = NULL;

    self->ob_type->tp_free((PyObject*)self);
}


static PyObject*
_wrap_Pystd__vector__lt___std__string___gt____tp_iter(Pystd__vector__lt___std__string___gt__ *self)
{
    Pystd__vector__lt___std__string___gt__Iter *iter = PyObject_GC_New(Pystd__vector__lt___std__string___gt__Iter, &Pystd__vector__lt___std__string___gt__Iter_Type);
    Py_INCREF(self);
    iter->container = self;
    iter->iterator = new std::vector< std::string >::iterator(self->obj->begin());
    return (PyObject*) iter;
}


static PyObject*
_wrap_Pystd__vector__lt___std__string___gt__Iter__tp_iter(Pystd__vector__lt___std__string___gt__Iter *self)
{
    Py_INCREF(self);
    return (PyObject*) self;
}

static PyObject* _wrap_Pystd__vector__lt___std__string___gt__Iter__tp_iternext(Pystd__vector__lt___std__string___gt__Iter *self)
{
    PyObject *py_retval;
    std::vector< std::string >::iterator iter;
    
    iter = *self->iterator;
    if (iter == self->container->obj->end()) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    ++(*self->iterator);
    py_retval = Py_BuildValue((char *) "s#", ((*iter)).c_str(), ((*iter)).size());
    return py_retval;
}

int _wrap_convert_py2c__std__string(PyObject *value, std::string *address)
{
    PyObject *py_retval;
    const char *retval_ptr;
    Py_ssize_t retval_len;
    
    py_retval = Py_BuildValue((char *) "(O)", value);
    if (!PyArg_ParseTuple(py_retval, (char *) "s#", &retval_ptr, &retval_len)) {
        Py_DECREF(py_retval);
        return 0;
    }
    *address = std::string(retval_ptr, retval_len);
    Py_DECREF(py_retval);
    return 1;
}


int _wrap_convert_py2c__std__vector__lt___std__string___gt__(PyObject *arg, std::vector< std::string > *container)
{
    if (PyObject_IsInstance(arg, (PyObject*) &Pystd__vector__lt___std__string___gt___Type)) {
        *container = *((Pystd__vector__lt___std__string___gt__*)arg)->obj;
    } else if (PyList_Check(arg)) {
        container->clear();
        Py_ssize_t size = PyList_Size(arg);
        for (Py_ssize_t i = 0; i < size; i++) {
            std::string item;
            if (!_wrap_convert_py2c__std__string(PyList_GET_ITEM(arg, i), &item)) {
                return 0;
            }
            container->push_back(item);
        }
    } else {
        PyErr_SetString(PyExc_TypeError, "parameter must be None, a Std__vector__lt___std__string___gt__ instance, or a list of std::string");
        return 0;
    }
    return 1;
}


static int
_wrap_Pystd__vector__lt___std__string___gt____tp_init(Pystd__vector__lt___std__string___gt__ *self, PyObject *args, PyObject *kwargs)
{
    const char *keywords[] = {"arg", NULL};
    PyObject *arg = NULL;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|O", (char **) keywords, &arg)) {
        return -1;
    }

    self->obj = new std::vector< std::string >;

    if (arg == NULL)
        return 0;

    if (!_wrap_convert_py2c__std__vector__lt___std__string___gt__(arg, self->obj)) {
        delete self->obj;
        self->obj = NULL;
        return -1;
    }
    return 0;
}

PyTypeObject Pystd__vector__lt___std__string___gt___Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Std__vector__lt___std__string___gt__",            /* tp_name */
    sizeof(Pystd__vector__lt___std__string___gt__),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_Pystd__vector__lt___std__string___gt____tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)NULL,     /* tp_traverse */
    (inquiry)NULL,             /* tp_clear */
    (richcmpfunc)NULL,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)_wrap_Pystd__vector__lt___std__string___gt____tp_iter,          /* tp_iter */
    (iternextfunc)NULL,     /* tp_iternext */
    (struct PyMethodDef*)NULL, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    NULL,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)_wrap_Pystd__vector__lt___std__string___gt____tp_init,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};

PyTypeObject Pystd__vector__lt___std__string___gt__Iter_Type = {
    PyObject_HEAD_INIT(NULL)
    0,                                 /* ob_size */
    (char *) "foo4.Std__vector__lt___std__string___gt__Iter",            /* tp_name */
    sizeof(Pystd__vector__lt___std__string___gt__Iter),                  /* tp_basicsize */
    0,                                 /* tp_itemsize */
    /* methods */
    (destructor)_wrap_Pystd__vector__lt___std__string___gt__Iter__tp_dealloc,        /* tp_dealloc */
    (printfunc)0,                      /* tp_print */
    (getattrfunc)NULL,       /* tp_getattr */
    (setattrfunc)NULL,       /* tp_setattr */
    (cmpfunc)NULL,           /* tp_compare */
    (reprfunc)NULL,             /* tp_repr */
    (PyNumberMethods*)NULL,     /* tp_as_number */
    (PySequenceMethods*)NULL, /* tp_as_sequence */
    (PyMappingMethods*)NULL,   /* tp_as_mapping */
    (hashfunc)NULL,             /* tp_hash */
    (ternaryfunc)NULL,          /* tp_call */
    (reprfunc)NULL,              /* tp_str */
    (getattrofunc)NULL,     /* tp_getattro */
    (setattrofunc)NULL,     /* tp_setattro */
    (PyBufferProcs*)NULL,  /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC,                      /* tp_flags */
    NULL,                        /* Documentation string */
    (traverseproc)Pystd__vector__lt___std__string___gt__Iter__tp_traverse,     /* tp_traverse */
    (inquiry)Pystd__vector__lt___std__string___gt__Iter__tp_clear,             /* tp_clear */
    (richcmpfunc)NULL,   /* tp_richcompare */
    0,             /* tp_weaklistoffset */
    (getiterfunc)_wrap_Pystd__vector__lt___std__string___gt__Iter__tp_iter,          /* tp_iter */
    (iternextfunc)_wrap_Pystd__vector__lt___std__string___gt__Iter__tp_iternext,     /* tp_iternext */
    (struct PyMethodDef*)NULL, /* tp_methods */
    (struct PyMemberDef*)0,              /* tp_members */
    NULL,                     /* tp_getset */
    NULL,                              /* tp_base */
    NULL,                              /* tp_dict */
    (descrgetfunc)NULL,    /* tp_descr_get */
    (descrsetfunc)NULL,    /* tp_descr_set */
    0,                 /* tp_dictoffset */
    (initproc)NULL,             /* tp_init */
    (allocfunc)PyType_GenericAlloc,           /* tp_alloc */
    (newfunc)PyType_GenericNew,               /* tp_new */
    (freefunc)0,             /* tp_free */
    (inquiry)NULL,             /* tp_is_gc */
    NULL,                              /* tp_bases */
    NULL,                              /* tp_mro */
    NULL,                              /* tp_cache */
    NULL,                              /* tp_subclasses */
    NULL,                              /* tp_weaklist */
    (destructor) NULL                  /* tp_del */
};



PyTypeObject *PyError_Type;


PyTypeObject *PyDomainError_Type;

