/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 "sipAPIQtSensors.h"

#line 62 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtSensors/qsensor.sip"
#include <qsensor.h>
#line 29 "/build/pyqt6/src/PyQt6-6.3.1/build/QtSensors/sipQtSensorsQSensorFilter.cpp"

#line 45 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtSensors/qsensor.sip"
#include <qsensor.h>
#line 33 "/build/pyqt6/src/PyQt6-6.3.1/build/QtSensors/sipQtSensorsQSensorFilter.cpp"


class sipQSensorFilter : public  ::QSensorFilter
{
public:
    sipQSensorFilter();
    sipQSensorFilter(const  ::QSensorFilter&);
    virtual ~sipQSensorFilter();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool filter( ::QSensorReading*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipQSensorFilter::sipQSensorFilter():  ::QSensorFilter(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQSensorFilter::sipQSensorFilter(const  ::QSensorFilter& a0):  ::QSensorFilter(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

bool sipQSensorFilter::filter( ::QSensorReading*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, sipName_QSensorFilter, sipName_filter);

    if (!sipMeth)
        return 0;

    extern bool sipVH_QtSensors_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QSensorReading*);

    return sipVH_QtSensors_6(sipGILState, sipImportedVirtErrorHandlers_QtSensors_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}


PyDoc_STRVAR(doc_QSensorFilter_filter, "filter(self, QSensorReading) -> bool");

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

    {
         ::QSensorReading* a0;
         ::QSensorFilter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QSensorFilter, &sipCpp, sipType_QSensorReading, &a0))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSensorFilter, sipName_filter);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->filter(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSensorFilter, sipName_filter, doc_QSensorFilter_filter);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QSensorFilter(void *, int);}
static void release_QSensorFilter(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQSensorFilter *>(sipCppV);
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QSensorFilter* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QSensorFilter, &a0))
        {
            sipCpp = new sipQSensorFilter(*a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QSensorFilter[] = {
    {sipName_filter, meth_QSensorFilter_filter, METH_VARARGS, doc_QSensorFilter_filter}
};

PyDoc_STRVAR(doc_QSensorFilter, "\1QSensorFilter()\n"
"QSensorFilter(QSensorFilter)");


sipClassTypeDef sipTypeDef_QtSensors_QSensorFilter = {
    {
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSensorFilter,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QSensorFilter,
        {0, 0, 1},
        1, methods_QSensorFilter,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QSensorFilter,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QSensorFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSensorFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QSensorFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QSensorFilter),
};
