todo make tests working
This commit is contained in:
@@ -15,7 +15,7 @@ void FlippR_Driver::Input::DistributingEvent::distribute()
|
||||
std::chrono::milliseconds elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_activation);
|
||||
if(elapsed_time > deactivation_time)
|
||||
{
|
||||
event_notifier->distribute_event(std::shared_ptr<Event>(this)); // todo why new shared ptr?
|
||||
event_notifier->distribute_event(*this); // todo why new shared ptr?
|
||||
this->last_activation = now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ void EventNotifier::unregister_event_handler(IEventHandler* handler)
|
||||
this->event_handlers.erase(handler);
|
||||
}
|
||||
|
||||
void EventNotifier::distribute_event(std::shared_ptr<Event> event)
|
||||
void EventNotifier::distribute_event(Event &event)
|
||||
{
|
||||
this->event_queue->push(*event);
|
||||
this->event_queue->push(event);
|
||||
}
|
||||
|
||||
void EventNotifier::notify()
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
void register_event_handler(IEventHandler* handler);
|
||||
void unregister_event_handler(IEventHandler* handler);
|
||||
|
||||
void distribute_event(std::shared_ptr<Event> event);
|
||||
void distribute_event(Event &event);
|
||||
|
||||
private:
|
||||
void notify();
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
virtual void register_event_handler(IEventHandler* handler) = 0;
|
||||
virtual void unregister_event_handler(IEventHandler* handler) = 0;
|
||||
|
||||
virtual void distribute_event(std::shared_ptr<Event> event) = 0;
|
||||
virtual void distribute_event(Event &event) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user