| #pragma once |
| |
| #ifndef TFUNCTORINVOKER_H |
| #define TFUNCTORINVOKER_H |
| |
| |
| #include "tcommon.h" |
| |
| |
| #include <QObject> |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZCORE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TFunctorInvoker : public QObject |
| { |
| Q_OBJECT |
| |
| public: |
| |
| |
| |
| |
| |
| class BaseFunctor |
| { |
| public: |
| virtual ~BaseFunctor() {} |
| |
| virtual void operator()() = 0; |
| }; |
| |
| public: |
| static TFunctorInvoker *instance(); |
| |
| void invokeQueued(BaseFunctor *functor); |
| |
| public Q_SLOTS: |
| |
| void invoke(void *vPtr) |
| { |
| BaseFunctor *func = (BaseFunctor *)vPtr; |
| |
| (*func)(); |
| delete func; |
| } |
| |
| private: |
| TFunctorInvoker() {} |
| }; |
| |
| #endif |