refactored namespaaaces suckz
This commit is contained in:
@@ -25,3 +25,4 @@
|
||||
},
|
||||
"data" : 13
|
||||
}
|
||||
}
|
||||
@@ -189,3 +189,4 @@
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,32 +12,29 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
namespace FlippR_Driver {
|
||||
namespace Input {
|
||||
|
||||
class Event
|
||||
{
|
||||
public:
|
||||
Event(char address, int priority, std::string name);
|
||||
class Event {
|
||||
public:
|
||||
Event(char address, int priority, std::string name);
|
||||
|
||||
friend bool operator==(const Event &left, const Event &right);
|
||||
|
||||
friend bool operator<(const Event &left, const Event &right) {
|
||||
return left.priority < right.priority;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
std::string name;
|
||||
char address;
|
||||
int priority;
|
||||
};
|
||||
|
||||
bool operator==(const Event &left, const Event &right);
|
||||
|
||||
friend bool operator==(const Event& left, const Event& right);
|
||||
friend bool operator<(const Event& left, const Event& right)
|
||||
{
|
||||
return left.priority < right.priority;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
std::string name;
|
||||
char address;
|
||||
int priority;
|
||||
};
|
||||
|
||||
bool operator==(const Event& left, const Event& right);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif /* INPUTEVENT_H_ */
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
#include "IEventHandler.h"
|
||||
#include <memory>
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input {
|
||||
namespace FlippR_Driver {
|
||||
namespace Input {
|
||||
|
||||
class IInputDriver
|
||||
{
|
||||
public:
|
||||
virtual ~IInputDriver(){};
|
||||
virtual void register_event_handler(IEventHandler* handler) = 0;
|
||||
virtual void unregister_event_handler(IEventHandler* handler) = 0;
|
||||
class IInputDriver {
|
||||
public:
|
||||
virtual ~IInputDriver() {};
|
||||
|
||||
virtual std::shared_ptr<Event> get_event(std::string name) = 0;
|
||||
};
|
||||
virtual void register_event_handler(IEventHandler *handler) = 0;
|
||||
|
||||
virtual void unregister_event_handler(IEventHandler *handler) = 0;
|
||||
|
||||
virtual std::shared_ptr<Event> get_event(std::string name) = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SRC_INPUT_IINPUTDRIVER_H_ */
|
||||
|
||||
@@ -291,3 +291,4 @@ int ads1115Setup (const int pinBase, int i2cAddr)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -235,3 +235,4 @@ int bmp180Setup (const int pinBase)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -403,3 +403,4 @@ int drcSetupNet (const int pinBase, const int numPins, const char *ipAddress, co
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -194,3 +194,4 @@ int drcSetupSerial (const int pinBase, const int numPins, const char *device, co
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -144,3 +144,4 @@ int ds18b20Setup (const int pinBase, const char *deviceId)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -148,3 +148,4 @@ int htu21dSetup (const int pinBase)
|
||||
|
||||
return (status == 0x02) ? TRUE : FALSE ;
|
||||
}
|
||||
}
|
||||
@@ -97,3 +97,4 @@ int max31855Setup (const int pinBase, int spiChannel)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -82,3 +82,4 @@ int max5322Setup (const int pinBase, int spiChannel)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -147,3 +147,4 @@ int mcp23008Setup (const int pinBase, const int i2cAddress)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -162,3 +162,4 @@ int mcp23016Setup (const int pinBase, const int i2cAddress)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -193,3 +193,4 @@ int mcp23017Setup (const int pinBase, const int i2cAddress)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -186,3 +186,4 @@ int mcp23s08Setup (const int pinBase, const int spiPort, const int devId)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -233,3 +233,4 @@ int mcp23s17Setup (const int pinBase, const int spiPort, const int devId)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -74,3 +74,4 @@ int mcp3002Setup (const int pinBase, int spiChannel)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -74,3 +74,4 @@ int mcp3004Setup (const int pinBase, int spiChannel)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -123,3 +123,4 @@ int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -74,3 +74,4 @@ int mcp4802Setup (const int pinBase, int spiChannel)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -124,3 +124,4 @@ int pcf8574Setup (const int pinBase, const int i2cAddress)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -88,3 +88,4 @@ int pcf8591Setup (const int pinBase, const int i2cAddress)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -49,3 +49,4 @@ int piHiPri (const int pri)
|
||||
|
||||
return sched_setscheduler (0, SCHED_RR, &sched) ;
|
||||
}
|
||||
}
|
||||
@@ -93,3 +93,4 @@ int pseudoPinsSetup (const int pinBase)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -250,3 +250,4 @@ int rht03Setup (const int pinBase, const int piPin)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -73,3 +73,4 @@ int sn3218Setup (const int pinBase)
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -181,3 +181,4 @@ void softPwmStop (int pin)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,3 +209,4 @@ int softServoSetup (int p0, int p1, int p2, int p3, int p4, int p5, int p6, int
|
||||
|
||||
return piThreadCreate (softServoThread) ;
|
||||
}
|
||||
}
|
||||
@@ -148,3 +148,4 @@ void softToneStop (int pin)
|
||||
digitalWrite (pin, LOW) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,3 +107,4 @@ int sr595Setup (const int pinBase, const int numPins,
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
}
|
||||
@@ -2371,3 +2371,4 @@ int wiringPiSetupSys (void)
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
}
|
||||
@@ -231,3 +231,4 @@ int wiringPiI2CSetup (const int devId)
|
||||
|
||||
return wiringPiI2CSetupInterface (device, devId) ;
|
||||
}
|
||||
}
|
||||
@@ -135,3 +135,4 @@ int wiringPiSPISetup (int channel, int speed)
|
||||
{
|
||||
return wiringPiSPISetupMode (channel, speed, 0) ;
|
||||
}
|
||||
}
|
||||
@@ -223,3 +223,4 @@ int serialGetchar (const int fd)
|
||||
|
||||
return ((int)x) & 0xFF ;
|
||||
}
|
||||
}
|
||||
@@ -81,3 +81,4 @@ void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val)
|
||||
digitalWrite (cPin, LOW) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -926,3 +926,4 @@ int loadWPiExtension (char *progName, char *extensionData, int printErrors)
|
||||
fprintf (stderr, "%s: extension %s not found", progName, extension) ;
|
||||
return FALSE ;
|
||||
}
|
||||
}
|
||||
@@ -67,3 +67,4 @@ bool Detector::check_inputs(char& address)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,5 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* DETECTOR_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -10,18 +10,15 @@
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
namespace FlippR_Driver {
|
||||
namespace Input {
|
||||
|
||||
class ErrorEvent : public Event
|
||||
{
|
||||
public:
|
||||
ErrorEvent() :
|
||||
Event(0, 0, "ERROR")
|
||||
{}
|
||||
};
|
||||
class ErrorEvent : public Event {
|
||||
public:
|
||||
ErrorEvent() :
|
||||
Event(0, 0, "ERROR") {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SRC_INPUT_ERROREVENT_HPP_ */
|
||||
#endif
|
||||
@@ -25,3 +25,4 @@ bool operator==(const Event& left, const Event& right)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -33,3 +33,4 @@ namespace Input
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,5 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif /* INPUTEVENTHANDLER_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -82,3 +82,4 @@ void EventNotifier::notify()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,5 @@ private:
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_INPUT_EVENTNOTIFIER_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -23,4 +23,5 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif /* SRC_INPUT_IDETECTOR_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -29,4 +29,5 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif /* SRC_INPUT_IEVENTNOTIFIER_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -10,42 +10,36 @@
|
||||
|
||||
#include <input/ErrorEvent.hpp>
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
namespace FlippR_Driver {
|
||||
namespace Input {
|
||||
|
||||
InputDriver::InputDriver(std::shared_ptr<IEventNotifier> event_notifier, std::unique_ptr<IDetector> detector, std::map<std::string, std::shared_ptr<Event>> events) :
|
||||
event_notifier(event_notifier),
|
||||
detector(std::move(detector)),
|
||||
events(events)
|
||||
{
|
||||
CLOG(INFO, INPUT_LOGGER) << "Created InputDriver";
|
||||
}
|
||||
InputDriver::InputDriver(std::shared_ptr<IEventNotifier> event_notifier, std::unique_ptr<IDetector> detector,
|
||||
std::map<std::string, std::shared_ptr<Event>> events) :
|
||||
event_notifier(event_notifier),
|
||||
detector(std::move(detector)),
|
||||
events(events) {
|
||||
CLOG(INFO, INPUT_LOGGER) << "Created InputDriver";
|
||||
}
|
||||
|
||||
void InputDriver::register_event_handler(IEventHandler* handler)
|
||||
{
|
||||
this->event_notifier->register_event_handler(handler);
|
||||
}
|
||||
void InputDriver::register_event_handler(IEventHandler *handler) {
|
||||
this->event_notifier->register_event_handler(handler);
|
||||
}
|
||||
|
||||
void InputDriver::unregister_event_handler(IEventHandler* handler)
|
||||
{
|
||||
this->event_notifier->unregister_event_handler(handler);
|
||||
}
|
||||
void InputDriver::unregister_event_handler(IEventHandler *handler) {
|
||||
this->event_notifier->unregister_event_handler(handler);
|
||||
}
|
||||
|
||||
std::shared_ptr<Event> InputDriver::get_event(std::string name)
|
||||
{
|
||||
std::shared_ptr<Event> event(new ErrorEvent());
|
||||
try
|
||||
{
|
||||
event = this->events.at(name);
|
||||
std::shared_ptr<Event> InputDriver::get_event(std::string name) {
|
||||
std::shared_ptr<Event> event(new ErrorEvent());
|
||||
try {
|
||||
event = this->events.at(name);
|
||||
}
|
||||
catch (std::out_of_range &e) {
|
||||
CLOG_N_TIMES(1, WARNING, OUTPUT_LOGGER) << "Did not found event " << name << " please check config file!";
|
||||
}
|
||||
|
||||
return event;
|
||||
}
|
||||
}
|
||||
catch(std::out_of_range& e)
|
||||
{
|
||||
CLOG_N_TIMES(1, WARNING, OUTPUT_LOGGER) << "Did not found event " << name << " please check config file!";
|
||||
}
|
||||
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,4 +38,5 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif /* SRC_INPUT_INPUTDRIVER_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -66,3 +66,4 @@ namespace Input {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,4 +32,5 @@ private:
|
||||
static void create_input_events(nlohmann::json matrix_config, std::map<char, std::shared_ptr<Event>> address_event_map, std::map<std::string, std::shared_ptr<Event>> name_event_map);
|
||||
};
|
||||
}
|
||||
#endif /* INPUTFACTORY_H_ */
|
||||
}
|
||||
#endif
|
||||
@@ -30,4 +30,4 @@ protected:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_CABINETITEM_H_ */
|
||||
#endif
|
||||
@@ -30,4 +30,4 @@ private:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_DISPLAY_H_ */
|
||||
#endif
|
||||
@@ -20,3 +20,4 @@ DisplayController::~DisplayController() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,4 +27,4 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
#endif /* _SRC_OUTPUT_DISPLAYCONTROLLER_H_ */
|
||||
#endif
|
||||
@@ -18,4 +18,4 @@ class ICabinetItem
|
||||
};
|
||||
|
||||
|
||||
#endif /* _SRC_OUTPUT_ICABINETITEM_H_ */
|
||||
#endif
|
||||
@@ -22,4 +22,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_IDISPLAY_H_ */
|
||||
#endif
|
||||
@@ -18,4 +18,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_IDISPLAYCONTROLLER_H_ */
|
||||
#endif
|
||||
@@ -14,4 +14,4 @@ class ILamp
|
||||
};
|
||||
|
||||
|
||||
#endif /* _SRC_OUTPUT_ILAMP_H_ */
|
||||
#endif
|
||||
@@ -18,4 +18,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_IOUTPUTDRIVER_H_ */
|
||||
#endif
|
||||
@@ -15,4 +15,4 @@ class ISolenoid
|
||||
|
||||
|
||||
|
||||
#endif /* _SRC_OUTPUT_ISOLENOID_H_ */
|
||||
#endif
|
||||
@@ -20,4 +20,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_ISOUND_H_ */
|
||||
#endif
|
||||
@@ -20,4 +20,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_LAMP_H_ */
|
||||
#endif
|
||||
@@ -20,4 +20,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_OUTPUTDRIVER_H_ */
|
||||
#endif
|
||||
@@ -20,4 +20,4 @@ public:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_SOLENOID_H_ */
|
||||
#endif
|
||||
@@ -27,4 +27,4 @@ private:
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
#endif /* _SRC_OUTPUT_SOUND_H_ */
|
||||
#endif
|
||||
@@ -46,4 +46,4 @@ public:
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_UTILITIES_BLOCKINGQUEUE_HPP_ */
|
||||
#endif
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <mutex>
|
||||
#include <fstream>
|
||||
//#include "config.h"
|
||||
|
||||
class GPIOInterface
|
||||
{
|
||||
@@ -39,4 +38,4 @@ public:
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_UTILITIES_GPIOINTERFACE_H_ */
|
||||
#endif
|
||||
@@ -19,4 +19,4 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#endif /* SRC_UTILITIES_IBLOCKINGQUEUE_H_ */
|
||||
#endif
|
||||
@@ -17,6 +17,4 @@ public:
|
||||
virtual bool read_data(char pin) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_UTILITIES_INPUTGPIOINTERFACE_H_ */
|
||||
#endif
|
||||
@@ -34,4 +34,4 @@ private:
|
||||
char data_address;
|
||||
};
|
||||
|
||||
#endif /* SRC_UTILITIES_INPUTGPIOINTERFACE_H_ */
|
||||
#endif
|
||||
@@ -15,4 +15,4 @@ namespace LoggerFactory
|
||||
void CreateInputLogger();
|
||||
};
|
||||
|
||||
#endif /* SRC_UTILITIES_LOGGERFACTORY_HPP_ */
|
||||
#endif
|
||||
@@ -16,4 +16,4 @@ class OutputGPIOInterface : GPIOInterface
|
||||
};
|
||||
|
||||
|
||||
#endif /* SRC_UTILITIES_OUTPUTGPIOINTERFACE_H_ */
|
||||
#endif
|
||||
@@ -23,9 +23,8 @@
|
||||
|
||||
|
||||
using namespace fakeit;
|
||||
using namespace FlippR_Driver
|
||||
{
|
||||
namespace Input;
|
||||
using namespace FlippR_Driver;
|
||||
using namespace Input;
|
||||
|
||||
|
||||
SCENARIO("Creating a Detector object", "")
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
using namespace FlippR_Driver
|
||||
{
|
||||
namespace Input;
|
||||
using namespace FlippR_Driver;
|
||||
using namespace Input;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("An EventNotifier gets created", "[construction]")
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
|
||||
|
||||
using namespace fakeit;
|
||||
using namespace FlippR_Driver
|
||||
{
|
||||
namespace Input;
|
||||
using namespace FlippR_Driver;
|
||||
using namespace Input;
|
||||
|
||||
SCENARIO("An InputDriver gets created", "[construction}")
|
||||
{
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* TestInputDriverFactory.cpp
|
||||
*
|
||||
* Created on: Jul 11, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Oliver Martin, Dr. Franca Rupprecht
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
#include "fakeit.hpp"
|
||||
|
||||
#include "utilities/LoggerFactory.h"
|
||||
|
||||
|
||||
// testing purposes
|
||||
#define private public
|
||||
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
using namespace FlippR_Driver
|
||||
{
|
||||
namespace Input;
|
||||
using namespace fakeit;
|
||||
|
||||
SCENARIO("The factory creates a InputDriver")
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* EventHandlerMock.hpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
*/
|
||||
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
class EventHandler;
|
||||
class Event;
|
||||
|
||||
class EventHandlerMock : EventHandler
|
||||
{
|
||||
public:
|
||||
void handle(Event& event) override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SRC_TESTS_INPUT_MOCKS_EVENTHANDLERMOCK_HPP_ */
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* EventNotfierMock.hpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
*/
|
||||
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
class EventNotifier;
|
||||
class EventHandler;
|
||||
|
||||
class EventNotifierMock : EventNotifier
|
||||
{
|
||||
public:
|
||||
EventNotifierMock() :
|
||||
registered(false)
|
||||
{}
|
||||
|
||||
void register_event_handler(EventHandler* handler) override
|
||||
{
|
||||
registered = true;
|
||||
}
|
||||
|
||||
void unregister_event_handler(EventHandler* handler) override
|
||||
{
|
||||
registered = false;
|
||||
}
|
||||
|
||||
public:
|
||||
bool registered;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SRC_TESTS_INPUT_MOCKS_EVENTNOTIFIERMOCK_HPP_ */
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* InputDriverMock.hpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
*/
|
||||
|
||||
#ifndef SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_
|
||||
#define SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
class InputDriver;
|
||||
class EventHandler;
|
||||
|
||||
class InputDriverMock : InputDriver
|
||||
{
|
||||
public:
|
||||
InputDriverMock() :
|
||||
registered(false)
|
||||
{}
|
||||
|
||||
void register_event_handler(EventHandler* handler)
|
||||
{
|
||||
registered = true;
|
||||
}
|
||||
|
||||
public:
|
||||
bool registered;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SRC_TESTS_INPUT_MOCKS_INPUTDRIVERMOCK_HPP_ */
|
||||
Reference in New Issue
Block a user