seperated public include headers

This commit is contained in:
Jonas Zeunert
2018-08-07 19:46:24 +02:00
parent a5dfe37514
commit 31d9a2b444
21 changed files with 374 additions and 6 deletions

View File

@@ -58,6 +58,7 @@ else()
endif(Boost_FOUND)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)
# Set libraries include path
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR})

View File

@@ -9,7 +9,7 @@
#define SRC_INPUT_IINPUTDRIVER_H_
#include "utilities/IEventHandler.h"
#include "IEventNotifier.h"
#include "input/IEventNotifier.h"
namespace Input {

View File

@@ -0,0 +1,31 @@
/*
* CabinetItem.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_
#include <string>
namespace output {
class CabinetItem {
public:
CabinetItem();
virtual ~CabinetItem();
virtual bool isActivated();
virtual bool activate();
virtual bool deactivate();
protected:
int address;
std::string name;
bool activated;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_ */

View File

@@ -0,0 +1,21 @@
/*
* Display.cpp
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#include "Display.h"
namespace output {
Display::Display() {
// TODO Auto-generated constructor stub
}
Display::~Display() {
// TODO Auto-generated destructor stub
}
} /* namespace output */

View File

@@ -0,0 +1,33 @@
/*
* Display.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_
#include "IDisplay.h"
namespace output {
class Display: public IDisplay {
public:
Display();
virtual ~Display();
virtual int getID();
virtual void write();
public:
int score;
private:
int address;
int id;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_ */

View File

@@ -0,0 +1,25 @@
/*
* IDisplay.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_
namespace output {
class IDisplay {
public:
IDisplay();
virtual ~IDisplay();
virtual int getID();
virtual void write() = 0;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_ */

View File

@@ -0,0 +1,27 @@
/*
* IDisplayController.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_
#include "config.h"
#include "IDisplay.h"
#include <array>
namespace output {
class IDisplayController {
public:
IDisplayController();
virtual ~IDisplayController();
private:
std::array<IDisplay, NUMBER_OF_DISPLAYS> displays;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_ */

View File

@@ -0,0 +1,21 @@
/*
* IOutputDriver.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_
namespace output {
class IOutputDriver {
public:
IOutputDriver();
virtual ~IOutputDriver();
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_ */

View File

@@ -0,0 +1,23 @@
/*
* ISound.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_
namespace output {
class ISound {
public:
ISound();
virtual ~ISound();
virtual void play() = 0;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_ */

View File

@@ -0,0 +1,21 @@
/*
* Lamp.cpp
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#include "Lamp.h"
namespace output {
Lamp::Lamp() {
// TODO Auto-generated constructor stub
}
Lamp::~Lamp() {
// TODO Auto-generated destructor stub
}
} /* namespace output */

View File

@@ -0,0 +1,23 @@
/*
* Lamp.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_
#include "CabinetItem.h"
namespace output {
class Lamp: public CabinetItem {
public:
Lamp();
virtual ~Lamp();
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_ */

View File

@@ -0,0 +1,21 @@
/*
* OutputDriver.cpp
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#include "OutputDriver.h"
namespace output {
OutputDriver::OutputDriver() {
// TODO Auto-generated constructor stub
}
OutputDriver::~OutputDriver() {
// TODO Auto-generated destructor stub
}
} /* namespace output */

View File

@@ -0,0 +1,23 @@
/*
* OutputDriver.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_
#include "IOutputDriver.h"
namespace output {
class OutputDriver: public IOutputDriver {
public:
OutputDriver();
virtual ~OutputDriver();
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_ */

View File

@@ -0,0 +1,21 @@
/*
* Solenoid.cpp
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#include "Solenoid.h"
namespace output {
Solenoid::Solenoid() {
// TODO Auto-generated constructor stub
}
Solenoid::~Solenoid() {
// TODO Auto-generated destructor stub
}
} /* namespace output */

View File

@@ -0,0 +1,23 @@
/*
* Solenoid.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_
#include "CabinetItem.h"
namespace output {
class Solenoid: public CabinetItem {
public:
Solenoid();
virtual ~Solenoid();
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_ */

View File

@@ -0,0 +1,21 @@
/*
* Sound.cpp
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#include "Sound.h"
namespace output {
Sound::Sound() {
// TODO Auto-generated constructor stub
}
Sound::~Sound() {
// TODO Auto-generated destructor stub
}
} /* namespace output */

View File

@@ -0,0 +1,30 @@
/*
* Sound.h
*
* Created on: Aug 2, 2018
* Author: rhetenor
*/
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_
#define SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_
#include "ISound.h"
#include <string>
namespace output {
class Sound : ISound {
public:
Sound();
virtual ~Sound();
virtual void play();
private:
int address;
std::string name;
};
} /* namespace output */
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_ */

View File

@@ -16,3 +16,5 @@
#define INPUT_MATRIX_SIZE 8
#define INPUT_SLEEP_DURATION_NANO 800
#define NUMBER_OF_DISPLAYS 5

View File

@@ -12,6 +12,7 @@ add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/tests)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include)
#find_library(flippr-driver NAMES lib${CMAKE_PROJECT_NAME}.a HINTS ${CMAKE_SOURCE_DIR}/bin)
#if(NOT flippr-driver)

View File

@@ -5,12 +5,12 @@
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
*/
#include "../catch.hpp"
#include "../fakeit.hpp"
#include "catch.hpp"
#include "fakeit.hpp"
#include "../../src/utilities/LoggerFactory.hpp"
#include "../../src/input/EventHandler.h"
#include "../../src/input/IInputDriver.h"
#include "utilities/LoggerFactory.hpp"
#include "input/EventHandler.h"
#include "IInputDriver.h"
// testing purposes