added some structure
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
// Created by rhetenor on 3/6/19.
|
||||
//
|
||||
|
||||
#include "InputSocketConnection.h"
|
||||
#include "SocketConnection.h"
|
||||
@@ -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
|
||||
@@ -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;
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
FlippR-Driver/src/utility/networking/input/TcpServer.cpp
Normal file
5
FlippR-Driver/src/utility/networking/input/TcpServer.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by johannes on 25.04.19.
|
||||
//
|
||||
|
||||
#include "TcpServer.h"
|
||||
28
FlippR-Driver/src/utility/networking/input/TcpServer.h
Normal file
28
FlippR-Driver/src/utility/networking/input/TcpServer.h
Normal 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
|
||||
Reference in New Issue
Block a user