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

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qreadwritelock.sip"
#include <qreadwritelock.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQReadLocker.cpp"


PyDoc_STRVAR(doc_QReadLocker_unlock, "unlock(self)");

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

    {
         ::QReadLocker *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QReadLocker, sipName_unlock, doc_QReadLocker_unlock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QReadLocker_relock, "relock(self)");

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

    {
         ::QReadLocker *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QReadLocker, sipName_relock, doc_QReadLocker_relock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QReadLocker_readWriteLock, "readWriteLock(self) -> QReadWriteLock");

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

    {
        const  ::QReadLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QReadLocker, &sipCpp))
        {
             ::QReadWriteLock*sipRes;

            sipRes = sipCpp->readWriteLock();

            return sipConvertFromType(sipRes,sipType_QReadWriteLock,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QReadLocker, sipName_readWriteLock, doc_QReadLocker_readWriteLock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QReadLocker___enter__, "__enter__(self) -> object");

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

    {
         ::QReadLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QReadLocker, &sipCpp))
        {
            PyObject * sipRes = SIP_NULLPTR;

#line 64 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qreadwritelock.sip"
        // Just return a reference to self.
        sipRes = sipSelf;
        Py_INCREF(sipRes);
#line 136 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQReadLocker.cpp"

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_QReadLocker, sipName___enter__, doc_QReadLocker___enter__);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QReadLocker___exit__, "__exit__(self, object, object, object)");

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

    {
        PyObject * a0;
        PyObject * a1;
        PyObject * a2;
         ::QReadLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BP0P0P0", &sipSelf, sipType_QReadLocker, &sipCpp, &a0, &a1, &a2))
        {
#line 71 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qreadwritelock.sip"
        sipCpp->unlock();
#line 166 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQReadLocker.cpp"

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QReadLocker, sipName___exit__, doc_QReadLocker___exit__);

    return SIP_NULLPTR;
}


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


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


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

    {
         ::QReadWriteLock* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J8", sipType_QReadWriteLock, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::QReadLocker(a0);
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QReadLocker[] = {
    {sipName___enter__, meth_QReadLocker___enter__, METH_VARARGS, doc_QReadLocker___enter__},
    {sipName___exit__, meth_QReadLocker___exit__, METH_VARARGS, doc_QReadLocker___exit__},
    {sipName_readWriteLock, meth_QReadLocker_readWriteLock, METH_VARARGS, doc_QReadLocker_readWriteLock},
    {sipName_relock, meth_QReadLocker_relock, METH_VARARGS, doc_QReadLocker_relock},
    {sipName_unlock, meth_QReadLocker_unlock, METH_VARARGS, doc_QReadLocker_unlock}
};

PyDoc_STRVAR(doc_QReadLocker, "\1QReadLocker(QReadWriteLock)");


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


sipClassTypeDef sipTypeDef_QtCore_QReadLocker = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_NONLAZY|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QReadLocker,
        SIP_NULLPTR,
        &plugin_QReadLocker
    },
    {
        sipNameNr_QReadLocker,
        {0, 0, 1},
        5, methods_QReadLocker,
        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_QReadLocker,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QReadLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QReadLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QReadLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QReadLocker),
};
