/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtCore.h"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
#include <qthreadpool.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobject.sip"
#include <qobject.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qrunnable.sip"
#include <qrunnable.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 146 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 41 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 44 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 47 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 247 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 50 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 235 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 53 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 56 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 59 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 62 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 65 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 149 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 68 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 71 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthread.sip"
#include <qthread.h>
#line 74 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 77 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qregexp.sip"
#include <qregexp.h>
#line 80 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qregularexpression.sip"
#include <qregularexpression.h>
#line 83 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 86 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"


class sipQThreadPool : public  ::QThreadPool
{
public:
    sipQThreadPool( ::QObject*);
    virtual ~sipQThreadPool();

    int qt_metacall(QMetaObject::Call, int, void **) SIP_OVERRIDE;
    void *qt_metacast(const char *) SIP_OVERRIDE;
    const QMetaObject *metaObject() const SIP_OVERRIDE;

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool event( ::QEvent*) SIP_OVERRIDE;
    bool eventFilter( ::QObject*, ::QEvent*) SIP_OVERRIDE;
    void timerEvent( ::QTimerEvent*) SIP_OVERRIDE;
    void childEvent( ::QChildEvent*) SIP_OVERRIDE;
    void customEvent( ::QEvent*) SIP_OVERRIDE;
    void connectNotify(const  ::QMetaMethod&) SIP_OVERRIDE;
    void disconnectNotify(const  ::QMetaMethod&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQThreadPool(const sipQThreadPool &);
    sipQThreadPool &operator = (const sipQThreadPool &);

    char sipPyMethods[7];
};

sipQThreadPool::sipQThreadPool( ::QObject*a0):  ::QThreadPool(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQThreadPool::~sipQThreadPool()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

const QMetaObject *sipQThreadPool::metaObject() const
{
    if (sipGetInterpreter())
        return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : sip_QtCore_qt_metaobject(sipPySelf,sipType_QThreadPool);

    return  ::QThreadPool::metaObject();
}

int sipQThreadPool::qt_metacall(QMetaObject::Call _c,int _id,void **_a)
{
    _id =  ::QThreadPool::qt_metacall(_c,_id,_a);

    if (_id >= 0)
    {
        SIP_BLOCK_THREADS
        _id = sip_QtCore_qt_metacall(sipPySelf,sipType_QThreadPool,_c,_id,_a);
        SIP_UNBLOCK_THREADS
    }

    return _id;
}

void *sipQThreadPool::qt_metacast(const char *_clname)
{
    void *sipCpp;

    return (sip_QtCore_qt_metacast(sipPySelf, sipType_QThreadPool, _clname, &sipCpp) ? sipCpp :  ::QThreadPool::qt_metacast(_clname));
}

bool sipQThreadPool::event( ::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_event);

    if (!sipMeth)
        return  ::QThreadPool::event(a0);

    extern bool sipVH_QtCore_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QEvent*);

    return sipVH_QtCore_0(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

bool sipQThreadPool::eventFilter( ::QObject*a0, ::QEvent*a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_eventFilter);

    if (!sipMeth)
        return  ::QThreadPool::eventFilter(a0,a1);

    extern bool sipVH_QtCore_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QObject*, ::QEvent*);

    return sipVH_QtCore_1(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0, a1);
}

void sipQThreadPool::timerEvent( ::QTimerEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_timerEvent);

    if (!sipMeth)
    {
         ::QThreadPool::timerEvent(a0);
        return;
    }

    extern void sipVH_QtCore_2(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QTimerEvent*);

    sipVH_QtCore_2(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQThreadPool::childEvent( ::QChildEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_childEvent);

    if (!sipMeth)
    {
         ::QThreadPool::childEvent(a0);
        return;
    }

    extern void sipVH_QtCore_3(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QChildEvent*);

    sipVH_QtCore_3(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQThreadPool::customEvent( ::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, SIP_NULLPTR, sipName_customEvent);

    if (!sipMeth)
    {
         ::QThreadPool::customEvent(a0);
        return;
    }

    extern void sipVH_QtCore_4(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QEvent*);

    sipVH_QtCore_4(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQThreadPool::connectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, SIP_NULLPTR, sipName_connectNotify);

    if (!sipMeth)
    {
         ::QThreadPool::connectNotify(a0);
        return;
    }

    extern void sipVH_QtCore_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QMetaMethod&);

    sipVH_QtCore_5(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQThreadPool::disconnectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_disconnectNotify);

    if (!sipMeth)
    {
         ::QThreadPool::disconnectNotify(a0);
        return;
    }

    extern void sipVH_QtCore_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QMetaMethod&);

    sipVH_QtCore_5(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}


