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

#line 139 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qpycore_qvector.sip"
#include <qvector.h>
#line 29 "/build/pyqt5-3d/src/PyQt3D-5.15.5/build/Qt3DAnimation/sipQt3DAnimationQVector0101Qt3DAnimationQAbstractChannelMapping.cpp"

#line 28 "/build/pyqt5-3d/src/PyQt3D-5.15.5/sip/Qt3DAnimation/qabstractanimation.sip"
#include <qabstractanimation.h>
#line 28 "/build/pyqt5-3d/src/PyQt3D-5.15.5/sip/Qt3DAnimation/qabstractanimationclip.sip"
#include <qabstractanimationclip.h>
#line 28 "/build/pyqt5-3d/src/PyQt3D-5.15.5/sip/Qt3DAnimation/qabstractchannelmapping.sip"
#include <qabstractchannelmapping.h>
#line 34 "/build/pyqt5-3d/src/PyQt3D-5.15.5/sip/Qt3DAnimation/qabstractchannelmapping.sip"
#include <qabstractchannelmapping.h>
#line 39 "/build/pyqt5-3d/src/PyQt3D-5.15.5/build/Qt3DAnimation/sipQt3DAnimationQVector0101Qt3DAnimationQAbstractChannelMapping.cpp"


extern "C" {static void assign_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *, Py_ssize_t, void *);}
static void assign_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast<QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *>(sipDst)[sipDstIdx] = *reinterpret_cast<QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *>(sipSrc);
}


extern "C" {static void *array_QVector_0101Qt3DAnimation_QAbstractChannelMapping(Py_ssize_t);}
static void *array_QVector_0101Qt3DAnimation_QAbstractChannelMapping(Py_ssize_t sipNrElem)
{
    return new QVector< ::Qt3DAnimation::QAbstractChannelMapping*>[sipNrElem];
}


extern "C" {static void *copy_QVector_0101Qt3DAnimation_QAbstractChannelMapping(const void *, Py_ssize_t);}
static void *copy_QVector_0101Qt3DAnimation_QAbstractChannelMapping(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new QVector< ::Qt3DAnimation::QAbstractChannelMapping*>(reinterpret_cast<const QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *, int);}
static void release_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *sipCppV, int)
{
    QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *sipCpp = reinterpret_cast<QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *>(sipCppV);
    delete sipCpp;
}



extern "C" {static int convertTo_QVector_0101Qt3DAnimation_QAbstractChannelMapping(PyObject *, void **, int *, PyObject *);}
static int convertTo_QVector_0101Qt3DAnimation_QAbstractChannelMapping(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj)
{
    QVector< ::Qt3DAnimation::QAbstractChannelMapping*> **sipCppPtr = reinterpret_cast<QVector< ::Qt3DAnimation::QAbstractChannelMapping*> **>(sipCppPtrV);

#line 174 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qpycore_qvector.sip"
    PyObject *iter = PyObject_GetIter(sipPy);

    if (!sipIsErr)
    {
        PyErr_Clear();
        Py_XDECREF(iter);

        return (iter
#if PY_MAJOR_VERSION < 3
                && !PyString_Check(sipPy)
#endif
                && !PyUnicode_Check(sipPy));
    }

    if (!iter)
    {
        *sipIsErr = 1;

        return 0;
    }

    QVector<Qt3DAnimation::QAbstractChannelMapping *> *qv = new QVector<Qt3DAnimation::QAbstractChannelMapping *>;
 
    for (Py_ssize_t i = 0; ; ++i)
    {
        PyErr_Clear();
        PyObject *itm = PyIter_Next(iter);

        if (!itm)
        {
            if (PyErr_Occurred())
            {
                delete qv;
                Py_DECREF(iter);
                *sipIsErr = 1;

                return 0;
            }

            break;
        }

        Qt3DAnimation::QAbstractChannelMapping *t = reinterpret_cast<Qt3DAnimation::QAbstractChannelMapping *>(
                sipForceConvertToType(itm, sipType_Qt3DAnimation_QAbstractChannelMapping, sipTransferObj, 0,
                        0, sipIsErr));

        if (*sipIsErr)
        {
            PyErr_Format(PyExc_TypeError,
                    "index %zd has type '%s' but 'Qt3DAnimation::QAbstractChannelMapping' is expected", i,
                    sipPyTypeName(Py_TYPE(itm)));

            Py_DECREF(itm);
            delete qv;
            Py_DECREF(iter);

            return 0;
        }

        qv->append(t);

        Py_DECREF(itm);
    }

    Py_DECREF(iter);
 
    *sipCppPtr = qv;
 
    return sipGetState(sipTransferObj);
#line 148 "/build/pyqt5-3d/src/PyQt3D-5.15.5/build/Qt3DAnimation/sipQt3DAnimationQVector0101Qt3DAnimationQAbstractChannelMapping.cpp"
}


extern "C" {static PyObject *convertFrom_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *, PyObject *);}
static PyObject *convertFrom_QVector_0101Qt3DAnimation_QAbstractChannelMapping(void *sipCppV, PyObject *sipTransferObj)
{
   QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *sipCpp = reinterpret_cast<QVector< ::Qt3DAnimation::QAbstractChannelMapping*> *>(sipCppV);

#line 143 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qpycore_qvector.sip"
    int gc_enabled = sipEnableGC(0);
    PyObject *l = PyList_New(sipCpp->size());

    if (l)
    {
        for (int i = 0; i < sipCpp->size(); ++i)
        {
            Qt3DAnimation::QAbstractChannelMapping *t = sipCpp->at(i);

            // The explicit (void *) cast allows Qt3DAnimation::QAbstractChannelMapping to be const.
            PyObject *tobj = sipConvertFromNewType((void *)t, sipType_Qt3DAnimation_QAbstractChannelMapping,
                    sipTransferObj);

            if (!tobj)
            {
                Py_DECREF(l);
                l = 0;

                break;
            }

            PyList_SetItem(l, i, tobj);
        }
    }

    sipEnableGC(gc_enabled);

    return l;
#line 186 "/build/pyqt5-3d/src/PyQt3D-5.15.5/build/Qt3DAnimation/sipQt3DAnimationQVector0101Qt3DAnimationQAbstractChannelMapping.cpp"
}


sipMappedTypeDef sipTypeDef_Qt3DAnimation_QVector_0101Qt3DAnimation_QAbstractChannelMapping = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_MAPPED,
        sipNameNr_63,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QVector_0101Qt3DAnimation_QAbstractChannelMapping,
    array_QVector_0101Qt3DAnimation_QAbstractChannelMapping,
    copy_QVector_0101Qt3DAnimation_QAbstractChannelMapping,
    release_QVector_0101Qt3DAnimation_QAbstractChannelMapping,
    convertTo_QVector_0101Qt3DAnimation_QAbstractChannelMapping,
    convertFrom_QVector_0101Qt3DAnimation_QAbstractChannelMapping
};
