refactored public includes
This commit is contained in:
42
FlippR-Driver/include/Event.h
Normal file
42
FlippR-Driver/include/Event.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* InputEvent.h
|
||||||
|
*
|
||||||
|
* Created on: Apr 5, 2018
|
||||||
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INPUTEVENT_H_
|
||||||
|
#define INPUTEVENT_H_
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Input
|
||||||
|
{
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
char address;
|
||||||
|
|
||||||
|
public:
|
||||||
|
int priority;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool operator==(const Event& left, const Event& right);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* INPUTEVENT_H_ */
|
||||||
21
FlippR-Driver/include/IEventHandler.h
Normal file
21
FlippR-Driver/include/IEventHandler.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* IEventHandler.h
|
||||||
|
*
|
||||||
|
* Created on: Jun 13, 2018
|
||||||
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRC_IEVENTHANDLER_H_
|
||||||
|
#define SRC_IEVENTHANDLER_H_
|
||||||
|
|
||||||
|
#include "Event.h"
|
||||||
|
|
||||||
|
class IEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~IEventHandler(){};
|
||||||
|
|
||||||
|
virtual void handle(Input::Event& event) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* SRC_IEVENTHANDLER_H_ */
|
||||||
Reference in New Issue
Block a user