logic: code controller communication

- Replaced CodeAccess with LocationAccess.
- Implemented basic functionality for CodeController.
- Added messaging to the project.
- Added QtThreadedFunctor to enable our Messaging thread to invoke calls on the QtThread.
- Added GraphController.

fortune cookie message = Good news from someone dear is coming soon.
This commit is contained in:
malte_langkabel
2014-07-02 16:42:33 +02:00
parent a8e32af5dd
commit 400e2629d2
37 changed files with 441 additions and 78 deletions
+7 -5
View File
@@ -1,6 +1,8 @@
#include "component/ComponentFactory.h"
#include "component/Component.h"
#include "component/controller/CodeController.h"
#include "component/controller/GraphController.h"
#include "component/view/CodeView.h"
#include "component/view/GraphView.h"
#include "component/view/ViewLayout.h"
@@ -9,13 +11,13 @@
std::shared_ptr<ComponentFactory> ComponentFactory::create(
GuiFactory* guiFactory,
ViewLayout* viewLayout,
std::shared_ptr<CodeAccess> codeAccess,
std::shared_ptr<LocationAccess> locationAccess,
std::shared_ptr<GraphAccess> graphAccess)
{
std::shared_ptr<ComponentFactory> ptr(new ComponentFactory());
ptr->m_guiFactory = guiFactory;
ptr->m_viewLayout = viewLayout;
ptr->m_codeAccess = codeAccess;
ptr->m_locationAccess = locationAccess;
ptr->m_graphAccess = graphAccess;
return ptr;
}
@@ -26,8 +28,8 @@ ComponentFactory::~ComponentFactory()
std::shared_ptr<Component> ComponentFactory::createCodeComponent()
{
std::shared_ptr<View> view = m_guiFactory->createCodeView(m_viewLayout);
std::shared_ptr<Controller> controller = std::make_shared<CodeController>();
std::shared_ptr<CodeView> view = m_guiFactory->createCodeView(m_viewLayout);
std::shared_ptr<CodeController> controller = std::make_shared<CodeController>(m_locationAccess);
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
return component;
@@ -36,7 +38,7 @@ std::shared_ptr<Component> ComponentFactory::createCodeComponent()
std::shared_ptr<Component> ComponentFactory::createGraphComponent()
{
std::shared_ptr<View> view = m_guiFactory->createGraphView(m_viewLayout);
std::shared_ptr<Controller> controller = std::make_shared<CodeController>();
std::shared_ptr<GraphController> controller = std::make_shared<GraphController>(m_graphAccess);
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
return component;