#ifndef SBK_DIFFERENCESALGORITHMINTERFACEWRAPPER_H
#define SBK_DIFFERENCESALGORITHMINTERFACEWRAPPER_H

// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

#include <differencesalgorithminterface.h>

#include <sbkpython.h>

#include <array>
namespace Shiboken { struct AutoDecRef; class GilState; }

class DifferencesAlgorithmInterfaceWrapper : public Akonadi::DifferencesAlgorithmInterface
{
public:
    DifferencesAlgorithmInterfaceWrapper();
    DifferencesAlgorithmInterfaceWrapper(const DifferencesAlgorithmInterfaceWrapper &) = delete;
    DifferencesAlgorithmInterfaceWrapper& operator=(const DifferencesAlgorithmInterfaceWrapper &) = delete;
    DifferencesAlgorithmInterfaceWrapper(DifferencesAlgorithmInterfaceWrapper &&) = delete;
    DifferencesAlgorithmInterfaceWrapper& operator=(DifferencesAlgorithmInterfaceWrapper &&) = delete;
    ~DifferencesAlgorithmInterfaceWrapper() override;

    void compare(::Akonadi::AbstractDifferencesReporter * reporter, const ::Akonadi::Item & leftItem, const ::Akonadi::Item & rightItem) override;
    static void sbk_o_compare([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::Akonadi::AbstractDifferencesReporter * reporter, [[maybe_unused]] const ::Akonadi::Item & leftItem, [[maybe_unused]] const ::Akonadi::Item & rightItem);
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

private:
    mutable std::array<PyObject *, 1> m_PyMethodCache = {nullptr};
};

#endif // SBK_DIFFERENCESALGORITHMINTERFACEWRAPPER_H
