/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 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 44 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtSensors/qcompass.sip"
#include <qcompass.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtSensors/sipQtSensorsQCompassFilter.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtSensors/qcompass.sip"
#include <qcompass.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtSensors/sipQtSensorsQCompassFilter.cpp"


class sipQCompassFilter : public ::QCompassFilter
{
public:
    sipQCompassFilter();
    sipQCompassFilter(const ::QCompassFilter&);
    virtual ~sipQCompassFilter();

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipQCompassFilter::sipQCompassFilter(): ::QCompassFilter(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

bool sipQCompassFilter::filter(::QCompassReading*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    extern bool sipVH_QtSensors_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QCompassReading*);

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


PyDoc_STRVAR(doc_QCompassFilter_filter, "filter(self, reading: Optional[QCompassReading]) -> bool");

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

    {
        ::QCompassReading* a0;
        ::QCompassFilter *sipCpp;

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

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

            sipRes = sipCpp->filter(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QCompassFilter, sipName_filter, doc_QCompassFilter_filter);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QCompassFilter)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::QCompassFilter* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_QCompassFilter[] = {
    {sipName_filter, meth_QCompassFilter_filter, METH_VARARGS, doc_QCompassFilter_filter}
};

PyDoc_STRVAR(doc_QCompassFilter, "\1QCompassFilter()\n"
"QCompassFilter(a0: QCompassFilter)");


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


sipClassTypeDef sipTypeDef_QtSensors_QCompassFilter = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QCompassFilter,
        SIP_NULLPTR,
        &plugin_QCompassFilter,
    },
    {
        sipNameNr_QCompassFilter,
        {0, 0, 1},
        1, methods_QCompassFilter,
        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_QCompassFilter,
    -1,
    -1,
    supers_QCompassFilter,
    SIP_NULLPTR,
    init_type_QCompassFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QCompassFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QCompassFilter,
    cast_QCompassFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QCompassFilter),
};
