data: save nodes and edges to Storage in order of parsing
This commit is contained in:
@@ -46,7 +46,7 @@ Id IntermediateStorage::addNode(int type, const NameHierarchy& nameHierarchy, bo
|
||||
// refine stored information
|
||||
if (defined)
|
||||
{
|
||||
std::unordered_map<Id, std::shared_ptr<StorageNode>>::const_iterator it2 = m_nodeIdsToData.find(it->second);
|
||||
std::map<Id, std::shared_ptr<StorageNode>>::const_iterator it2 = m_nodeIdsToData.find(it->second);
|
||||
std::shared_ptr<StorageNode> storageNode = it2->second;
|
||||
if (!storageNode->defined && storageNode->type < type)
|
||||
{
|
||||
@@ -184,7 +184,7 @@ void IntermediateStorage::transferToStorage(SqliteStorage& storage)
|
||||
}
|
||||
}
|
||||
|
||||
for (std::unordered_map<Id, std::shared_ptr<StorageNode>>::const_iterator it = m_nodeIdsToData.begin(); it != m_nodeIdsToData.end(); it++)
|
||||
for (std::map<Id, std::shared_ptr<StorageNode>>::const_iterator it = m_nodeIdsToData.begin(); it != m_nodeIdsToData.end(); it++)
|
||||
{
|
||||
StorageNode clientNode = *(it->second.get());
|
||||
StorageNode storageNode = storage.getNodeBySerializedName(clientNode.serializedName);
|
||||
@@ -207,7 +207,7 @@ void IntermediateStorage::transferToStorage(SqliteStorage& storage)
|
||||
clientIdToStorageId[it->first] = storageNodeId;
|
||||
}
|
||||
|
||||
for (std::unordered_map<Id, std::shared_ptr<StorageEdge>>::const_iterator it = m_edgeIdsToData.begin(); it != m_edgeIdsToData.end(); it++)
|
||||
for (std::map<Id, std::shared_ptr<StorageEdge>>::const_iterator it = m_edgeIdsToData.begin(); it != m_edgeIdsToData.end(); it++)
|
||||
{
|
||||
std::unordered_map<Id, Id>::const_iterator it2;
|
||||
it2 = clientIdToStorageId.find(it->second->sourceNodeId);
|
||||
@@ -324,7 +324,7 @@ void IntermediateStorage::forEachFile(std::function<void(const Id /*id*/, const
|
||||
|
||||
void IntermediateStorage::forEachNode(std::function<void(const Id /*id*/, const StorageNode& /*data*/)> callback) const
|
||||
{
|
||||
for (std::unordered_map<Id, std::shared_ptr<StorageNode>>::const_iterator it = m_nodeIdsToData.begin(); it != m_nodeIdsToData.end(); it++)
|
||||
for (std::map<Id, std::shared_ptr<StorageNode>>::const_iterator it = m_nodeIdsToData.begin(); it != m_nodeIdsToData.end(); it++)
|
||||
{
|
||||
callback(it->first, *(it->second.get()));
|
||||
}
|
||||
@@ -332,7 +332,7 @@ void IntermediateStorage::forEachNode(std::function<void(const Id /*id*/, const
|
||||
|
||||
void IntermediateStorage::forEachEdge(std::function<void(const Id /*id*/, const StorageEdge& /*data*/)> callback) const
|
||||
{
|
||||
for (std::unordered_map<Id, std::shared_ptr<StorageEdge>>::const_iterator it = m_edgeIdsToData.begin(); it != m_edgeIdsToData.end(); it++)
|
||||
for (std::map<Id, std::shared_ptr<StorageEdge>>::const_iterator it = m_edgeIdsToData.begin(); it != m_edgeIdsToData.end(); it++)
|
||||
{
|
||||
callback(it->first, *(it->second.get()));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ private:
|
||||
std::unordered_map<Id, std::shared_ptr<StorageFile>> m_fileIdsToData;
|
||||
|
||||
std::unordered_map<std::string, Id> m_nodeNamesToIds; // this is used to prevent duplicates (unique)
|
||||
std::unordered_map<Id, std::shared_ptr<StorageNode>> m_nodeIdsToData;
|
||||
std::map<Id, std::shared_ptr<StorageNode>> m_nodeIdsToData;
|
||||
|
||||
std::unordered_map<std::string, Id> m_edgeNamesToIds; // this is used to prevent duplicates (unique)
|
||||
std::unordered_map<Id, std::shared_ptr<StorageEdge>> m_edgeIdsToData;
|
||||
std::map<Id, std::shared_ptr<StorageEdge>> m_edgeIdsToData;
|
||||
|
||||
std::vector<StorageSourceLocation> m_sourceLocations;
|
||||
std::vector<StorageComponentAccess> m_componentAccesses;
|
||||
|
||||
Reference in New Issue
Block a user