made some stuff working 😠 @Jonas

This commit is contained in:
Johannes Wendel
2019-04-25 00:46:44 +02:00
parent 218cb65dd4
commit 878b5f52ce
32 changed files with 781 additions and 731 deletions

View File

@@ -0,0 +1,46 @@
//
// Created by rhetenor on 3/6/19.
//
#ifndef FLIPPR_CODE_OUTPUTREQUESTHANDLER_H
#define FLIPPR_CODE_OUTPUTREQUESTHANDLER_H
#include <Poco/Net/HTTPRequestHandler.h>
#include <Poco/URI.h>
#include <memory>
#include "output/OutputDriver.h"
namespace flippR_driver
{
namespace utility
{
class OutputRequestHandler : public Poco::Net::HTTPRequestHandler
{
public:
OutputRequestHandler(std::shared_ptr<output::OutputDriver> output_driver);
void handleRequest(Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) override;
private:
void parseRequest(const std::string& item_type, const std::string& item_name, const std::string& action, const std::string& score = 0);
void parseSolenoid(const std::string& item_name, const std::string& action);
void parseLamp(const std::string& item_name, const std::string& action);
void parseSound(const std::string& item_name, const std::string& action);
void parseDisplay(const std::string& item_name, const std::string& action, const std::string& score);
std::vector<std::string> getPathSegments(Poco::URI uri);
private:
std::shared_ptr<output::OutputDriver> output_driver;
};
}
}
#endif //FLIPPR_CODE_OUTPUTREQUESTHANDLER_H