/*
 * 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 "sipAPIQtSensors.h"

#line 48 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtSensors/qpressuresensor.sip"
#include <qpressuresensor.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtSensors/sipQtSensorsQPressureFilter.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtSensors/qpressuresensor.sip"
#include <qpressuresensor.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtSensors/sipQtSensorsQPressureFilter.cpp"


class sipQPressureFilter : public  ::QPressureFilter
{
public:
    sipQPressureFilter();
    sipQPressureFilter(const  ::QPressureFilter&);
    virtual ~sipQPressureFilter();

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipQPressureFilter::sipQPressureFilter():  ::QPressureFilter(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

bool sipQPressureFilter::filter( ::QPressureReading*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    extern bool sipVH_QtSensors_21(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QPressureReading*);

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


PyDoc_STRVAR(doc_QPressureFilter_filter, "filter(self, QPressureReading) -> bool");

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

    {
         ::QPressureReading* a0;
         ::QPressureFilter *sipCpp;

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

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

            sipRes = sipCpp->filter(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QPressureFilter, sipName_filter, doc_QPressureFilter_filter);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QPressureFilter)
        return sipCppV;

    if (targetType == sipType_QSensorFilter)
        return static_cast< ::QSensorFilter *>(sipCpp);

    return SIP_NULLPTR;
}


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QPressureFilter* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_QPressureFilter[] = {
    {sipName_filter, meth_QPressureFilter_filter, METH_VARARGS, doc_QPressureFilter_filter}
};

PyDoc_STRVAR(doc_QPressureFilter, "\1QPressureFilter()\n"
"QPressureFilter(QPressureFilter)");


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


sipClassTypeDef sipTypeDef_QtSensors_QPressureFilter = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QPressureFilter,
        SIP_NULLPTR,
        &plugin_QPressureFilter
    },
    {
        sipNameNr_QPressureFilter,
        {0, 0, 1},
        1, methods_QPressureFilter,
        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_QPressureFilter,
    -1,
    -1,
    supers_QPressureFilter,
    SIP_NULLPTR,
    init_type_QPressureFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QPressureFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QPressureFilter,
    cast_QPressureFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QPressureFilter),
};