PyDoc_STRVAR(doc_QThreadPool_globalInstance, "globalInstance() -> QThreadPool");

extern "C" {static PyObject *meth_QThreadPool_globalInstance(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_globalInstance(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
             ::QThreadPool*sipRes;
            PyObject *sipResObj;

            sipRes =  ::QThreadPool::globalInstance();

            sipResObj = sipConvertFromType(sipRes,sipType_QThreadPool,SIP_NULLPTR);

            sipKeepReference(SIP_NULLPTR, -10, sipResObj);

            return sipResObj;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_globalInstance, doc_QThreadPool_globalInstance);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_start, "start(self, QRunnable, priority: int = 0)\n"
"start(self, Callable[[], None], priority: int = 0)");

extern "C" {static PyObject *meth_QThreadPool_start(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_start(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QRunnable* a0;
        PyObject *a0Wrapper;
        int a1 = 0;
         ::QThreadPool *sipCpp;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_priority,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B@J8|i", &sipSelf, sipType_QThreadPool, &sipCpp, &a0Wrapper, sipType_QRunnable, &a0, &a1))
        {
#line 35 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
        // We have to handle the object ownership manually.
        if (a0->autoDelete())
            sipTransferTo(a0Wrapper, sipSelf);
        
        Py_BEGIN_ALLOW_THREADS
        sipCpp->start(a0, a1);
        Py_END_ALLOW_THREADS
#line 343 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        PyObject * a0;
        int a1 = 0;
         ::QThreadPool *sipCpp;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_priority,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BF|i", &sipSelf, sipType_QThreadPool, &sipCpp, &a0, &a1))
        {
#line 47 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
        Py_INCREF(a0);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->start([a0]() {
            SIP_BLOCK_THREADS
        
            PyObject *res;
        
            res = PyObject_CallObject(a0, NULL);
        
            Py_DECREF(a0);
        
            if (res)
                Py_DECREF(res);
            else
                pyqt5_err_print();
        
            SIP_UNBLOCK_THREADS
        }, a1);
        
        Py_END_ALLOW_THREADS
#line 385 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_start, doc_QThreadPool_start);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_tryStart, "tryStart(self, QRunnable) -> bool\n"
"tryStart(self, Callable[[], None]) -> bool");

extern "C" {static PyObject *meth_QThreadPool_tryStart(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_tryStart(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QRunnable* a0;
        PyObject *a0Wrapper;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B@J8", &sipSelf, sipType_QThreadPool, &sipCpp, &a0Wrapper, sipType_QRunnable, &a0))
        {
            bool sipRes = 0;

#line 74 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
        // We have to handle the object ownership manually.
        if (a0->autoDelete())
            sipTransferTo(a0Wrapper, sipSelf);
        
        Py_BEGIN_ALLOW_THREADS
        sipRes = sipCpp->tryStart(a0);
        Py_END_ALLOW_THREADS
#line 425 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

            return PyBool_FromLong(sipRes);
        }
    }

    {
        PyObject * a0;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BF", &sipSelf, sipType_QThreadPool, &sipCpp, &a0))
        {
            bool sipRes = 0;

#line 86 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
        Py_INCREF(a0);
        
        Py_BEGIN_ALLOW_THREADS
        
        sipRes = sipCpp->tryStart([a0]() {
            SIP_BLOCK_THREADS
        
            PyObject *res;
        
            res = PyObject_CallObject(a0, NULL);
        
            Py_DECREF(a0);
        
            if (res)
                Py_DECREF(res);
            else
                pyqt5_err_print();
        
            SIP_UNBLOCK_THREADS
        });
        
        Py_END_ALLOW_THREADS
#line 462 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_tryStart, doc_QThreadPool_tryStart);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_tryTake, "tryTake(self, QRunnable) -> bool");

extern "C" {static PyObject *meth_QThreadPool_tryTake(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_tryTake(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QRunnable* a0;
        PyObject *a0Wrapper;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B@J8", &sipSelf, sipType_QThreadPool, &sipCpp, &a0Wrapper, sipType_QRunnable, &a0))
        {
            bool sipRes = 0;

#line 114 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthreadpool.sip"
        Py_BEGIN_ALLOW_THREADS
        sipRes = sipCpp->tryTake(a0);
        Py_END_ALLOW_THREADS
        
        // We have to handle the object ownership manually.
        if (sipRes)
            sipTransferBack(a0Wrapper);
#line 499 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThreadPool.cpp"

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_tryTake, doc_QThreadPool_tryTake);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_expiryTimeout, "expiryTimeout(self) -> int");

extern "C" {static PyObject *meth_QThreadPool_expiryTimeout(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_expiryTimeout(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->expiryTimeout();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_expiryTimeout, doc_QThreadPool_expiryTimeout);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_setExpiryTimeout, "setExpiryTimeout(self, int)");

extern "C" {static PyObject *meth_QThreadPool_setExpiryTimeout(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_setExpiryTimeout(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QThreadPool, &sipCpp, &a0))
        {
            sipCpp->setExpiryTimeout(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_setExpiryTimeout, doc_QThreadPool_setExpiryTimeout);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_maxThreadCount, "maxThreadCount(self) -> int");

extern "C" {static PyObject *meth_QThreadPool_maxThreadCount(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_maxThreadCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->maxThreadCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_maxThreadCount, doc_QThreadPool_maxThreadCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_setMaxThreadCount, "setMaxThreadCount(self, int)");

extern "C" {static PyObject *meth_QThreadPool_setMaxThreadCount(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_setMaxThreadCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QThreadPool, &sipCpp, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->setMaxThreadCount(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_setMaxThreadCount, doc_QThreadPool_setMaxThreadCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_activeThreadCount, "activeThreadCount(self) -> int");

extern "C" {static PyObject *meth_QThreadPool_activeThreadCount(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_activeThreadCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            int sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->activeThreadCount();
            Py_END_ALLOW_THREADS

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_activeThreadCount, doc_QThreadPool_activeThreadCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_reserveThread, "reserveThread(self)");

extern "C" {static PyObject *meth_QThreadPool_reserveThread(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_reserveThread(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->reserveThread();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_reserveThread, doc_QThreadPool_reserveThread);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_releaseThread, "releaseThread(self)");

extern "C" {static PyObject *meth_QThreadPool_releaseThread(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_releaseThread(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->releaseThread();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_releaseThread, doc_QThreadPool_releaseThread);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_waitForDone, "waitForDone(self, msecs: int = -1) -> bool");

extern "C" {static PyObject *meth_QThreadPool_waitForDone(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_waitForDone(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0 = -1;
         ::QThreadPool *sipCpp;

        static const char *sipKwdList[] = {
            sipName_msecs,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|i", &sipSelf, sipType_QThreadPool, &sipCpp, &a0))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->waitForDone(a0);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_waitForDone, doc_QThreadPool_waitForDone);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_clear, "clear(self)");

extern "C" {static PyObject *meth_QThreadPool_clear(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_clear(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->clear();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_clear, doc_QThreadPool_clear);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_cancel, "cancel(self, QRunnable)");

extern "C" {static PyObject *meth_QThreadPool_cancel(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_cancel(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QRunnable* a0;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QThreadPool, &sipCpp, sipType_QRunnable, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->cancel(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_cancel, doc_QThreadPool_cancel);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_setStackSize, "setStackSize(self, int)");

extern "C" {static PyObject *meth_QThreadPool_setStackSize(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_setStackSize(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::uint a0;
         ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bu", &sipSelf, sipType_QThreadPool, &sipCpp, &a0))
        {
            sipCpp->setStackSize(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_setStackSize, doc_QThreadPool_setStackSize);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThreadPool_stackSize, "stackSize(self) -> int");

extern "C" {static PyObject *meth_QThreadPool_stackSize(PyObject *, PyObject *);}
static PyObject *meth_QThreadPool_stackSize(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QThreadPool *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThreadPool, &sipCpp))
        {
             ::uint sipRes;

            sipRes = sipCpp->stackSize();

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThreadPool, sipName_stackSize, doc_QThreadPool_stackSize);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QThreadPool(void *, const sipTypeDef *);}
static void *cast_QThreadPool(void *sipCppV, const sipTypeDef *targetType)
{
     ::QThreadPool *sipCpp = reinterpret_cast< ::QThreadPool *>(sipCppV);

    if (targetType == sipType_QThreadPool)
        return sipCppV;

    if (targetType == sipType_QObject)
        return static_cast< ::QObject *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QThreadPool(void *, int);}
static void release_QThreadPool(void *sipCppV, int)
{
     ::QThreadPool *sipCpp = reinterpret_cast< ::QThreadPool *>(sipCppV);

    Py_BEGIN_ALLOW_THREADS

    if (QThread::currentThread() == sipCpp->thread())
        delete sipCpp;
    else
        sipCpp->deleteLater();

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_QThreadPool(Py_ssize_t);}
static void *array_QThreadPool(Py_ssize_t sipNrElem)
{
    return new  ::QThreadPool[sipNrElem];
}


extern "C" {static void array_delete_QThreadPool(void *);}
static void array_delete_QThreadPool(void *sipCpp)
{
    delete[] reinterpret_cast< ::QThreadPool *>(sipCpp);
}


extern "C" {static void dealloc_QThreadPool(sipSimpleWrapper *);}
static void dealloc_QThreadPool(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQThreadPool *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QThreadPool(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QThreadPool(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QThreadPool(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **sipOwner, PyObject **sipParseErr)
{
    sipQThreadPool *sipCpp = SIP_NULLPTR;

    {
         ::QObject* a0 = 0;

        static const char *sipKwdList[] = {
            sipName_parent,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|JH", sipType_QObject, &a0, sipOwner))
        {
            sipCpp = new sipQThreadPool(a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QThreadPool[] = {{191, 255, 1}};


static PyMethodDef methods_QThreadPool[] = {
    {sipName_activeThreadCount, meth_QThreadPool_activeThreadCount, METH_VARARGS, doc_QThreadPool_activeThreadCount},
    {sipName_cancel, meth_QThreadPool_cancel, METH_VARARGS, doc_QThreadPool_cancel},
    {sipName_clear, meth_QThreadPool_clear, METH_VARARGS, doc_QThreadPool_clear},
    {sipName_expiryTimeout, meth_QThreadPool_expiryTimeout, METH_VARARGS, doc_QThreadPool_expiryTimeout},
    {sipName_globalInstance, meth_QThreadPool_globalInstance, METH_VARARGS, doc_QThreadPool_globalInstance},
    {sipName_maxThreadCount, meth_QThreadPool_maxThreadCount, METH_VARARGS, doc_QThreadPool_maxThreadCount},
    {sipName_releaseThread, meth_QThreadPool_releaseThread, METH_VARARGS, doc_QThreadPool_releaseThread},
    {sipName_reserveThread, meth_QThreadPool_reserveThread, METH_VARARGS, doc_QThreadPool_reserveThread},
    {sipName_setExpiryTimeout, meth_QThreadPool_setExpiryTimeout, METH_VARARGS, doc_QThreadPool_setExpiryTimeout},
    {sipName_setMaxThreadCount, meth_QThreadPool_setMaxThreadCount, METH_VARARGS, doc_QThreadPool_setMaxThreadCount},
    {sipName_setStackSize, meth_QThreadPool_setStackSize, METH_VARARGS, doc_QThreadPool_setStackSize},
    {sipName_stackSize, meth_QThreadPool_stackSize, METH_VARARGS, doc_QThreadPool_stackSize},
    {sipName_start, SIP_MLMETH_CAST(meth_QThreadPool_start), METH_VARARGS|METH_KEYWORDS, doc_QThreadPool_start},
    {sipName_tryStart, meth_QThreadPool_tryStart, METH_VARARGS, doc_QThreadPool_tryStart},
    {sipName_tryTake, meth_QThreadPool_tryTake, METH_VARARGS, doc_QThreadPool_tryTake},
    {sipName_waitForDone, SIP_MLMETH_CAST(meth_QThreadPool_waitForDone), METH_VARARGS|METH_KEYWORDS, doc_QThreadPool_waitForDone}
};

PyDoc_STRVAR(doc_QThreadPool, "\1QThreadPool(parent: QObject = None)");


static pyqt5ClassPluginDef plugin_QThreadPool = {
    & ::QThreadPool::staticMetaObject,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QThreadPool = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QThreadPool,
        SIP_NULLPTR,
        &plugin_QThreadPool
    },
    {
        sipNameNr_QThreadPool,
        {0, 0, 1},
        16, methods_QThreadPool,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QThreadPool,
    -1,
    -1,
    supers_QThreadPool,
    SIP_NULLPTR,
    init_type_QThreadPool,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QThreadPool,
    SIP_NULLPTR,
    array_QThreadPool,
    SIP_NULLPTR,
    release_QThreadPool,
    cast_QThreadPool,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QThreadPool,
    sizeof ( ::QThreadPool),
};
