logic: reduce copies of intermediate storage data when creating shared memory representation
This commit is contained in:
@@ -323,22 +323,22 @@ void IntermediateStorage::forEachError(std::function<void(const StorageErrorData
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<StorageNode> IntermediateStorage::getStorageNodes() const
|
||||
const std::vector<StorageNode>& IntermediateStorage::getStorageNodes() const
|
||||
{
|
||||
return m_nodes;
|
||||
}
|
||||
|
||||
std::vector<StorageFile> IntermediateStorage::getStorageFiles() const
|
||||
const std::vector<StorageFile>& IntermediateStorage::getStorageFiles() const
|
||||
{
|
||||
return m_files;
|
||||
}
|
||||
|
||||
std::vector<StorageSymbol> IntermediateStorage::getStorageSymbols() const
|
||||
const std::vector<StorageSymbol>& IntermediateStorage::getStorageSymbols() const
|
||||
{
|
||||
return m_symbols;
|
||||
}
|
||||
|
||||
std::vector<StorageEdge> IntermediateStorage::getStorageEdges() const
|
||||
const std::vector<StorageEdge>& IntermediateStorage::getStorageEdges() const
|
||||
{
|
||||
return m_edges;
|
||||
}
|
||||
@@ -365,22 +365,22 @@ std::vector<StorageSourceLocation> IntermediateStorage::getStorageSourceLocation
|
||||
return sourceLocations;
|
||||
}
|
||||
|
||||
std::vector<StorageOccurrence> IntermediateStorage::getStorageOccurrences() const
|
||||
const std::vector<StorageOccurrence>& IntermediateStorage::getStorageOccurrences() const
|
||||
{
|
||||
return m_occurrences;
|
||||
}
|
||||
|
||||
std::vector<StorageComponentAccess> IntermediateStorage::getComponentAccesses() const
|
||||
const std::vector<StorageComponentAccess>& IntermediateStorage::getComponentAccesses() const
|
||||
{
|
||||
return m_componentAccesses;
|
||||
}
|
||||
|
||||
std::vector<StorageCommentLocationData> IntermediateStorage::getCommentLocations() const
|
||||
const std::vector<StorageCommentLocationData>& IntermediateStorage::getCommentLocations() const
|
||||
{
|
||||
return m_commentLocations;
|
||||
}
|
||||
|
||||
std::vector<StorageErrorData> IntermediateStorage::getErrors() const
|
||||
const std::vector<StorageErrorData>& IntermediateStorage::getErrors() const
|
||||
{
|
||||
return m_errors;
|
||||
}
|
||||
|
||||
@@ -56,16 +56,16 @@ public:
|
||||
|
||||
// for conversion to and from 'SharedIntermediateStorage'
|
||||
|
||||
std::vector<StorageNode> getStorageNodes() const;
|
||||
std::vector<StorageFile> getStorageFiles() const;
|
||||
std::vector<StorageSymbol> getStorageSymbols() const;
|
||||
std::vector<StorageEdge> getStorageEdges() const;
|
||||
const std::vector<StorageNode>& getStorageNodes() const;
|
||||
const std::vector<StorageFile>& getStorageFiles() const;
|
||||
const std::vector<StorageSymbol>& getStorageSymbols() const;
|
||||
const std::vector<StorageEdge>& getStorageEdges() const;
|
||||
std::vector<StorageLocalSymbol> getStorageLocalSymbols() const;
|
||||
std::vector<StorageSourceLocation> getStorageSourceLocations() const;
|
||||
std::vector<StorageOccurrence> getStorageOccurrences() const;
|
||||
std::vector<StorageComponentAccess> getComponentAccesses() const;
|
||||
std::vector<StorageCommentLocationData> getCommentLocations() const;
|
||||
std::vector<StorageErrorData> getErrors() const;
|
||||
const std::vector<StorageOccurrence>& getStorageOccurrences() const;
|
||||
const std::vector<StorageComponentAccess>& getComponentAccesses() const;
|
||||
const std::vector<StorageCommentLocationData>& getCommentLocations() const;
|
||||
const std::vector<StorageErrorData>& getErrors() const;
|
||||
|
||||
void setStorageNodes(const std::vector<StorageNode>& storageNodes);
|
||||
void setStorageFiles(const std::vector<StorageFile>& storageFiles);
|
||||
|
||||
@@ -508,12 +508,14 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// add task for injecting the intermediate storages into the persistent storage
|
||||
taskParallelIndexing->addTask(
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
// block until there are indexers running
|
||||
std::make_shared<TaskDecoratorRepeat>(TaskDecoratorRepeat::CONDITION_WHILE_SUCCESS, Task::STATE_SUCCESS)->addChildTask(
|
||||
std::make_shared<TaskReturnSuccessWhile<int>>("indexer_count", TaskReturnSuccessWhile<int>::CONDITION_EQUALS, 0)
|
||||
),
|
||||
),
|
||||
std::make_shared<TaskDecoratorRepeat>(TaskDecoratorRepeat::CONDITION_WHILE_SUCCESS, Task::STATE_SUCCESS)->addChildTask(
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
// stopping when indexer count is zero, regardless wether there are still storages left to insert.
|
||||
@@ -527,6 +529,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// add task that notifies the user of what's going on
|
||||
taskSequential->addTask( // we don't need to hide this dialog again, because it's overridden by other dialogs later on.
|
||||
std::make_shared<TaskLambda>([dialogView]() {
|
||||
|
||||
Reference in New Issue
Block a user