Files
Sourcetrail/src/lib/data/access/StorageAccessProxy.h
T
Eberhard Graether e3f1f004a0 logic: combined GraphAccess and LocationAccess to StorageAccess
Having only one access point to the Storage will simplify caching and parallelisation in the future. Also the two
accesses were never really independent of each other anyways, because in some cases they had to access both data sets.
2015-03-17 16:38:17 +01:00

42 lines
1.4 KiB
C++

#ifndef STORAGE_ACCESS_PROXY_H
#define STORAGE_ACCESS_PROXY_H
#include "data/access/StorageAccess.h"
class StorageAccessProxy: public StorageAccess
{
public:
StorageAccessProxy();
virtual ~StorageAccessProxy();
bool hasSubject() const;
void setSubject(StorageAccess* subject);
// StorageAccess implementation
virtual Id getIdForNodeWithName(const std::string& name) const;
virtual std::string getNameForNodeWithId(Id id) const;
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const;
virtual std::vector<SearchMatch> getAutocompletionMatches(
const std::string& query, const std::string& word) const;
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;
virtual std::vector<Id> getActiveTokenIdsForId(Id tokenId, Id* declarationId) const;
virtual std::vector<Id> getActiveTokenIdsForLocationId(Id locationId) const;
virtual std::vector<Id> getTokenIdsForQuery(std::string query) const;
virtual TokenLocationCollection getTokenLocationsForTokenIds(const std::vector<Id>& tokenIds) const;
virtual TokenLocationFile getTokenLocationsForFile(const std::string& filePath) const;
virtual TokenLocationFile getTokenLocationsForLinesInFile(
const std::string& filePath, uint firstLineNumber, uint lastLineNumber
) const;
virtual TokenLocationCollection getErrorTokenLocations(std::vector<std::string>* errorMessages) const;
private:
StorageAccess* m_subject;
};
#endif // STORAGE_ACCESS_PROXY_H