added some structure

This commit is contained in:
Johannes Wendel
2019-04-25 12:51:15 +02:00
parent 1580d807e0
commit 263991af5a
18 changed files with 285 additions and 129 deletions

View File

@@ -2,4 +2,4 @@
// Created by rhetenor on 3/6/19.
//
#include "InputSocketConnection.h"
#include "SocketConnection.h"

View File

@@ -7,12 +7,23 @@
#include <Poco/Net/TCPServerConnection.h>
class InputSocketConnection : public Poco::Net::TCPServerConnection
namespace flippR_driver
{
namespace utility
{
namespace networking
{
namespace input
{
class SocketConnection : public Poco::Net::TCPServerConnection
{
};
}
}
}
}
#endif //FLIPPR_CODE_INPUTSOCKETCONNECTION_H

View File

@@ -2,7 +2,7 @@
// Created by rhetenor on 27.11.18.
//
#include "InputSocketHandler.h"
#include "SocketHandler.h"
#include <boost/date_time/posix_time/posix_time.hpp>
@@ -12,16 +12,20 @@ namespace flippR_driver
{
namespace utility
{
namespace networking
{
namespace input
{
using namespace nlohmann;
InputSocketHandler::InputSocketHandler()
InputSocketHandler::InputSocketHandler ()
{}
void InputSocketHandler::handle(flippR_driver::input::Event &event)
void InputSocketHandler::handle (flippR_driver::input::Event &event)
{
json event_serialization = serialize_event(event);
json event_serialization = serialize_event (event);
// write_to_socket(event_serialization);
// write_to_socket(event_serialization);
}
//json InputSocketHandler::serialize_event(input::Event &event)
@@ -39,6 +43,7 @@ void InputSocketHandler::handle(flippR_driver::input::Event &event)
// return serialized_event;
//}
}
}
}
}

View File

@@ -15,17 +15,24 @@ namespace flippR_driver
{
namespace utility
{
class InputSocketHandler : public input::EventHandler
namespace networking
{
namespace input
{
class InputSocketHandler : public flippR_driver::input::EventHandler
{
public:
InputSocketHandler();
InputSocketHandler ();
void handle(input::Event &event) override;
void handle (flippR_driver::input::Event &event) override;
private:
std::string serialize_event(input::Event &event);
std::string serialize_event (flippR_driver::input::Event &event);
};
}
}
}
}

View File

@@ -0,0 +1,5 @@
//
// Created by johannes on 25.04.19.
//
#include "TcpServer.h"

View File

@@ -0,0 +1,28 @@
//
// Created by johannes on 25.04.19.
//
#ifndef FLIPPR_CODE_TCPSERVER_H
#define FLIPPR_CODE_TCPSERVER_H
namespace flippR_driver
{
namespace utility
{
namespace networking
{
namespace input
{
class TcpServer
{
};
}
}
}
}
#endif //FLIPPR_CODE_TCPSERVER_H