logic: moved Storage into Project
Moved Storage instantiation into the Project. Storage access is still handled via the GraphAccess and LocationAccess interfaces, but the ComponentFactory now only serves proxy implementations of these access classes. Project is responsible for setting the subject of the proxies to the current Storage instance.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#ifndef GRAPH_ACCESS_PROXY_H
|
||||
#define GRAPH_ACCESS_PROXY_H
|
||||
|
||||
#include "data/access/GraphAccess.h"
|
||||
|
||||
class GraphAccessProxy: public GraphAccess
|
||||
{
|
||||
public:
|
||||
GraphAccessProxy();
|
||||
virtual ~GraphAccessProxy();
|
||||
|
||||
bool hasSubject() const;
|
||||
void setSubject(GraphAccess* subject);
|
||||
|
||||
// GraphAccess implementation
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const;
|
||||
virtual std::string getNameForNodeWithId(Id id) const;
|
||||
virtual std::vector<std::string> getNamesForNodesWithNamePrefix(const std::string& prefix) const;
|
||||
virtual std::vector<Id> getIdsOfNeighbours(const Id id) const;
|
||||
virtual std::vector<std::pair<Id, Id>> getConnectedEdges(const Id id) const;
|
||||
|
||||
private:
|
||||
GraphAccess* m_subject;
|
||||
};
|
||||
|
||||
#endif // GRAPH_ACCESS_PROXY_H
|
||||
Reference in New Issue
Block a user