ClangRefactoring: Add SymbolIndexerTaskScheduler

The scheduler is managing the asynchronous tasks by using the symbols
collector manager. Every symbols collector can be used by only one thread,
so the we have to pass the symbols collector around by the future interface
to make the available again after a task is finished.

Change-Id: Ic2eeaa986c2d93978d043216c46e8cb38cea769f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-08-22 21:13:05 +02:00
parent 6775347cd2
commit b2c3e683cf
13 changed files with 443 additions and 34 deletions

View File

@@ -34,14 +34,18 @@
namespace ClangBackEnd {
class SymbolsCollectorInterface;
class SymbolStorageInterface;
class SymbolIndexerTask
{
public:
using CallableType = std::function<void()>;
using Callable = std::function<void(SymbolsCollectorInterface &symbolsCollector,
SymbolStorageInterface &symbolStorage)>;
SymbolIndexerTask(FilePathId filePathId,
std::size_t projectPartId,
CallableType &&callable)
Callable &&callable)
: callable(std::move(callable)),
filePathId(filePathId),
projectPartId(projectPartId)
@@ -67,7 +71,7 @@ public:
}
public:
CallableType callable;
Callable callable;
FilePathId filePathId;
std::size_t projectPartId;
};