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:
+16
-10
@@ -3,24 +3,24 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "data/access/GraphAccessProxy.h"
|
||||
#include "data/access/LocationAccessProxy.h"
|
||||
#include "data/parser/cxx/CxxParser.h"
|
||||
#include "utility/FileSystem.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
|
||||
std::shared_ptr<Project> Project::create(
|
||||
std::shared_ptr<Storage> storage
|
||||
)
|
||||
std::shared_ptr<Project> Project::create(GraphAccessProxy* graphAccessProxy, LocationAccessProxy* locationAccessProxy)
|
||||
{
|
||||
std::shared_ptr<Project> ptr(new Project());
|
||||
ptr->m_storage = storage;
|
||||
std::shared_ptr<Project> ptr(new Project(graphAccessProxy, locationAccessProxy));
|
||||
ptr->m_storage = std::make_shared<Storage>();
|
||||
|
||||
graphAccessProxy->setSubject(ptr->m_storage.get());
|
||||
locationAccessProxy->setSubject(ptr->m_storage.get());
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
Project::Project()
|
||||
{
|
||||
}
|
||||
|
||||
Project::~Project()
|
||||
{
|
||||
}
|
||||
@@ -60,3 +60,9 @@ void Project::parseCode()
|
||||
message.dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
Project::Project(GraphAccessProxy* graphAccessProxy, LocationAccessProxy* locationAccessProxy)
|
||||
: m_graphAccessProxy(graphAccessProxy)
|
||||
, m_locationAccessProxy(locationAccessProxy)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user