refactoring to h and cpp
This commit is contained in:
@@ -25,25 +25,9 @@ class EventHandler;
|
||||
class EventHandler : public IEventHandler
|
||||
{
|
||||
public:
|
||||
EventHandler(std::shared_ptr<IInputDriver> input_driver) :
|
||||
input_driver(input_driver)
|
||||
{
|
||||
this->input_driver->register_event_handler(this);
|
||||
|
||||
CLOG(INFO, INPUT_LOGGER) << "Created EventHandler";
|
||||
}
|
||||
|
||||
virtual ~EventHandler()
|
||||
{
|
||||
this->input_driver->unregister_event_handler(this);
|
||||
this->input_driver = NULL;
|
||||
}
|
||||
|
||||
// This function is intended to be non pure, if it is called when the derived class doesn't exist anymore
|
||||
virtual void handle(Event& event)
|
||||
{
|
||||
CLOG(WARNING, INPUT_LOGGER) << "Called EventHandler parent class";
|
||||
}
|
||||
EventHandler(std::shared_ptr<IInputDriver> input_driver);
|
||||
virtual ~EventHandler();
|
||||
virtual void handle(Event& event);
|
||||
|
||||
private:
|
||||
std::shared_ptr<IInputDriver> input_driver;
|
||||
|
||||
Reference in New Issue
Block a user