/*
 * Module code.
 *
 * Generated by SIP 4.19.25
 */
#line 134 "/build/arcus/src/libArcus-4.13.1/python/Types.sip"
#include "Types.h"
#line 9 "/build/arcus/src/libArcus-4.13.1/build/python/sipArcuspart1.cpp"

#include "sipAPIArcus.h"

#line 43 "/build/arcus/src/libArcus-4.13.1/python/Error.sip"
    #include "Error.h"
#line 15 "/build/arcus/src/libArcus-4.13.1/build/python/sipArcuspart1.cpp"

#line 23 "/build/arcus/src/libArcus-4.13.1/python/Types.sip"
#include <string>
#line 19 "/build/arcus/src/libArcus-4.13.1/build/python/sipArcuspart1.cpp"


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

    {
        const  ::Error *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_Error, &sipCpp))
        {
             ::ErrorCode::ErrorCode sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->getErrorCode();
            Py_END_ALLOW_THREADS

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_ErrorCode_ErrorCode);
        }
    }

    sipNoMethod(sipParseErr, sipName_Error, sipName_getErrorCode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    {
        const  ::Error *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_Error, &sipCpp))
        {
             ::std::string*sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::std::string(sipCpp->getErrorMessage());
            Py_END_ALLOW_THREADS

            return sipConvertFromNewType(sipRes,sipType_std_string,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_Error, sipName_getErrorMessage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    {
        const  ::Error *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_Error, &sipCpp))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->isFatalError();
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Error, sipName_isFatalError, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    {
        const  ::Error *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_Error, &sipCpp))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->isValid();
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Error, sipName_isValid, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    {
        bool a0;
         ::Error *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bb", &sipSelf, sipType_Error, &sipCpp, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->setFatalError(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Error, sipName_setFatalError, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_Error___repr__(PyObject *);}
static PyObject *slot_Error___repr__(PyObject *sipSelf)
{
     ::Error *sipCpp = reinterpret_cast< ::Error *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_Error));

    if (!sipCpp)
        return SIP_NULLPTR;


    {
        {
            PyObject * sipRes = SIP_NULLPTR;

#line 59 "/build/arcus/src/libArcus-4.13.1/python/Error.sip"
    return PyUnicode_FromString(sipCpp->toString().c_str());
#line 167 "/build/arcus/src/libArcus-4.13.1/build/python/sipArcuspart1.cpp"

            return sipRes;
        }
    }

    return 0;
}


/* Call the instance's destructor. */
extern "C" {static void release_Error(void *, int);}
static void release_Error(void *sipCppV, int)
{
    Py_BEGIN_ALLOW_THREADS

    delete reinterpret_cast< ::Error *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_Error(Py_ssize_t);}
static void *array_Error(Py_ssize_t sipNrElem)
{
    return new  ::Error[sipNrElem];
}


extern "C" {static void assign_Error(void *, SIP_SSIZE_T, void *);}
static void assign_Error(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::Error *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::Error *>(sipSrc);
}


extern "C" {static void *copy_Error(const void *, SIP_SSIZE_T);}
static void *copy_Error(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::Error(reinterpret_cast<const  ::Error *>(sipSrc)[sipSrcIdx]);
}


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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::Error();
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    {
         ::ErrorCode::ErrorCode a0;
        const  ::std::string* a1;
        int a1State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "EJ1", sipType_ErrorCode_ErrorCode, &a0, sipType_std_string,&a1, &a1State))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::Error(a0,*a1);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::std::string *>(a1),sipType_std_string,a1State);

            return sipCpp;
        }
    }

    {
        const  ::Error* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_Error, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::Error(*a0);
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_Error[] = {
    {(void *)slot_Error___repr__, repr_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_Error[] = {
    {SIP_MLNAME_CAST(sipName_getErrorCode), meth_Error_getErrorCode, METH_VARARGS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_getErrorMessage), meth_Error_getErrorMessage, METH_VARARGS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_isFatalError), meth_Error_isFatalError, METH_VARARGS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_isValid), meth_Error_isValid, METH_VARARGS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_setFatalError), meth_Error_setFatalError, METH_VARARGS, SIP_NULLPTR}
};


sipClassTypeDef sipTypeDef_Arcus_Error = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_Error,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_Error,
        {0, 0, 1},
        5, methods_Error,
        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},
    },
    SIP_NULLPTR,
    -1,
    -1,
    SIP_NULLPTR,
    slots_Error,
    init_type_Error,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_Error,
    assign_Error,
    array_Error,
    copy_Error,
    release_Error,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};



static sipEnumMemberDef enummembers_ErrorCode[] = {
    {sipName_AcceptFailedError, static_cast<int>( ::ErrorCode::AcceptFailedError), 2},
    {sipName_BindFailedError, static_cast<int>( ::ErrorCode::BindFailedError), 2},
    {sipName_ConnectFailedError, static_cast<int>( ::ErrorCode::ConnectFailedError), 2},
    {sipName_ConnectionResetError, static_cast<int>( ::ErrorCode::ConnectionResetError), 2},
    {sipName_CreationError, static_cast<int>( ::ErrorCode::CreationError), 2},
    {sipName_Debug, static_cast<int>( ::ErrorCode::Debug), 2},
    {sipName_InvalidMessageError, static_cast<int>( ::ErrorCode::InvalidMessageError), 2},
    {sipName_InvalidStateError, static_cast<int>( ::ErrorCode::InvalidStateError), 2},
    {sipName_MessageRegistrationFailedError, static_cast<int>( ::ErrorCode::MessageRegistrationFailedError), 2},
    {sipName_ParseFailedError, static_cast<int>( ::ErrorCode::ParseFailedError), 2},
    {sipName_ReceiveFailedError, static_cast<int>( ::ErrorCode::ReceiveFailedError), 2},
    {sipName_SendFailedError, static_cast<int>( ::ErrorCode::SendFailedError), 2},
    {sipName_UnknownError, static_cast<int>( ::ErrorCode::UnknownError), 2},
    {sipName_UnknownMessageTypeError, static_cast<int>( ::ErrorCode::UnknownMessageTypeError), 2},
};


sipClassTypeDef sipTypeDef_Arcus_ErrorCode = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_NAMESPACE,
        sipNameNr_ErrorCode,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_ErrorCode,
        {0, 0, 1},
        0, SIP_NULLPTR,
        14, enummembers_ErrorCode,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    SIP_NULLPTR,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
