changed to smart ptrs and trying to fix event_handler_tests

This commit is contained in:
Jonas Zeunert
2018-07-11 19:00:24 +02:00
parent 26c63d946d
commit 8b9ec68662
12 changed files with 47 additions and 61 deletions

View File

@@ -9,21 +9,12 @@
namespace Input
{
InputDriver::InputDriver(IEventNotifier* event_notifier, IDetector* detector) :
event_notifier(event_notifier), detector(detector)
InputDriver::InputDriver(std::shared_ptr<IEventNotifier> event_notifier, std::unique_ptr<IDetector> detector) :
event_notifier(event_notifier), detector(std::move(detector))
{
CLOG(INFO, INPUT_LOGGER) << "Created InputDriver";
}
InputDriver::~InputDriver()
{
delete event_notifier;
event_notifier = NULL;
delete detector;
detector = NULL;
}
void InputDriver::register_event_handler(IEventHandler* handler)
{
event_notifier->register_event_handler(handler);