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:
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
#include "component/view/View.h"
|
||||
class View;
|
||||
class Controller;
|
||||
|
||||
class Component
|
||||
{
|
||||
@@ -12,8 +12,11 @@ public:
|
||||
Component(std::shared_ptr<View> view, std::shared_ptr<Controller> controller);
|
||||
~Component();
|
||||
|
||||
Controller* getController() const;
|
||||
View* getView() const;
|
||||
template <typename ControllerType>
|
||||
ControllerType* getController() const;
|
||||
|
||||
template <typename ViewType>
|
||||
ViewType* getView() const;
|
||||
|
||||
private:
|
||||
const std::shared_ptr<Controller> m_controller;
|
||||
@@ -21,4 +24,17 @@ private:
|
||||
};
|
||||
|
||||
|
||||
template <typename ControllerType>
|
||||
ControllerType* Component::getController() const
|
||||
{
|
||||
return dynamic_cast<ControllerType*>(m_controller.get());
|
||||
}
|
||||
|
||||
template <typename ViewType>
|
||||
ViewType* Component::getView() const
|
||||
{
|
||||
return dynamic_cast<ViewType*>(m_view.get());
|
||||
}
|
||||
|
||||
|
||||
#endif // COMPONENT_H
|
||||
|
||||
Reference in New Issue
Block a user