#ifndef TASK_EXECUTE_CUSTOM_COMMANDS_H #define TASK_EXECUTE_CUSTOM_COMMANDS_H #include #include #include "ErrorCountInfo.h" #include "FilePath.h" #include "MessageIndexingInterrupted.h" #include "MessageListener.h" #include "Task.h" #include "TimeStamp.h" class DialogView; class IndexerCommandCustom; class IndexerCommandProvider; class PersistentStorage; class TaskExecuteCustomCommands : public Task , public MessageListener { public: static void runPythonPostProcessing(PersistentStorage& storage); TaskExecuteCustomCommands( std::unique_ptr indexerCommandProvider, std::shared_ptr storage, std::shared_ptr dialogView, size_t indexerThreadCount, const FilePath& projectDirectory); private: void doEnter(std::shared_ptr blackboard) override; TaskState doUpdate(std::shared_ptr blackboard) override; void doExit(std::shared_ptr blackboard) override; void doReset(std::shared_ptr blackboard) override; void handleMessage(MessageIndexingInterrupted* message) override; void executeParallelIndexerCommands(int threadId, std::shared_ptr blackboard); void runIndexerCommand( std::shared_ptr indexerCommand, std::shared_ptr blackboard, std::shared_ptr storage); std::unique_ptr m_indexerCommandProvider; std::shared_ptr m_storage; std::shared_ptr m_dialogView; const size_t m_indexerThreadCount; const FilePath m_projectDirectory; TimeStamp m_start; bool m_interrupted = false; size_t m_indexerCommandCount; std::vector> m_serialCommands; std::vector> m_parallelCommands; std::mutex m_parallelCommandsMutex; ErrorCountInfo m_errorCount; std::mutex m_errorCountMutex; FilePath m_targetDatabaseFilePath; bool m_hasPythonCommands; std::set m_sourceDatabaseFilePaths; std::mutex m_sourceDatabaseFilePathsMutex; }; #endif // TASK_EXECUTE_CUSTOM_COMMANDS_H