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 <Business/LibNfcBusiness.h>
-
- class LibNfcOperation : public QThread
- {
- Q_OBJECT
- public:
- template<typename T>
- static void runOperation(QSharedPointer<LibNfcBusiness> libNfc,
- std::function<Result<T>(QSharedPointer<LibNfcBusiness>)> operation,
- std::function<void(Result<T>)> callback);
-
- protected:
- void run() override;
-
- //signals:
- // void operationFinished(Result<T> result);
-
- private:
- explicit LibNfcOperation(QSharedPointer<LibNfcBusiness>& libNfc,
- std::function<void(QSharedPointer<LibNfcBusiness>)> operation);
-
- QSharedPointer<LibNfcBusiness> m_pLibNfc;
-
- std::function<void(QSharedPointer<LibNfcBusiness>)> m_operation;
- };
-
- #endif //MIFARE_TOOLS_LIBNFCOPERATION_H
|