/*
 * 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/qwaitcondition.sip"
#include <qwaitcondition.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQWaitCondition.cpp"

#line 57 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qmutex.sip"
#include <qmutex.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQWaitCondition.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qdeadlinetimer.sip"
#include <qdeadlinetimer.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQWaitCondition.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qreadwritelock.sip"
#include <qreadwritelock.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQWaitCondition.cpp"


PyDoc_STRVAR(doc_QWaitCondition_wait, "wait(self, QMutex, msecs: int = ULONG_MAX) -> bool\n"
"wait(self, QMutex, QDeadlineTimer) -> bool\n"
"wait(self, QReadWriteLock, msecs: int = ULONG_MAX) -> bool\n"
"wait(self, QReadWriteLock, QDeadlineTimer) -> bool");

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

    {
         ::QMutex* a0;
        unsigned long a1 = ULONG_MAX;
         ::QWaitCondition *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|m", &sipSelf, sipType_QWaitCondition, &sipCpp, sipType_QMutex, &a0, &a1))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->wait(a0,a1);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    {
         ::QMutex* a0;
         ::QDeadlineTimer* a1;
         ::QWaitCondition *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "BJ8J9", &sipSelf, sipType_QWaitCondition, &sipCpp, sipType_QMutex, &a0, sipType_QDeadlineTimer, &a1))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->wait(a0,*a1);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    {
         ::QReadWriteLock* a0;
        unsigned long a1 = ULONG_MAX;
         ::QWaitCondition *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|m", &sipSelf, sipType_QWaitCondition, &sipCpp, sipType_QReadWriteLock, &a0, &a1))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->wait(a0,a1);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    {
         ::QReadWriteLock* a0;
         ::QDeadlineTimer* a1;
         ::QWaitCondition *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "BJ8J9", &sipSelf, sipType_QWaitCondition, &sipCpp, sipType_QReadWriteLock, &a0, sipType_QDeadlineTimer, &a1))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->wait(a0,*a1);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QWaitCondition, sipName_wait, doc_QWaitCondition_wait);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWaitCondition_wakeOne, "wakeOne(self)");

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

    {
         ::QWaitCondition *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWaitCondition, &sipCpp))
        {
            sipCpp->wakeOne();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWaitCondition, sipName_wakeOne, doc_QWaitCondition_wakeOne);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWaitCondition_wakeAll, "wakeAll(self)");

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

    {
         ::QWaitCondition *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWaitCondition, &sipCpp))
        {
            sipCpp->wakeAll();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWaitCondition, sipName_wakeAll, doc_QWaitCondition_wakeAll);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QWaitCondition(void *, int);}
static void release_QWaitCondition(void *sipCppV, int)
{
    delete reinterpret_cast< ::QWaitCondition *>(sipCppV);
}


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


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


extern "C" {static void dealloc_QWaitCondition(sipSimpleWrapper *);}
static void dealloc_QWaitCondition(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QWaitCondition(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QWaitCondition(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QWaitCondition(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QWaitCondition *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new  ::QWaitCondition();

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QWaitCondition[] = {
    {sipName_wait, SIP_MLMETH_CAST(meth_QWaitCondition_wait), METH_VARARGS|METH_KEYWORDS, doc_QWaitCondition_wait},
    {sipName_wakeAll, meth_QWaitCondition_wakeAll, METH_VARARGS, doc_QWaitCondition_wakeAll},
    {sipName_wakeOne, meth_QWaitCondition_wakeOne, METH_VARARGS, doc_QWaitCondition_wakeOne}
};

PyDoc_STRVAR(doc_QWaitCondition, "\1QWaitCondition()");


static pyqt5ClassPluginDef plugin_QWaitCondition = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QWaitCondition = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QWaitCondition,
        SIP_NULLPTR,
        &plugin_QWaitCondition
    },
    {
        sipNameNr_QWaitCondition,
        {0, 0, 1},
        3, methods_QWaitCondition,
        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_QWaitCondition,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QWaitCondition,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QWaitCondition,
    SIP_NULLPTR,
    array_QWaitCondition,
    SIP_NULLPTR,
    release_QWaitCondition,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QWaitCondition,
    sizeof ( ::QWaitCondition),
};
