- 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.
41 lines
738 B
C++
41 lines
738 B
C++
#ifndef COMPONENT_H
|
|
#define COMPONENT_H
|
|
|
|
#include <memory>
|
|
|
|
class View;
|
|
class Controller;
|
|
|
|
class Component
|
|
{
|
|
public:
|
|
Component(std::shared_ptr<View> view, std::shared_ptr<Controller> controller);
|
|
~Component();
|
|
|
|
template <typename ControllerType>
|
|
ControllerType* getController() const;
|
|
|
|
template <typename ViewType>
|
|
ViewType* getView() const;
|
|
|
|
private:
|
|
const std::shared_ptr<Controller> m_controller;
|
|
const std::shared_ptr<View> m_view;
|
|
};
|
|
|
|
|
|
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
|