1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // Created by robin on 10/1/17.
- //
-
- #ifndef MIFARE_TOOLS_LIBNFCOPERATION_H
- #define MIFARE_TOOLS_LIBNFCOPERATION_H
-
-
- #include <QtCore/QThread>
- #include <QtCore/QSharedPointer>
-
- #include <libnfc_cpptools/LibNfcContext.h>
-
- class LibNfcOperation : public QThread
- {
- Q_OBJECT
- public:
- template<typename T>
- static void runOperation(QSharedPointer<LibNfc::Core::LibNfcContext> libNfc,
- std::function<LibNfc::Utils::Result<T>(QSharedPointer<LibNfc::Core::LibNfcContext>)> operation,
- std::function<void(LibNfc::Utils::Result<T>)> callback);
-
- protected:
- void run() override;
-
- //signals:
- // void operationFinished(Result<T> result);
-
- private:
- explicit LibNfcOperation(QSharedPointer<LibNfc::Core::LibNfcContext>& libNfc,
- std::function<void(QSharedPointer<LibNfc::Core::LibNfcContext>)> operation);
-
- QSharedPointer<LibNfc::Core::LibNfcContext> m_pLibNfc;
-
- std::function<void(QSharedPointer<LibNfc::Core::LibNfcContext>)> m_operation;
- };
-
- #endif //MIFARE_TOOLS_LIBNFCOPERATION_H
|