added inputsockethandlerfactory
This commit is contained in:
31
FlippR-Driver/networking/input/InputSocketHandlerFactory.cpp
Normal file
31
FlippR-Driver/networking/input/InputSocketHandlerFactory.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Created by johannes on 15.06.19.
|
||||
//
|
||||
|
||||
#include "InputSocketHandlerFactory.h"
|
||||
|
||||
#include "InputSocketHandler.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace networking
|
||||
{
|
||||
namespace input
|
||||
{
|
||||
using namespace Poco::Net;
|
||||
|
||||
InputSocketHandlerFactory::InputSocketHandlerFactory(std::shared_ptr<flippR_driver::input::InputDriver> inputDriver) :
|
||||
input_driver(inputDriver)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
TCPServerConnection *InputSocketHandlerFactory::createConnection(const Poco::Net::StreamSocket &socket)
|
||||
{
|
||||
return new InputSocketHandler(socket, this->input_driver);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
FlippR-Driver/networking/input/InputSocketHandlerFactory.h
Normal file
33
FlippR-Driver/networking/input/InputSocketHandlerFactory.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Created by johannes on 15.06.19.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_INPUTSOCKETHANDLERFACTORY_H
|
||||
#define FLIPPR_DRIVER_INPUTSOCKETHANDLERFACTORY_H
|
||||
|
||||
#include <Poco/Net/TCPServerConnectionFactory.h>
|
||||
#include <input/InputDriver.h>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace networking
|
||||
{
|
||||
namespace input
|
||||
{
|
||||
|
||||
class InputSocketHandlerFactory : Poco::Net::TCPServerConnectionFactory
|
||||
{
|
||||
public:
|
||||
explicit InputSocketHandlerFactory(std::shared_ptr<flippR_driver::input::InputDriver> inputDriver);
|
||||
|
||||
Poco::Net::TCPServerConnection* createConnection(const Poco::Net::StreamSocket &socket) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<flippR_driver::input::InputDriver> input_driver;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif //FLIPPR_DRIVER_INPUTSOCKETHANDLERFACTORY_H
|
||||
Reference in New Issue
Block a user